/* Compact public rating tables; surrounding pages retain their original styles. */
.public-site :is(.rating-table-wrapper, .rating-table, .standings-table-section, .standings-table, .leader-board) {
    --public-accent: var(--theme-accent, #ffd700);
    --public-text: var(--theme-text, #e0e0e0);
    --public-muted: var(--theme-muted, #aaa);
    --public-surface: var(--theme-surface, #101010);
    --public-border: var(--theme-border, #383522);
    --public-highlight: var(--theme-highlight, #211d08);
    --public-table-bg: var(--theme-surface, #000);
}
.public-site :is(.rating-table-wrapper, .standings-table-section),
.public-site :is(.rating-table, .standings-table) tbody { background: var(--public-table-bg); }
.public-site :is(.rating-table, .standings-table) th {
    color: var(--public-muted);
    background: var(--public-surface);
    border-color: var(--public-border);
}
.public-site :is(.rating-table, .standings-table) tbody td {
    color: var(--public-text);
    background: var(--public-table-bg);
    border-color: var(--public-border);
}
.public-site :is(.rating-table, .standings-table) tbody tr:hover td { background: var(--public-highlight); }
.public-site .rating-table tbody td:nth-child(-n+2) { background: var(--public-table-bg); }
.public-site .rating-table tbody tr:hover td:nth-child(-n+2) { background: var(--public-highlight); }
.public-site .rating-table :is(.athlete-name, .club-name),
.public-site .rating-table a.athlete-name:hover { color: var(--public-text); text-shadow: none; }
.public-site .rating-table tbody :is(.rank-cell, .rank-1, .rank-2, .rank-3, .total-points),
.public-site .standings-table tbody td:first-child,
.public-site .standings-table tbody td:nth-child(3) { color: var(--public-accent); }
/* Stage inclusion remains visible while using the same table palette. */
.public-site .rating-table tbody td.stage-points { color: var(--public-muted); }
.public-site .rating-table tbody td.stage-points.best-stage {
    color: var(--public-accent);
    background: var(--public-highlight);
}
.public-site .rating-table tbody td.stage-included,
.public-site .rating-table tbody tr:hover td.stage-included,
.public-site .rating-card-stage-item.stage-included {
    background: var(--theme-selection, #302908);
}
.public-site .rating-table-wrapper { border: 1px solid var(--public-border); border-radius: 12px; box-shadow: none; }
.public-site .rating-table-wrapper:has(#disciplineRatingTable) {
    width: 100%;
    margin-left: 0;
    border: 1px solid var(--public-border);
    border-radius: 12px;
}
/* Stage standings can use the space beyond the page's 1200px text column. */
@media (min-width: 769px) {
    .public-site .rating-table-wrapper:has(#disciplineRatingTable) {
        width: calc(100vw - 48px);
        max-width: none;
        margin-left: calc(50% - 50vw + 24px);
    }
}
.public-site .rating-table { font-size: 14px; font-variant-numeric: tabular-nums; }
.public-site .rating-table thead { background: var(--public-surface); }
.public-site .rating-table thead th {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--public-muted);
    background: var(--public-surface);
    text-transform: none;
    letter-spacing: normal;
    border-color: var(--public-border);
}
.public-site .rating-table tbody td { padding: 8px 12px; border-color: var(--public-border); font-size: 14px; }
.public-site .rating-table tbody tr { background: transparent; }
.public-site .rating-table tbody tr:hover { background: var(--public-highlight); }
.public-site .rating-table :is(.athlete-name, .club-name) { font-size: 14px; }
.public-site .rating-table .club-name,
.public-site .rating-table tbody tr:hover .club-name { background: transparent; }
.public-site .rating-table :is(.rank-cell, .total-points) { font-size: 15px; }
.public-site .rating-table a.score-explanation-link { padding: 4px 0; }
/* Overall and category standings share column geometry at every viewport size. */
.public-site :is(#disciplineRatingTable, .category-rating-table) {
    --rank-width: 64px;
    --name-width: 200px;
    --gender-width: 50px;
    --club-width: 180px;
    --total-width: 90px;
    --stage-width: 90px;
    width: 100%;
    min-width: calc(var(--rank-width) + var(--name-width) + var(--gender-width) + var(--club-width) + var(--total-width) + var(--stage-count, 1) * var(--stage-width));
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    line-height: 1.4;
}
.public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td) {
    padding: 8px 12px;
    min-width: 0;
    max-width: none;
    vertical-align: middle;
    line-height: 1.4;
}
.public-site :is(#disciplineRatingTable, .category-rating-table) th { height: 44px; }
.public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td):first-child {
    width: var(--rank-width);
    min-width: var(--rank-width);
    position: sticky;
    left: 0;
    z-index: 4;
    text-align: center;
    padding: 8px 4px;
}
.public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td):nth-child(2) {
    width: var(--name-width);
    min-width: var(--name-width);
    position: sticky;
    left: var(--rank-width);
    z-index: 4;
    white-space: normal;
    overflow-wrap: anywhere;
}
.public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td):nth-child(3) { width: var(--gender-width); }
.public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td):nth-child(4) { width: var(--club-width); overflow-wrap: anywhere; }
.public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td):nth-child(5) { width: var(--total-width); }
.public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td):nth-child(n+5) { text-align: center; }
.public-site :is(#disciplineRatingTable, .category-rating-table) .athlete-name { font-size: 14px; font-weight: 600; line-height: inherit; }
.public-site :is(#disciplineRatingTable, .category-rating-table) .rank-cell :is(.rank-1, .rank-2, .rank-3) { font: inherit; }
.public-site :is(#disciplineRatingTable, .category-rating-table) a.score-explanation-link { padding: 0; }
.public-site .category-rating-table .category-sort { min-height: 0; padding: 0; line-height: inherit; }
@media (max-width: 768px) {
    .public-site :is(#disciplineRatingTable, .category-rating-table) {
        --rank-width: 36px;
        --name-width: 128px;
        --gender-width: 44px;
        --club-width: 128px;
        --total-width: 80px;
        --stage-width: 80px;
    }
    .public-site :is(#disciplineRatingTable, .category-rating-table) :is(th, td) { padding: 8px 6px; }
    .public-site .category-rank-label { display: none; }
    .public-site .category-rank-short { display: inline; }
}
/* Leader lists use the same surfaces and emphasis as full standings. */
.public-site .leader-board {
    color: var(--public-text);
    background: var(--public-table-bg);
    border-color: var(--public-border);
}
.public-site .leader-board header {
    padding: 10px 12px;
    background: var(--public-surface);
    border-color: var(--public-border);
}
.public-site .leader-board :is(h3, h4) {
    margin: 0;
    color: var(--public-muted);
    font-size: 14px;
    font-weight: 500;
}
.public-site .leader-entry {
    padding: 8px 12px;
    background: var(--public-table-bg);
    border-color: var(--public-border);
}
.public-site .leader-entry:hover { background: var(--public-highlight); }
.public-site .leader-place,
.public-site .leader-points strong {
    color: var(--public-accent);
    font-size: 15px;
}
.public-site .leader-name strong { color: var(--public-text); }
.public-site .leader-name span,
.public-site .leader-points span { color: var(--public-muted); }
.public-site .leader-board .standings-more {
    padding: 10px 12px;
    color: var(--public-accent);
}
@media (max-width: 768px) {
    .public-site .rating-table-wrapper:has(#clubRatingTable) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .public-site #clubRatingTable { min-width: 720px; }
    .public-site #clubRatingTable .club-name { position: static; }
    .public-site #clubRatingTable tbody td:nth-child(2) {
        position: sticky;
        left: 34px;
        z-index: 6;
        min-width: 128px;
        max-width: 160px;
        overflow-wrap: anywhere;
    }
    .public-site #clubRatingTable .stage-col { min-width: 92px; }
    /* Club names stick after the existing 34px rank column. */
    .public-site .rating-table:has(.club-name) thead th:first-child,
    .public-site .rating-table:has(.club-name) tbody td.rank-cell {
        padding: 7px 3px;
        font-size: 14px;
    }
}
@media (max-width: 480px) {
    .public-site #clubRatingTable tbody td:nth-child(2) { left: 28px; }
    .public-site .rating-table:has(.club-name) thead th:first-child,
    .public-site .rating-table:has(.club-name) tbody td.rank-cell {
        padding: 6px 2px;
        font-size: 12px;
    }
}
.public-site .rating-table-wrapper:has(#clubRatingTable):focus-visible {
    outline: 2px solid var(--public-accent);
    outline-offset: 3px;
}
