.elo-rating-page > .container {
    width: 100%;
    max-width: none;
    padding-right: clamp(14px, 2.5vw, 42px);
    padding-left: clamp(14px, 2.5vw, 42px);
}

.elo-rating-page .main-content {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
}

.elo-rating-page .main-content > main {
    min-width: 0;
}

.elo-rating-page .main-content > .sidebar {
    display: none;
}

.elo-rating-page .content-section {
    padding: clamp(16px, 3vw, 30px);
}

.elo-ratings-board {
    --elo-navy: var(--color-bg-dark, #1c2b3a);
    --elo-navy-alt: var(--color-bg-dark-alt, #162336);
    --elo-cream: var(--color-bg-card, #fffdf6);
    --elo-wine: var(--color-primary, #8b1538);
    --elo-gold: var(--color-gold, #c9913d);
    --elo-border: var(--color-border, #ddd5c0);
    --elo-muted: var(--color-text-muted, #5a6a78);
    color: var(--color-text, #1c2b3a);
    font-family: var(--font-body, Inter, system-ui, sans-serif);
    border: 1px solid var(--elo-border);
    border-radius: 14px;
    background: var(--elo-cream);
    box-shadow: 0 14px 40px rgba(28, 43, 58, .11);
    overflow: hidden;
}

.elo-ratings-board__hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding: 30px 34px 28px;
    color: #f5efe0;
    background:
        radial-gradient(circle at 82% 10%, rgba(201, 145, 61, .17), transparent 27%),
        linear-gradient(135deg, var(--elo-navy-alt), var(--elo-navy));
    border-bottom: 3px solid var(--elo-gold);
    box-shadow: none;
}

.elo-ratings-board__hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .08;
    background-image:
        linear-gradient(45deg, #fff 25%, transparent 25%),
        linear-gradient(-45deg, #fff 25%, transparent 25%);
    background-size: 64px 64px;
}

.elo-ratings-board__hero-copy,
.elo-ratings-board__count {
    position: relative;
    z-index: 1;
}

.elo-ratings-board__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: var(--elo-gold);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.elo-ratings-board__hero h2 {
    margin: 0 0 7px !important;
    color: #fff !important;
    font-family: var(--font-heading, Georgia, serif);
    font-size: clamp(1.75rem, 4vw, 2.45rem) !important;
    line-height: 1.08;
}

.elo-ratings-board__hero p {
    max-width: 670px;
    margin: 0 !important;
    color: rgba(245, 239, 224, .76) !important;
    font-size: .91rem;
}

.elo-ratings-board__count {
    display: grid;
    min-width: 92px;
    place-items: center;
    padding: 13px 18px;
    border: 1px solid rgba(201, 145, 61, .48);
    border-radius: 10px;
    background: rgba(255, 255, 255, .055);
}

.elo-ratings-board__count strong {
    color: #fff;
    font-family: var(--font-heading, Georgia, serif);
    font-size: 1.65rem;
    line-height: 1;
}

.elo-ratings-board__count span {
    margin-top: 3px;
    color: var(--elo-gold);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.elo-ratings-board__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 16px 20px;
    background: #f3eddf;
    border-bottom: 1px solid var(--elo-border);
}

.elo-ratings-board__search {
    position: relative;
    display: block;
    width: min(330px, 100%);
}

.elo-ratings-board__search svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--elo-muted);
    stroke-linecap: round;
    stroke-width: 1.8;
    transform: translateY(-50%);
}

.elo-ratings-board__search input[type="search"] {
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 9px 14px 9px 40px;
    border: 1px solid var(--elo-border);
    border-radius: 8px;
    outline: none;
    background: var(--elo-cream);
    color: var(--color-text, #1c2b3a);
    font-size: 14px;
    box-shadow: inset 0 1px 2px rgba(28, 43, 58, .04);
}

.elo-ratings-board__search input[type="search"]:focus {
    border-color: var(--elo-gold);
    box-shadow: 0 0 0 3px rgba(201, 145, 61, .17);
}

.elo-ratings-board__status {
    margin: 0 !important;
    color: var(--elo-muted) !important;
    font-size: 12px;
    text-align: right;
}

.elo-ratings-board__status span,
.elo-ratings-board__status strong {
    display: block;
}

.elo-ratings-board__status strong {
    color: var(--elo-wine);
    font-size: 13px;
}

.elo-ratings-board__scroll {
    max-width: 100%;
    overflow-x: auto;
    outline: none;
    scrollbar-color: var(--elo-gold) #eee7d8;
    scrollbar-width: thin;
}

.elo-ratings-board__scroll:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(201, 145, 61, .3);
}

.elo-ratings-table {
    width: 100%;
    min-width: 930px;
    table-layout: fixed;
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--elo-cream);
    font-variant-numeric: tabular-nums;
}

.elo-ratings-table th,
.elo-ratings-table td {
    box-sizing: border-box;
    border: 0;
}

.elo-ratings-table__groups th {
    height: 57px;
    padding: 9px 6px;
    color: #fff;
    background: var(--elo-navy);
    text-align: center;
    vertical-align: middle;
}

.elo-ratings-table__groups .elo-ratings-table__rank,
.elo-ratings-table__groups .elo-ratings-table__player {
    border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.elo-ratings-table__source {
    border-left: 1px solid rgba(255, 255, 255, .16) !important;
}

.elo-ratings-table__source span,
.elo-ratings-table__source small {
    display: block;
}

.elo-ratings-table__source span {
    font-family: var(--font-heading, Georgia, serif);
    font-size: 15px;
    letter-spacing: .01em;
}

.elo-ratings-table__source small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .57);
    font-size: 8px;
    font-weight: 600;
    letter-spacing: .05em;
    line-height: 1.2;
    text-transform: uppercase;
}

.elo-ratings-table__source--club { box-shadow: inset 0 3px var(--elo-gold); }
.elo-ratings-table__source--knsb { box-shadow: inset 0 3px var(--elo-wine); }
.elo-ratings-table__source--fide { box-shadow: inset 0 3px #7390a8; }

.elo-ratings-table__columns th {
    height: 44px;
    padding: 0;
    border-bottom: 1px solid var(--elo-border);
    background: #eee6d5;
}

.elo-ratings-table__columns th:nth-child(4),
.elo-ratings-table__columns th:nth-child(7) {
    border-left: 1px solid var(--elo-border);
}

.elo-ratings-table__columns button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 44px;
    padding: 0 3px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--elo-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .035em;
    line-height: 1;
    text-transform: uppercase;
    transition: background .18s ease, color .18s ease;
}

.elo-ratings-table__columns button:hover,
.elo-ratings-table__columns button:focus-visible {
    background: rgba(201, 145, 61, .15);
    color: var(--elo-wine);
    outline: none;
}

.elo-ratings-table__columns th[aria-sort="ascending"] button,
.elo-ratings-table__columns th[aria-sort="descending"] button {
    background: var(--elo-cream);
    color: var(--elo-wine);
    box-shadow: inset 0 -3px var(--elo-gold);
}

.elo-ratings-table__columns svg {
    width: 9px;
    height: 11px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.4;
    opacity: .38;
}

.elo-ratings-table__columns th[aria-sort="ascending"] svg,
.elo-ratings-table__columns th[aria-sort="descending"] svg {
    opacity: 1;
}

.elo-ratings-table__rank {
    width: 46px;
    text-align: center;
}

.elo-ratings-table__player {
    width: 184px;
    text-align: left !important;
}

.elo-ratings-table__rating,
.elo-ratings-table__value {
    width: calc((100% - 230px) / 9);
    min-width: 76px;
    text-align: center;
}

.elo-ratings-table tbody tr:not(.elo-ratings-table__no-results) {
    transition: background .14s ease;
}

.elo-ratings-table tbody tr:nth-child(even) {
    background: rgba(237, 230, 211, .32);
}

.elo-ratings-table tbody tr:hover {
    background: rgba(201, 145, 61, .09);
}

.elo-ratings-table tbody th,
.elo-ratings-table tbody td {
    height: 52px;
    padding: 8px 6px;
    border-bottom: 1px solid rgba(221, 213, 192, .65);
    vertical-align: middle;
}

.elo-ratings-table tbody tr:last-child th,
.elo-ratings-table tbody tr:last-child td {
    border-bottom: 0;
}

.elo-ratings-table tbody .elo-ratings-table__rank {
    color: #9a8e78;
    font-size: 11px;
    font-weight: 800;
}

.elo-ratings-table tbody .elo-ratings-table__player {
    padding-left: 13px;
    font-size: 13px;
    font-weight: 750;
}

.elo-ratings-table__player-line {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.elo-ratings-table__player-line > a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.elo-ratings-table__player a {
    color: var(--color-text, #1c2b3a);
    text-decoration: none;
}

.elo-ratings-table__player a:hover,
.elo-ratings-table__player a:focus-visible {
    color: var(--elo-wine);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.elo-ratings-table__youth-badge {
    flex: 0 0 auto;
    padding: 3px 6px 2px;
    border: 1px solid rgba(201, 145, 61, .42);
    border-radius: 999px;
    background: rgba(201, 145, 61, .13);
    color: #875b20;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .055em;
    line-height: 1.2;
    text-transform: uppercase;
}

.elo-ratings-table__rank,
.elo-ratings-table__player {
    position: sticky;
    z-index: 3;
}

.elo-ratings-table__rank { left: 0; }
.elo-ratings-table__player { left: 46px; }

.elo-ratings-table tbody .elo-ratings-table__rank,
.elo-ratings-table tbody .elo-ratings-table__player {
    background: var(--elo-cream);
}

.elo-ratings-table tbody tr:nth-child(even) .elo-ratings-table__rank,
.elo-ratings-table tbody tr:nth-child(even) .elo-ratings-table__player {
    background: #faf6ec;
}

.elo-ratings-table tbody tr:hover .elo-ratings-table__rank,
.elo-ratings-table tbody tr:hover .elo-ratings-table__player {
    background: #f8f0dd;
}

.elo-ratings-table__player {
    box-shadow: 7px 0 10px -10px rgba(28, 43, 58, .65);
}

.elo-ratings-table__value {
    color: var(--color-text, #1c2b3a);
    font-size: 13px;
}

.elo-ratings-table__value:nth-child(6),
.elo-ratings-table__value:nth-child(9) {
    border-left: 1px solid rgba(221, 213, 192, .72);
}

.elo-ratings-table__value strong {
    font-weight: 800;
}

.elo-ratings-table__value span {
    color: #b5aa95;
}

.elo-ratings-table__value--club strong { color: #7d5622; }
.elo-ratings-table__value--knsb strong { color: var(--elo-wine); }
.elo-ratings-table__value--fide strong { color: #344f67; }

.elo-ratings-table__empty,
.elo-ratings-table__no-results td {
    padding: 34px 20px !important;
    color: var(--elo-muted);
    text-align: center;
}

.elo-ratings-board__legend {
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 13px 20px;
    border-top: 1px solid var(--elo-border);
    background: #f3eddf;
    color: var(--elo-muted);
    font-size: 11px;
    margin: 0;
}

.elo-ratings-board__legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 750;
}

.elo-ratings-board__legend small {
    margin-left: auto;
    font-size: 10px;
}

.elo-ratings-board__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.elo-ratings-board__dot--club { color: var(--elo-gold); }
.elo-ratings-board__dot--knsb { color: var(--elo-wine); }
.elo-ratings-board__dot--fide { color: #617f99; }

@media (min-width: 769px) {
    .elo-ratings-table thead {
        position: sticky;
        top: 0;
        z-index: 5;
    }
}

@media (max-width: 768px) {
    .elo-rating-page .content-section {
        padding: 12px;
    }

    .elo-ratings-board__hero {
        align-items: flex-start;
        padding: 24px 20px;
    }

    .elo-ratings-board__count {
        min-width: 74px;
        padding: 10px;
    }

    .elo-ratings-board__toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
        padding: 13px;
    }

    .elo-ratings-board__search {
        width: 100%;
    }

    .elo-ratings-board__status {
        display: flex;
        gap: 5px;
        text-align: left;
    }

    .elo-ratings-board__legend {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px 14px;
    }

    .elo-ratings-board__legend small {
        flex-basis: 100%;
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .elo-ratings-board__hero-copy p { font-size: .82rem; }
    .elo-ratings-board__count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .elo-ratings-table tbody tr,
    .elo-ratings-table__columns button {
        transition: none;
    }
}
