/* ==========================================================================
   Redesigned competition page (Nations League only: SOOKIBALL_COMP_REDESIGN,
   inc/competition-page.php; markup template-parts/competition/). Loaded only
   on those competitions. Figma wS7uze7Ep3azyudK6Bhhmg: desktop 69:6098 (≥1200),
   tablet 69:9188 (576–1199), mobile 69:9866 (≤575).
   DOM is in RTL reading order; Figma strokes are "inside", so where a box has
   a 1px border its CSS padding is the drawn inset minus 1.
   ========================================================================== */

/* --- Page frame: break out of the parent's container --------------------- */

body.cpg-screen,
body.cpg-screen .site-wrapper,
body.cpg-screen .site-content {
    background-color: #070b09;
}

body.cpg-screen .site-content {
    padding: 0;
}

body.cpg-screen .site-content > .container {
    width: 100%;
    max-width: none;
    padding: 0;
}

body.cpg-screen .site-content > .container > .row {
    margin: 0;
}

body.cpg-screen .site-content .content-area {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
    padding: 0;
    margin: 0;
}

/* --- Tokens, font -------------------------------------------------------- */

.cpg-page {
    --cpg-bg:     #070b09;
    --cpg-shell:  #111613;
    --cpg-text:   #f7f8f8;
    --cpg-muted:  #a0aca4;
    --cpg-green:  #8bcb23;

    position: relative;
    direction: rtl;
    color: var(--cpg-text);
    background: var(--cpg-bg);
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    font-feature-settings: "ss02";
    text-align: right;
}

/* Dana everywhere (CLAUDE.md rule; style.css's "Main content area" block
   cannot reach an AnWP single template). */
.cpg-page,
.cpg-page
    *:not(i):not(svg):not(use):not(.fa):not(.fas):not(.far):not(.fab):not(
        .fal
    ):not(.fad):not([class*="fa-"]):not([class^="icon-"]):not(
        [class*=" icon-"]
    ):not(.dashicons):not([class^="dashicons-"]):not(.genericon):not(
        .df-icon-custom
    ) {
    font-family: "dana", Tahoma, sans-serif !important;
}

.cpg-page *,
.cpg-page *::before,
.cpg-page *::after {
    box-sizing: border-box;
}

.cpg-page :where(h1, h2, h3, p, ul, ol, dl, dd, dt) {
    margin: 0;
    padding: 0;
    letter-spacing: 0;
    text-transform: none;
}

.cpg-page :where(ul, ol) {
    list-style: none;
}

.cpg-page :where(table) {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    table-layout: fixed;
    background: none;
}

.cpg-page :where(th, td) {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    vertical-align: middle;
    text-align: inherit;
    text-transform: none;
    letter-spacing: 0;
}

.cpg-page a,
.cpg-page a:hover,
.cpg-page a:focus {
    color: inherit;
    text-decoration: none;
}

.cpg-page a[href]:hover { color: var(--cpg-green); }

.cpg-page a:focus-visible,
.cpg-page summary:focus-visible {
    outline: 2px solid var(--cpg-green);
    outline-offset: 2px;
    border-radius: 4px;
}

.cpg-page .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- Hero (decoration; the content flows over it) ------------------------ */

.cpg-hero {
    position: absolute;
    inset: 0 0 auto 0;
    height: 664px;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(7, 11, 9, .2) 0%, rgba(7, 11, 9, 0) 65.156%, #070b09 100%),
        url("../images/competition/hero.webp") center / cover no-repeat;
}

/* --- Column, breadcrumb, masthead ---------------------------------------- */

.cpg-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 108px 60px 60px;
}

.cpg-crumbs {
    margin-bottom: 26px; /* 50 to the masthead box */
    color: var(--cpg-muted);
    font-size: 12px;
    line-height: 18px;
}

.cpg-crumbs ol {
    display: flex;
    flex-wrap: wrap;
}

.cpg-crumbs li + li::before {
    content: "/";
    padding: 0 6px;
}

.cpg-crumbs a { color: var(--cpg-muted); }

.cpg-crumbs__current {
    color: #fff;
    font-weight: 700;
}

.cpg-mast {
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 10px rgba(0, 0, 0, .27), inset 0 1px 2px rgba(255, 255, 255, .03);
}

.cpg-mast__inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 104px;
}

.cpg-mast__logo {
    display: flex;
    flex: 0 0 88px;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 104px;
    border-radius: 12px;
    background: #f0f2f0;
}

.cpg-mast__logo img {
    display: block;
    width: 56.29px;
    height: 88px;
    object-fit: contain;
}

.cpg-mast__id {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cpg-page .cpg-mast__title {
    color: var(--cpg-text);
    font-size: 28px;
    font-weight: 700;
    line-height: 40px;
}

.cpg-mast__season {
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 20px;
}

/* --- Sections ------------------------------------------------------------ */

.cpg-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
    border-radius: 16px;
    background: var(--cpg-shell);
    box-shadow: 0 8px 10px rgba(0, 0, 0, .27), inset 0 1px 2px rgba(255, 255, 255, .03);
}

.cpg-page .cpg-section__title {
    color: var(--cpg-text);
    font-size: 20px;
    font-weight: 700;
    line-height: 30px;
}

/* Flags: API flag PNGs (150×150, flag centred), cropped to the flag box. */
.cpg-flag {
    display: block;
    flex: 0 0 auto;
    width: 22px;
    height: 14.3px;
    border-radius: 3px;
    object-fit: cover;
}

.cpg-flag--empty { background: rgba(247, 248, 248, .07); }
.cpg-flag--fx   { width: 28px; height: 18.2px; }
.cpg-flag--lead { width: 36px; height: 23.4px; }
.cpg-flag--row  { width: 24px; height: 15.6px; }

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

.cpg-team__name {
    overflow: hidden;
    color: var(--cpg-text);
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* --- 3. Group tables ----------------------------------------------------- */

.cpg-league {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Not drawn (Figma shows one league's groups): one heading per league. */
.cpg-page .cpg-league__title {
    color: var(--cpg-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.cpg-league__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 16px;
}

.cpg-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 12px 12px 12px 10px; /* Figma insets 13 right / 11 left, minus the border */
    border: 1px solid rgba(247, 248, 248, .05);
    border-radius: 12px;
    background: rgba(247, 248, 248, .01);
}

.cpg-page .cpg-group__badge {
    align-self: flex-start;
    width: 88px;
    height: 32px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(139, 203, 35, .12);
    color: var(--cpg-green);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
}

/* Gap 4 between columns = 4px start padding on every cell but the last. */
.cpg-gt th,
.cpg-gt td {
    padding-left: 4px;
    text-align: center;
}

.cpg-gt th:last-child,
.cpg-gt td:last-child { padding-left: 0; }

.cpg-gt .cpg-gt__rank { width: 28px; }
.cpg-gt .cpg-gt__team { width: 260px; text-align: right; }
.cpg-gt thead th { width: 40px; }
.cpg-gt thead th:last-child { width: 36px; }
.cpg-gt thead .cpg-gt__rank { width: 28px; }
.cpg-gt thead .cpg-gt__team { width: 260px; }

.cpg-gt thead th {
    height: 36px;
    background: rgba(247, 248, 248, .04);
    color: var(--cpg-muted);
    font-size: 11px;
    line-height: 18px;
}

.cpg-gt tbody td,
.cpg-gt tbody th {
    height: 52px;
}

.cpg-gt tr > :first-child { border-radius: 0 4px 4px 0; }
.cpg-gt tr > :last-child { border-radius: 4px 0 0 4px; }

.cpg-gt__row--1 > * { background: rgba(139, 203, 35, .05) !important; }
.cpg-gt__row--3 > * { background: rgba(247, 248, 248, .02) !important; }

.cpg-gt td.cpg-gt__rank {
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 20px;
}

.cpg-gt tbody td {
    color: var(--cpg-text);
    font-size: 14px;
    line-height: 22px;
}

.cpg-gt td.cpg-gt__points {
    color: var(--cpg-green);
    font-weight: 600;
}

.cpg-gt .cpg-team__name { font-size: 14px; line-height: 22px; }

.cpg-acc { display: none; }

/* --- 4. Matchday fixtures ------------------------------------------------ */

.cpg-weeks {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(139, 203, 35, .05);
}

.cpg-weeks__list {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: space-evenly;
}

.cpg-weeks__arrow {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(247, 248, 248, .04);
}

.cpg-weeks__arrow img {
    display: block;
    width: 16px;
    height: 20px;
}

.cpg-weeks__arrow[aria-disabled="true"] {
    opacity: .4;
    cursor: default;
}

.cpg-weeks__chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 44px;
    padding: 0 8px;
    border-radius: 10px;
    color: var(--cpg-muted) !important;
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
}

.cpg-weeks__chip:hover { color: var(--cpg-text) !important; }

.cpg-weeks__chip.is-current,
.cpg-tabs__tab.is-current {
    background: linear-gradient(180deg, #79ad11, #3a9b0f);
    box-shadow: inset 0 .727px .727px rgba(255, 255, 255, .35), 0 2.182px 2.909px rgba(223, 229, 255, .3);
    color: var(--cpg-text) !important;
    font-weight: 600;
}

.cpg-weeks__short { display: none; }

.cpg-fixtures__count {
    display: none;
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 22px;
}

.cpg-empty {
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 22px;
}

.cpg-day {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cpg-page .cpg-day__title {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(247, 248, 248, .05);
    color: var(--cpg-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
}

.cpg-day__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cpg-fx {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 12px 12px 12px 10px; /* 13 right / 11 left as drawn, minus the border */
    border: 1px solid rgba(247, 248, 248, .05);
    border-radius: 10px;
    background: rgba(247, 248, 248, .02);
    cursor: pointer;
}

.cpg-fx__time {
    display: flex;
    gap: 8px;
    height: 20px;
}

.cpg-fx__ko {
    flex: 1 1 auto;
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 20px;
}

.cpg-fx__status {
    flex: 0 0 auto;
    min-width: 48px;
    color: var(--cpg-muted);
    font-size: 12px;
    line-height: 20px;
    white-space: nowrap;
}


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

.cpg-fx__team {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cpg-fx__name {
    max-width: 100%;
    overflow: hidden;
    color: var(--cpg-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cpg-fx__score {
    display: flex;
    flex: 0 0 68px;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 40px;
    border-radius: 8px;
    background: rgba(247, 248, 248, .04);
}

.cpg-fx__goals {
    width: 26px;
    color: var(--cpg-text);
    font-size: 18px;
    font-weight: 600;
    line-height: 30px;
    text-align: center;
}

.cpg-fx__dash {
    width: 16px;
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

.cpg-fx__score.is-pending .cpg-fx__goals { display: none; }

/* --- 5. Season leaders --------------------------------------------------- */

.cpg-leaders__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px 16px;
}

.cpg-lc {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px 16px 12px 14px; /* 17 right / 15 left as drawn (desktop) */
    border: 1px solid rgba(247, 248, 248, .06);
    border-radius: 12px;
    background: rgba(247, 248, 248, .03);
}

.cpg-page .cpg-lc__title {
    color: var(--cpg-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.cpg-lc__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cpg-lc__rank {
    flex: 0 0 12px;
    width: 12px;
    color: var(--cpg-muted);
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.cpg-lc__name {
    min-width: 0;
    overflow: hidden;
    color: var(--cpg-text);
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cpg-lc__lead {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(247, 248, 248, .07);
    box-sizing: content-box !important;
}

.cpg-lc__who {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.cpg-lc__who .cpg-lc__name {
    max-width: 100%;
    font-size: 16px;
    line-height: 24px;
}

.cpg-lc__score {
    display: flex;
    flex: 0 0 72px;
    flex-direction: column;
    align-items: center;
    width: 72px;
}

.cpg-lc__lead .cpg-lc__value {
    color: var(--cpg-green);
    font-size: 28px;
    font-weight: 600;
    line-height: 38px;
}

.cpg-lc__unit {
    color: var(--cpg-muted);
    font-size: 12px;
    line-height: 20px;
    white-space: nowrap;
}

.cpg-lc__row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
}

.cpg-lc__row .cpg-lc__name {
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 22px;
}

.cpg-lc__row .cpg-lc__value {
    flex: 0 0 52px;
    width: 52px;
    color: var(--cpg-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
}

/* --- 6. Player stats ----------------------------------------------------- */

.cpg-tabs__track {
    display: flex;
    height: 52px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .02);
}

.cpg-tabs__track li {
    flex: 1 1 0;
    min-width: 0;
}

.cpg-tabs__tab {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 8px;
    border-radius: 10px;
    color: var(--cpg-muted) !important;
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
}

.cpg-tabs__tab:hover { color: var(--cpg-text) !important; }

.cpg-st__wrap {
    overflow: hidden;
    border-radius: 8px;
}

/* Column gap = start padding on every cell but the last. */
.cpg-st th,
.cpg-st td { padding-left: 16px; }

.cpg-st th:last-child,
.cpg-st td:last-child { padding-left: 0; }

.cpg-st .cpg-st__rank    { width: 56px; text-align: center; }  /* 40 + 16 */
.cpg-st .cpg-st__player  { text-align: right; }
.cpg-st .cpg-st__country { width: 224px; }                     /* 208 + 16 */
.cpg-st .cpg-st__value   { width: 120px; text-align: center; }

.cpg-st thead th {
    height: 40px;
    background: rgba(247, 248, 248, .04);
    color: var(--cpg-muted);
    font-size: 12px;
    line-height: 20px;
}

.cpg-st__narrow { display: none; }

.cpg-st tbody tr > * { height: 56px; }
.cpg-st tbody tr:nth-child(odd) > * { background: rgba(247, 248, 248, .02); }

.cpg-st tbody .cpg-st__rank {
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 22px;
}

.cpg-st__name {
    display: block;
    overflow: hidden;
    color: var(--cpg-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cpg-st__player .cpg-st__from { display: none; }

.cpg-st__from {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--cpg-muted);
    font-size: 14px;
    line-height: 22px;
    white-space: nowrap;
}

.cpg-st__from a { color: var(--cpg-muted); }

.cpg-st tbody .cpg-st__value {
    color: var(--cpg-green);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
}

.cpg-st__empty td {
    padding: 0 16px !important;
    color: var(--cpg-muted);
    text-align: center !important;
}

/* ==========================================================================
   576–1199 (tablet, frame 834)
   ========================================================================== */

@media (max-width: 1199px) {
    .cpg-hero { height: 450px; }

    .cpg-wrap {
        gap: 32px;
        padding: 124px 32px 32px;
    }

    .cpg-crumbs { margin-bottom: 0; }

    .cpg-mast {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* Sections on the page background; «بازی‌های هفته» keeps its shell. */
    .cpg-section {
        gap: 16px;
        padding: 0;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .cpg-section--shell {
        gap: 20px;
        padding: 16px;
        border-radius: 16px;
        background: var(--cpg-shell);
        box-shadow: 0 8px 10px rgba(0, 0, 0, .27), inset 0 1px 2px rgba(255, 255, 255, .03);
    }

    /* Groups: accordion cards. */
    .cpg-groups { gap: 16px; }

    .cpg-league__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .cpg-group {
        gap: 8px;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none;
    }

    .cpg-gt { display: none; }

    .cpg-acc {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Card = header row (club link) + <details> whose <summary> is the
       chevron, placed on the header's end so the link is never inside it. */
    .cpg-tc {
        position: relative;
        border: 1px solid rgba(247, 248, 248, .12);
        border-radius: 12px;
        background: var(--cpg-shell);
    }

    .cpg-tc__head {
        display: flex;
        align-items: center;
        gap: 12px;
        min-height: 64px;
        padding: 10px 11px;
        padding-inline-end: 67px; /* 11 + 44 chevron + 12 gap */
        cursor: pointer;
    }

    .cpg-tc__rank {
        flex: 0 0 24px;
        color: var(--cpg-muted);
        font-size: 14px;
        line-height: 20px;
        text-align: center;
    }

    .cpg-tc__team {
        flex: 1 1 auto;
    }

    .cpg-tc__team .cpg-team__name {
        font-size: 14px;
        line-height: 22px;
    }

    .cpg-tc__sum {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .cpg-tc__sum--played { flex: 0 0 34px; }
    .cpg-tc__sum--points { flex: 0 0 38px; }

    .cpg-tc__label {
        color: var(--cpg-muted);
        font-size: 12px;
        line-height: 20px;
        white-space: nowrap;
    }

    .cpg-tc__value {
        color: var(--cpg-text);
        font-size: 14px;
        line-height: 22px;
    }

    .cpg-tc__sum--points .cpg-tc__value {
        color: var(--cpg-green);
        font-weight: 600;
    }

    .cpg-tc__chev {
        position: absolute;
        top: 10px;
        inset-inline-end: 11px;
        display: block;
        width: 44px;
        height: 44px;
        border-radius: 8px;
        list-style: none;
        cursor: pointer;
        background: url("../images/competition/arrow-down.svg") center / 20px 20px no-repeat;
        transition: transform .2s ease;
    }

    .cpg-tc__chev::-webkit-details-marker { display: none; }
    .cpg-tc__chev::marker { content: ""; }

    .cpg-tc__more[open] .cpg-tc__chev { transform: rotate(180deg); }

    .cpg-tc__panel {
        display: flex;
        gap: 4px;
        padding: 0 11px 12px;
    }

    .cpg-tc__cell {
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        min-width: 0;
        padding: 8px 0;
        border-radius: 6px;
        background: rgba(247, 248, 248, .03);
    }

    .cpg-tc__cell dt {
        color: var(--cpg-muted);
        font-size: 12px;
        font-weight: 400;
        line-height: 18px;
    }

    .cpg-tc__cell dd {
        color: var(--cpg-text);
        font-size: 14px;
        line-height: 22px;
    }

    .cpg-tc__cell--points dd {
        color: var(--cpg-green);
        font-weight: 600;
    }

    /* Week bar: the cluster sits at the start (right), as drawn. */
    .cpg-weeks { gap: 8px; }

    .cpg-weeks__list {
        flex: 0 0 auto;
        justify-content: flex-start;
        gap: 8px;
    }

    .cpg-fixtures__count { display: block; }

    .cpg-day__grid { grid-template-columns: minmax(0, 1fr); }

    .cpg-lc { padding-left: 16px; } /* 17 / 17 on tablet and mobile */

    /* Leaders: 2 per row, the 9th alone on the right. */
    .cpg-leaders__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }

    /* Stats. */
    .cpg-stats { gap: 20px; }

    .cpg-tabs__track {
        gap: 6px;
        height: auto;
        padding: 0;
    }

    .cpg-tabs__tab {
        min-height: 44px;
        height: auto;
    }

    .cpg-st th,
    .cpg-st td { padding-left: 8px; }

    .cpg-st th:last-child,
    .cpg-st td:last-child { padding-left: 0; }

    .cpg-st .cpg-st__rank    { width: 40px; }   /* 32 + 8 */
    .cpg-st .cpg-st__country { width: 168px; }  /* 160 + 8 */
    .cpg-st .cpg-st__value   { width: 100px; }

    .cpg-st thead th { height: 44px; }
    .cpg-st tbody tr > * { height: 60px; }
}

/* Small hero file below 900px. */
@media (max-width: 899px) {
    .cpg-hero {
        background-image:
            linear-gradient(180deg, rgba(7, 11, 9, .2) 0%, rgba(7, 11, 9, 0) 65.156%, #070b09 100%),
            url("../images/competition/hero-900.webp");
    }
}

/* ==========================================================================
   ≤575 (mobile, frame 390)
   ========================================================================== */

@media (max-width: 575px) {
    .cpg-hero {
        background-size: 100% 100%, auto 100%;
        background-position: 0 0, 32.2% 0;
    }

    .cpg-wrap { padding: 116px 16px 32px; }

    /* Breadcrumb under the masthead (Q9: CSS order, DOM stays in reading order). */
    .cpg-mast { order: -1; }

    .cpg-section--shell { padding: 12px; }

    .cpg-tc__head {
        gap: 6px;
        padding-inline-end: 61px; /* 11 + 44 + 6 */
    }

    .cpg-tc__panel {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "w d l gd"
            "gf gf ga ga";
        gap: 8px 4px;
    }

    .cpg-tc__cell--played,
    .cpg-tc__cell--points { display: none; }

    .cpg-tc__cell--won   { grid-area: w; }
    .cpg-tc__cell--drawn { grid-area: d; }
    .cpg-tc__cell--lost  { grid-area: l; }
    .cpg-tc__cell--gd    { grid-area: gd; }
    .cpg-tc__cell--gf    { grid-area: gf; }
    .cpg-tc__cell--ga    { grid-area: ga; }

    .cpg-weeks {
        gap: 4px;
        padding: 0;
    }

    .cpg-weeks__list {
        flex: 1 1 auto;
        gap: 4px;
    }

    .cpg-weeks__list li { flex: 1 1 0; min-width: 0; }

    .cpg-weeks__arrow {
        flex: 0 0 36px;
        width: 36px;
    }

    .cpg-weeks__chip {
        width: 100%;
        padding: 0;
    }

    .cpg-weeks__long { display: none; }
    .cpg-weeks__short { display: inline; }

    .cpg-leaders__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .cpg-tabs__track {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .cpg-tabs__track::-webkit-scrollbar { display: none; }

    .cpg-tabs__track li { flex: 0 0 100px; }

    .cpg-st__country { display: none; }

    .cpg-st__wide { display: none; }
    .cpg-st__narrow { display: inline; }

    .cpg-st .cpg-st__value { width: 72px; }

    .cpg-st tbody tr > * { height: 76px; }

    .cpg-st__player .cpg-st__from {
        display: flex;
        margin-top: 4px;
    }
}

/* Link text colours: `.cpg-page a { color: inherit }` would otherwise hand
   these the parent theme's table-cell grey. */
.cpg-page a.cpg-st__name,
.cpg-page a.cpg-fx__name,
.cpg-page a.cpg-team__name,
.cpg-page .cpg-lc__name a {
    color: var(--cpg-text);
}

.cpg-page .cpg-st__from a { color: var(--cpg-muted); }

.cpg-page a.cpg-st__name:hover,
.cpg-page a.cpg-fx__name:hover,
.cpg-page a.cpg-team__name:hover,
.cpg-page .cpg-lc__name a:hover,
.cpg-page .cpg-st__from a:hover {
    color: var(--cpg-green);
}

/* Stats tab track and table, values from the designer (Figma 69:9757): no
   strokes anywhere; the faint edge below 1200 is an inset shadow. */
.cpg-st thead th:first-child { border-radius: 0 8px 8px 0; }
.cpg-st thead th:last-child  { border-radius: 8px 0 0 8px; }

@media (max-width: 1199px) {
    .cpg-tabs__track { box-shadow: inset 0 1px 2px rgba(255, 255, 255, .03); }

    .cpg-st thead th,
    .cpg-st tbody tr:nth-child(odd) > * {
        box-shadow: inset 0 1px 2px rgba(255, 255, 255, .03);
    }
}

/* Mobile: the nav is the 358 viewport; the track sizes to its 6 × 100 tabs
   (630 with gaps), starts at the right and is cut off by the viewport. */
@media (max-width: 575px) {
    .cpg-tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .cpg-tabs::-webkit-scrollbar { display: none; }

    .cpg-tabs__track {
        width: max-content;
        overflow: visible;
    }
}

/* No JS: the selected tab of the mobile strip is its initial scroll target
   (Chrome 133+); js/competition-page.js does the same elsewhere. */
@media (max-width: 575px) {
    .cpg-tabs__track li.is-current { scroll-initial-target: nearest; }
}
