/* rating.css */

[hidden] {
    display: none !important;
}

.table-container {
    overflow-x: auto;
    border-radius: 16px;
    margin-top: 15px;
    background:
        linear-gradient(180deg, rgba(31, 38, 54, 0.9), rgba(14, 18, 28, 0.92)),
        radial-gradient(circle at top right, rgba(255, 223, 143, 0.07), transparent 40%);
    padding: 16px;
    border: 1px solid rgba(255, 223, 143, 0.13);
    box-shadow:
        0 0 0 1px rgba(126, 136, 164, 0.08),
        0 20px 44px rgba(0, 0, 0, 0.28);
    position: relative;
}

.table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 223, 143, 0.34), transparent);
    opacity: 0.75;
    pointer-events: none;
}

#players-table.show-hideout-rating th[data-column="rating2"],
#players-table.show-hideout-rating td.player-cell-hideout {
    width: 110px;
    text-align: center;
    padding: 14px 8px;
}

#players-table.show-hideout-rating th[data-column="gamesPlayed"],
#players-table.show-hideout-rating td.player-cell-games {
    width: 72px;
    text-align: center;
    padding: 14px 8px;
}

#players-table.show-hideout-rating th[data-column="wins"],
#players-table.show-hideout-rating td.player-cell-wins {
    width: 112px;
    text-align: center;
    padding: 14px 8px;
}

#players-table.show-hideout-rating th[data-column="losses"],
#players-table.show-hideout-rating td.player-cell-losses {
    width: 112px;
    text-align: center;
    padding: 14px 8px;
}

#players-table.show-hideout-rating th[data-column="winLoss"],
#players-table.show-hideout-rating td.player-cell-winloss {
    width: 112px;
    text-align: center;
    padding: 14px 8px;
}

#players-table.show-hideout-rating th[data-column="winrate"],
#players-table.show-hideout-rating td.winrate-cell {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    text-align: center;
    padding: 14px 8px;
}

#players-table.show-hideout-rating th[data-column="streak"],
#players-table.show-hideout-rating tbody tr td:last-child {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
    padding: 14px 8px;
}

#players-table.show-hideout-rating thead tr th:last-child {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
}

#players-table.show-hideout-rating td.player-cell-hideout .player-rating-value {
    display: inline-block;
    font-weight: 800;
}

#players-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    background: rgba(9, 12, 20, 0.22);
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
}

.players-loading-row {
    pointer-events: none;
}

.players-loading-cell {
    padding: 10px 16px !important;
}

.players-loading-line {
    display: block;
    width: 100%;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 223, 143, 0.11), rgba(255, 255, 255, 0.05));
    background-size: 220% 100%;
    animation: players-loading-shimmer 1.2s ease-in-out infinite;
}

@keyframes players-loading-shimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

#players-table thead {
    background: linear-gradient(180deg, rgba(50, 59, 82, 0.96), rgba(25, 31, 45, 0.99));
}

#players-table th:nth-child(1),
#players-table td:nth-child(1) {
    width: 60px;
    text-align: left;
    padding: 14px 8px 14px 16px;
}

#players-table th:nth-child(2),
#players-table td:nth-child(2) {
    width: 185px;
    min-width: 185px;
    padding: 14px 12px;
    text-align: left;
}

#players-table th:nth-child(3),
#players-table td:nth-child(3) {
    width: 110px;
    text-align: center;
    padding: 14px 8px;
}

#players-table th[data-column="gamesPlayed"],
#players-table td.player-cell-games {
    width: 90px;
    text-align: center;
    padding: 14px 8px;
}

#players-table th[data-column="wins"],
#players-table td.player-cell-wins {
    width: 140px;
    text-align: center;
    padding: 14px 8px;
}

#players-table th[data-column="losses"],
#players-table td.player-cell-losses {
    width: 140px;
    text-align: center;
    padding: 14px 8px;
}

#players-table:not(.show-hideout-rating) th[data-column="winrate"],
#players-table:not(.show-hideout-rating) td.winrate-cell {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    text-align: center;
    padding: 14px 8px;
}

#players-table:not(.show-hideout-rating) th[data-column="streak"],
#players-table:not(.show-hideout-rating) tbody tr td:last-child {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
    padding: 14px 8px;
}

#players-table:not(.show-hideout-rating) th:nth-child(6),
#players-table:not(.show-hideout-rating) td:nth-child(6) {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
}

#players-table:not(.show-hideout-rating) th:nth-child(7),
#players-table:not(.show-hideout-rating) td:nth-child(7) {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

#players-table:not(.show-hideout-rating) thead tr th:nth-last-child(2) {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
}

#players-table:not(.show-hideout-rating) thead tr th:last-child {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
}

#players-table th[data-column="winrate"],
#players-table td.winrate-cell {
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    text-align: center;
    padding: 14px 8px;
}

#players-table th[data-column="streak"],
#players-table tbody tr td:last-child {
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    text-align: center;
    padding: 14px 8px;
}

#players-table th {
    color: #ffdf8f;
    font-weight: 700;
    font-size: 1em;
    border-bottom: 2px solid rgba(255, 223, 143, 0.28);
    position: relative;
    transition: all 0.3s ease;
    user-select: none;
    cursor: pointer;
    padding-right: 25px !important;
}

#players-table th.player-header-wins {
    color: #28a745 !important;
}

#players-table th.player-header-losses {
    color: #dc3545 !important;
}

#players-table th:hover {
    background: linear-gradient(145deg, #3a3f52, #2a2f42);
    color: #ffdf8f;
}

#players-table td {
    color: #e2e8f5;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 47px;
    padding: 6px 12px;
    font-size: 1em;
}

#players-table td:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 0;
    text-align: left;
    color: #edf2fb !important;
}

#players-table tr {
    background: linear-gradient(180deg, rgba(31, 38, 54, 0.9), rgba(24, 29, 42, 0.94));
    transition: all 0.3s ease;
    height: 47px;
    transform: translateX(0);
}

#players-table tr:nth-child(even) {
    background: linear-gradient(180deg, rgba(25, 31, 45, 0.94), rgba(19, 24, 36, 0.96));
}

#players-table tr.top-1 {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.34), rgba(255, 107, 107, 0.2) 24%, rgba(52, 34, 40, 0.78) 56%, rgba(25, 30, 43, 0.98) 92%) !important;
    border-left: 0px solid #ff6b6b;
}

#players-table tr.top-2 {
    background: linear-gradient(90deg, rgba(255, 157, 107, 0.32), rgba(255, 157, 107, 0.19) 24%, rgba(53, 39, 34, 0.77) 56%, rgba(25, 30, 43, 0.98) 92%) !important;
    border-left: 0px solid #ff9d6b;
}

#players-table tr.top-3 {
    background: linear-gradient(90deg, rgba(255, 206, 107, 0.3), rgba(255, 206, 107, 0.18) 24%, rgba(53, 45, 34, 0.76) 56%, rgba(25, 30, 43, 0.98) 92%) !important;
    border-left: 0px solid #ffce6b;
}

#players-table tr.active-player-4-9 {
    background: rgba(28, 34, 48, 0.88) !important;
    border-left: none;
}

#players-table tr.active-player-4-9:nth-child(even) {
    background: rgba(21, 26, 38, 0.94) !important;
}

#players-table tr:hover {
    background: rgba(255, 223, 143, 0.1) !important;
    transform: translateX(3px);
}

#players-table tr.top-1:hover {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.43), rgba(255, 107, 107, 0.25) 26%, rgba(60, 36, 42, 0.84) 58%, rgba(34, 22, 26, 0.95) 92%) !important;
    transform: translateX(3px);
}

#players-table tr.top-2:hover {
    background: linear-gradient(90deg, rgba(255, 157, 107, 0.41), rgba(255, 157, 107, 0.24) 26%, rgba(60, 42, 35, 0.83) 58%, rgba(34, 26, 22, 0.95) 92%) !important;
    transform: translateX(3px);
}

#players-table tr.top-3:hover {
    background: linear-gradient(90deg, rgba(255, 206, 107, 0.37), rgba(255, 206, 107, 0.22) 26%, rgba(60, 48, 35, 0.82) 58%, rgba(34, 29, 22, 0.95) 92%) !important;
    transform: translateX(3px);
}

#players-table tr.active-player-4-9:hover {
    background: rgba(255, 223, 143, 0.1) !important;
    transform: translateX(3px);
}

#players-table tr.active-player-4-9:nth-child(even):hover {
    background: rgba(255, 223, 143, 0.1) !important;
    transform: translateX(3px);
}

#players-table td:nth-child(2) .player-nickname {
    cursor: pointer;
    color: #fff9e7 !important;
    display: inline-block;
    font-size: 1em;
    font-weight: 700;
}

#players-table td:nth-child(2) .player-nickname-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    vertical-align: middle;
}

#players-table td:nth-child(2) .player-avatar {
    position: absolute;
    inset: 0;
    display: block;
    width: calc(1.05em + 4px);
    height: calc(1.05em + 4px);
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.08);
}

#players-table td:nth-child(2) .player-avatar-frame {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: calc(1.05em + 4px);
    height: calc(1.05em + 4px);
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

#players-table td:nth-child(2) .player-avatar-fallback {
    color: #fff9e7;
    font-size: 0.68em;
    font-weight: 800;
    line-height: 1;
}

#players-table td:nth-child(2) .player-avatar.is-broken {
    display: none;
}

#players-table td:nth-child(3) .player-rating-value {
    display: inline-block;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

#players-table td:nth-child(3) .player-rating-value.rating-elite {
    color: #ff6652;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.56),
        0 0 12px rgba(255, 102, 82, 0.24),
        0 0 20px rgba(159, 20, 9, 0.12);
}

#players-table td:nth-child(3) .player-rating-value.rating-high {
    color: #ff9588;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.42),
        0 0 8px rgba(255, 149, 136, 0.14);
}

#players-table td:nth-child(3) .player-rating-value.rating-upper-mid {
    color: #ffad42;
}

#players-table td:nth-child(3) .player-rating-value.rating-mid {
    color: #ffe08a;
}

#players-table td:nth-child(3) .player-rating-value.rating-low-mid {
    color: #fff0bf;
}

#players-table td:nth-child(3) .player-rating-value.rating-base {
    color: #ffffff;
}

#players-table tr.top-1 td:nth-child(2) .player-nickname {
    color: #ff6b6b !important;
    text-shadow: 0 0 6px rgba(255, 107, 107, 0.6);
    font-weight: 800 !important;
}

#players-table tr.top-2 td:nth-child(2) .player-nickname {
    color: #ff9d6b !important;
    text-shadow: 0 0 6px rgba(255, 157, 107, 0.6);
    font-weight: 800 !important;
}

#players-table tr.top-3 td:nth-child(2) .player-nickname {
    color: #ffce6b !important;
    text-shadow: 0 0 6px rgba(255, 206, 107, 0.6);
    font-weight: 800 !important;
}

#players-table tr.active-player-4-9 td:nth-child(2) .player-nickname {
    color: #f2d16b !important;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(242, 209, 107, 0.3);
}

#players-table td.player-cell-wins {
    color: #28a745 !important;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 0 4px rgba(40, 167, 69, 0.3);
}

#players-table td.player-cell-losses {
    color: #dc3545 !important;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 0 4px rgba(220, 53, 69, 0.3);
}

.win-streak { color: #28a745; font-weight: 600; }
.lose-streak { color: #dc3545; font-weight: 600; }
.win-streak-high {
    color: #86fc8a !important;
    font-weight: 800;
    text-shadow: 0 0 6px rgba(134, 252, 138, 0.7);
    animation: pulse-win 2.2s 2;
}
.win-streak-shield {
    color: #35b85a !important;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(53, 184, 90, 0.38);
}
.win-streak-laurel {
    color: #86fc8a !important;
    text-shadow: 0 0 7px rgba(134, 252, 138, 0.74);
}
.win-streak-winged {
    color: #b6ff7a !important;
    text-shadow:
        0 0 7px rgba(182, 255, 122, 0.78),
        0 0 13px rgba(135, 194, 47, 0.32);
}
.win-streak-crowned {
    color: #f2c15d !important;
    text-shadow:
        0 0 6px rgba(242, 193, 93, 0.7),
        0 0 12px rgba(164, 106, 26, 0.35);
}
.lose-streak-high {
    color: #fd8962 !important;
    font-weight: 800;
    text-shadow: 0 0 6px rgba(253, 137, 98, 0.7);
    animation: pulse-lose 2.2s 2;
}
.lose-streak-shield {
    color: #f5a623 !important;
    text-shadow: 0 0 6px rgba(245, 166, 35, 0.65);
}
.lose-streak-flag {
    color: #fd8962 !important;
    text-shadow: 0 0 7px rgba(253, 137, 98, 0.74);
}

.streak-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.streak-meteor-up {
    display: inline-block;
    width: 34px;
    height: 22px;
    flex: 0 0 34px;
    background-color: currentColor;
    mask: url('/static/image/streak-meteor.svg?v=20260512-2') center / contain no-repeat;
    -webkit-mask: url('/static/image/streak-meteor.svg?v=20260512-2') center / contain no-repeat;
    filter:
        drop-shadow(0 0 4px rgba(134, 252, 138, 0.58))
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.18));
    animation: meteor-rise 1.8s ease-in-out infinite;
}

.streak-icon {
    display: inline-block;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.streak-win-2-3-icon {
    background-image: url('/static/image/streak-win-2-3.png?v=20260925-1');
}

.streak-win-4-6-icon {
    background-image: url('/static/image/streak-win-4-6.png?v=20260925-1');
}

.streak-win-7-plus-icon {
    background-image: url('/static/image/streak-win-7-plus.png?v=20260925-1');
}

.streak-loss-2-3-icon {
    background-image: url('/static/image/streak-loss-2-3.png?v=20260925-1');
}

.streak-loss-4-6-icon {
    background-image: url('/static/image/streak-loss-4-6.png?v=20260925-1');
}

.streak-loss-7-plus-icon {
    background-image: url('/static/image/streak-loss-7-plus.png?v=20260925-1');
}
.streak-arrow-up {
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2386fc8a'%3E%3Cpath d='M12 4l-8 8h6v8h4v-8h6z'/%3E%3C/svg%3E") no-repeat center;
}

.streak-arrow-down {
    width: 14px;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fd8962'%3E%3Cpath d='M12 20l8-8h-6V4h-4v8H4z'/%3E%3C/svg%3E") no-repeat center;
}

@keyframes meteor-rise {
    0%, 100% {
        transform: translate3d(-1px, 1px, 0);
    }
    50% {
        transform: translate3d(2px, -2px, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .streak-meteor-up {
        animation: none;
    }
}
.winrate-cell {
    width: 130px;
    text-align: center;
    padding: 14px 8px;
}

.winrate-container {
    position: relative;
    width: 100%;
    height: 22px;
    padding: 0 24px 0 0;
    align-items: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        linear-gradient(135deg, rgba(24, 28, 40, 0.98), rgba(16, 19, 28, 0.98));
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    border: 1px solid rgba(255, 223, 143, 0.2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 1px 4px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.winrate-container::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 5px;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 45%),
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.025),
            rgba(255, 255, 255, 0.025) 2px,
            transparent 2px,
            transparent 7px
        );
    pointer-events: none;
}

.winrate-fill {
    position: relative;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    min-width: 8px;
    border-radius: 5px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset -1px 0 0 rgba(255, 255, 255, 0.18),
        0 0 10px rgba(255, 183, 77, 0.18);
}

.winrate-text {
    position: relative;
    z-index: 2;
    font-size: 0.8em;
    font-weight: 800;
    color: #fff6de;
    letter-spacing: 0.03em;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.85),
        0 0 6px rgba(255, 223, 143, 0.08);
}

.winrate-notch {
    position: absolute;
    right: 8px;
    top: 50%;
    z-index: 2;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    transform: translateY(-50%) rotate(45deg);
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.winrate-high .winrate-fill {
    background: linear-gradient(90deg, #f6b94d 0%, #ffd54f 55%, #f4a621 100%);
}

.winrate-medium .winrate-fill {
    background: linear-gradient(90deg, #f08f35 0%, #ffad42 55%, #df6e13 100%);
}

.winrate-low .winrate-fill {
    background: linear-gradient(90deg, #c75a33 0%, #ec744a 55%, #a63f1e 100%);
}

.winrate-high .winrate-notch {
    background: rgba(255, 213, 79, 0.18);
    border-color: rgba(255, 231, 160, 0.4);
}

.winrate-medium .winrate-notch {
    background: rgba(255, 167, 38, 0.16);
    border-color: rgba(255, 204, 128, 0.34);
}

.winrate-low .winrate-notch {
    background: rgba(255, 112, 67, 0.14);
    border-color: rgba(255, 171, 145, 0.28);
}

.winrate-container:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 223, 143, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 10px 20px rgba(0, 0, 0, 0.24);
}

.winrate-container:hover .winrate-fill {
    filter: brightness(1.06);
}

.winrate-high:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 12px 24px rgba(0, 0, 0, 0.25),
        0 0 18px rgba(255, 193, 7, 0.12);
}

.winrate-medium:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 12px 24px rgba(0, 0, 0, 0.22),
        0 0 14px rgba(245, 124, 0, 0.1);
}

.winrate-low:hover {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 12px 24px rgba(0, 0, 0, 0.22),
        0 0 12px rgba(216, 67, 21, 0.1);
}

.players-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    gap: 15px;
    position: relative;
    z-index: 25;
}

.players-header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    position: relative;
    overflow: visible;
    z-index: 26;
}

.players-header-actions {
    position: absolute;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.players-header h2 {
    text-align: center;
    margin: 0;
}

.players-filter-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 223, 143, 0.28);
    background: linear-gradient(180deg, rgba(33, 39, 55, 0.95), rgba(21, 26, 38, 0.96));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.players-add-button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 223, 143, 0.28);
    background: linear-gradient(180deg, rgba(33, 39, 55, 0.95), rgba(21, 26, 38, 0.96));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffdf8f;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    padding: 0;
}

.players-add-button:hover,
.players-add-button:focus-visible,
.players-add-button[aria-expanded="true"] {
    transform: translateY(-1px);
    border-color: rgba(255, 223, 143, 0.55);
    background: linear-gradient(180deg, rgba(44, 51, 70, 0.98), rgba(28, 34, 48, 0.98));
}

.players-filter-button:hover,
.players-filter-button[aria-expanded="true"] {
    transform: translateY(-1px);
    border-color: rgba(255, 223, 143, 0.55);
    background: linear-gradient(180deg, rgba(44, 51, 70, 0.98), rgba(28, 34, 48, 0.98));
}

.players-filter-button span {
    width: 15px;
    height: 2px;
    border-radius: 999px;
    background: #ffdf8f;
    display: block;
}

.players-filter-button svg {
    width: 18px;
    height: 18px;
    fill: #ffdf8f;
    display: block;
}

.players-search-panel,
.players-filter-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(235px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 223, 143, 0.18);
    background: linear-gradient(180deg, rgba(21, 26, 38, 0.98), rgba(13, 17, 26, 0.98));
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
    z-index: 80;
}

.players-add-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
}

.players-add-form > .players-add-field:first-child,
.players-add-form-message,
.players-add-submit {
    grid-column: 1 / -1;
}

.players-add-panel {
    box-sizing: border-box;
    position: absolute;
    top: calc(100% + 12px);
    right: 48px;
    width: min(350px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 223, 143, 0.18);
    background: linear-gradient(180deg, rgba(21, 26, 38, 0.98), rgba(13, 17, 26, 0.98));
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
    z-index: 81;
}

.players-add-panel[hidden] {
    display: none !important;
}

.players-add-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.players-add-panel-title {
    color: #ffdf8f;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: normal;
}

.players-add-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
    color: #b8c1cc;
    font-size: 14px;
    font-weight: 400;
}

.players-add-field input {
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(184, 193, 204, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #f7f8fc;
    padding: 0 12px;
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.players-add-field input:focus {
    border-color: rgba(255, 223, 143, 0.48);
    box-shadow: 0 0 0 3px rgba(255, 223, 143, 0.12);
}

.players-add-form-message {
    margin: 0;
}

.players-add-submit {
    width: 100%;
    min-height: 40px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #ffdf8f, #e3b23c);
    color: #1a1405;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.players-search-panel[hidden],
.players-filter-panel[hidden] {
    display: none !important;
}

.players-filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.players-filter-panel-title {
    color: #ffdf8f;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.players-filter-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff9e7;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.players-search-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.players-search-label {
    color: #d7deee;
    font-size: 0.88em;
    font-weight: 600;
}

.players-search-input {
    width: 100%;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(255, 223, 143, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: #f7f8fc;
    padding: 0 12px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.players-search-input:focus {
    border-color: rgba(255, 223, 143, 0.48);
    box-shadow: 0 0 0 3px rgba(255, 223, 143, 0.12);
}

.players-search-input::placeholder {
    color: #97a4bc;
}

.players-filter {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.players-filter-menu {
    width: 100%;
}

.filter-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(255, 223, 143, 0.2);
    transition: all 0.3s ease;
}

.filter-switch:hover {
    background: rgba(30, 35, 50, 0.8);
    border-color: rgba(255, 223, 143, 0.4);
}

.filter-switch input[type="checkbox"] {
    display: none;
}

.switch-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.switch-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #666;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
}

.filter-switch input:checked + .switch-slider {
    background: rgba(255, 223, 143, 0.3);
}
.filter-switch input:checked + .switch-slider:before {
    transform: translateX(26px);
    background: #ffdf8f;
}

.filter-label {
    color: #fff9e7;
    font-weight: 500;
    font-size: 0.95em;
    white-space: nowrap;
    display: inline-block;
}

#players-table th.sort-asc::after,
#players-table th.sort-desc::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

#players-table th.sort-asc::after {
    border-bottom: 8px solid #ffdf8f;
    border-top: none;
}

#players-table th.sort-desc::after {
    border-top: 8px solid #ffdf8f;
    border-bottom: none;
}

#players-table tr {
    cursor: pointer;
    transition: all 0.3s ease;
}

@keyframes pulse-win {
    0% { text-shadow: 0 0 4px rgba(40, 167, 69, 0.3); }
    50% { text-shadow: 0 0 8px rgba(40, 167, 69, 0.6); }
    100% { text-shadow: 0 0 4px rgba(40, 167, 69, 0.3); }
}

@keyframes pulse-lose {
    0% { text-shadow: 0 0 4px rgba(220, 53, 69, 0.3); }
    50% { text-shadow: 0 0 8px rgba(220, 53, 69, 0.6); }
    100% { text-shadow: 0 0 4px rgba(220, 53, 69, 0.3); }
}

#players-table td.wins-high { animation: pulse-win 2.2s 2; }
#players-table td.losses-high { animation: pulse-lose 2.2s 2; }

@media (max-width: 768px) {
    #players-table {
        table-layout: auto;
        min-width: 750px;
    }

    #players-table th:nth-child(2),
    #players-table td:nth-child(2) {
        min-width: 160px;
        width: auto;
    }

    #players-table th:nth-child(1),
    #players-table td:nth-child(1) {
        width: 50px;
        min-width: 50px;
        padding: 10px 6px 10px 12px !important;
        text-align: left;
    }

    #players-table th:nth-child(3),
    #players-table td:nth-child(3) {
        width: 90px;
        min-width: 90px;
    }

    #players-table th[data-column="gamesPlayed"],
    #players-table td.player-cell-games {
        width: 70px;
        min-width: 70px;
    }

    #players-table th[data-column="wins"],
    #players-table td.player-cell-wins {
        width: 110px;
        min-width: 110px;
    }

    #players-table th[data-column="losses"],
    #players-table td.player-cell-losses {
        width: 110px;
        min-width: 110px;
    }

    #players-table th[data-column="winrate"],
    #players-table td.winrate-cell {
        width: 110px;
        min-width: 110px;
    }

    #players-table th[data-column="streak"],
    #players-table tbody tr td:last-child {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
    }

    #players-table th,
    #players-table td {
        height: 43px;
        padding: 10px 6px !important;
        font-size: 13px;
    }

    #players-table tr {
        height: 43px;
    }

    .winrate-cell {
        width: 110px;
        padding: 10px 4px !important;
    }

    .winrate-container {
        height: 20px;
        padding-right: 20px;
    }

    .winrate-text {
        font-size: 0.72em;
    }

    .winrate-notch {
        right: 7px;
        width: 7px;
        height: 7px;
    }

    #players-table td:nth-child(2) .player-nickname {
        font-size: 13px !important;
    }

    #players-table th:nth-child(1) {
        padding-left: 12px !important;
        text-align: left;
    }

    #players-table td:nth-child(1) {
        padding-left: 12px !important;
        text-align: left;
    }

    #players-table th {
        padding-right: 18px !important;
    }

    #players-table th.sort-asc::after,
    #players-table th.sort-desc::after {
        right: 4px;
        border-left: 3px solid transparent;
        border-right: 3px solid transparent;
    }

    #players-table th.sort-asc::after {
        border-bottom: 5px solid #ffdf8f;
    }

    #players-table th.sort-desc::after {
        border-top: 5px solid #ffdf8f;
    }

    .table-container {
        overflow-x: auto;
        padding: 12px;
    }

    .players-header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }

    .players-header h2 {
        text-align: center;
        order: 1;
    }

    .players-filter {
        position: static;
        order: 2;
        justify-content: center;
        width: 100%;
    }

    .filter-switch {
        width: auto;
        justify-content: center;
    }
}

/* Reference rating page layout and panels. */
#rating-page {
    width: 100%;
}

.rating-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    grid-template-areas:
        "main sidebar"
        "matches matches";
    gap: 14px;
    align-items: start;
}

.rating-main {
    grid-area: main;
    min-width: 0;
}

.rating-sidebar {
    grid-area: sidebar;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rating-sidebar > .support-banner {
    position: relative;
    margin: 0;
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    border: 1px solid rgba(218, 166, 72, 0.24);
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(242, 200, 102, 0.12), transparent 48%),
        linear-gradient(180deg, rgba(16, 29, 42, 0.96), rgba(7, 16, 25, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 18px 46px rgba(0, 0, 0, 0.28);
    overflow: hidden;
}

.rating-sidebar > .support-banner .support-banner-copy {
    gap: 5px;
    padding-right: 30px;
}

.rating-sidebar > .support-banner .support-banner-kicker {
    color: #f2c866;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 14px;
    line-height: 18px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rating-sidebar > .support-banner .support-banner-text {
    font-size: 12px;
    line-height: 1.45;
    color: rgba(243, 234, 215, 0.68);
}

.rating-sidebar > .support-banner .support-banner-actions {
    width: 100%;
    gap: 10px;
}

.rating-sidebar > .support-banner .support-banner-link {
    flex: 1;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 12px;
}

.rating-sidebar > .support-banner .support-banner-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    font-size: 19px;
}

.recent-matches-panel {
    grid-area: matches;
}

#rating-page .rating-players-list,
.rating-widget,
.recent-matches-panel {
    border: 1px solid rgba(218, 166, 72, 0.18) !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, rgba(10, 20, 31, 0.92), rgba(6, 14, 22, 0.9)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        0 18px 46px rgba(0, 0, 0, 0.28) !important;
    overflow: hidden !important;
}

.top-week-card,
.popular-civs-card {
    background: linear-gradient(180deg, rgba(10, 20, 31, 0.90), rgba(6, 14, 22, 0.86)) !important;
}

.recent-matches-panel {
    background: linear-gradient(180deg, rgba(10, 20, 31, 0.88), rgba(6, 14, 22, 0.84)) !important;
}

#rating-page .rating-players-list {
    padding: 0 !important;
}

#rating-page .rating-players-list::before {
    display: none !important;
    content: none !important;
}

.players-header {
    position: relative !important;
    min-height: 64px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-bottom: 1px solid rgba(218, 166, 72, 0.16);
    background: linear-gradient(180deg, rgba(13, 27, 40, 0.76), rgba(7, 16, 25, 0.52));
}

.players-header-title {
    position: relative;
    width: 100%;
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-width: 0;
}

.players-header-title h2,
.players-header h2 {
    margin: 0 !important;
    color: #f0cf7a !important;
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-size: 34px !important;
    line-height: 38px !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 0 #000 !important;
    white-space: nowrap;
}

.season-button {
    height: 38px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 9px;
    border: 1px solid rgba(218, 166, 72, 0.36);
    background: linear-gradient(180deg, rgba(19, 30, 40, 0.92), rgba(8, 15, 23, 0.88));
    color: #f6cf6d;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 12px;
    line-height: 14px;
    font-weight: 900;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

.players-header-actions {
    position: static !important;
    margin-left: auto !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.players-search-button,
.players-filter-button,
.players-add-button {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    border: 1px solid rgba(218, 166, 72, 0.34) !important;
    background: linear-gradient(180deg, rgba(12, 23, 34, 0.9), rgba(7, 13, 20, 0.86)) !important;
    color: #f1c75c !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 8px 22px rgba(0, 0, 0, 0.22) !important;
    cursor: pointer;
}

.players-search-button svg,
.players-filter-button svg {
    width: 20px !important;
    height: 20px !important;
    fill: currentColor !important;
}

.players-search-button:hover,
.players-filter-button:hover,
.players-add-button:hover {
    border-color: rgba(241, 199, 92, 0.72) !important;
    background: linear-gradient(180deg, rgba(24, 36, 48, 0.96), rgba(10, 18, 27, 0.94)) !important;
}

.players-add-button {
    font-size: 28px !important;
    line-height: 1 !important;
    font-weight: 500 !important;
}

#rating-page .rating-players-list > .table-container {
    margin-top: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#players-table th:nth-child(1),
#players-table td:nth-child(1) {
    width: 72px !important;
}

#players-table th:nth-child(2),
#players-table td:nth-child(2) {
    width: 250px !important;
}

#players-table th:nth-child(3),
#players-table td:nth-child(3) {
    width: 120px !important;
}

#players-table th:nth-child(4),
#players-table td.player-cell-games {
    width: 78px !important;
}

#players-table th[data-column="winLoss"],
#players-table td.player-cell-winloss {
    width: 120px !important;
}

#players-table th:nth-child(6),
#players-table td.winrate-cell {
    width: 145px !important;
    min-width: 145px !important;
    max-width: 145px !important;
}

#players-table th:nth-child(7),
#players-table tbody tr td:last-child {
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
}

.players-show-more {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(218, 166, 72, 0.13);
}

.show-more-button {
    border: 0;
    background: transparent;
    color: #f2c866;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.rating-widget {
    min-height: 0;
}

.rating-widget-header {
    height: 43px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: none;
}

.rating-widget-header h3 {
    margin: 0;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 14px;
    line-height: 18px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f2c866;
}

.top-week-heading {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.top-week-subtitle {
    color: rgba(243, 234, 215, 0.48) !important;
    font-size: 9px !important;
    line-height: 11px;
    letter-spacing: 0.035em;
    white-space: nowrap;
}

#top-week-updated {
    flex: 0 0 auto;
    font-size: 10px;
    white-space: nowrap;
}

.popular-civs-card .rating-widget-header h3 {
    font-size: 13px;
}

.rating-widget-header span,
.rating-widget-header button {
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 12px;
    color: rgba(243, 234, 215, 0.62);
}

#popular-civs-meta {
    flex: 0 0 auto;
    white-space: nowrap;
}

.rating-widget-header button {
    border: none;
    background: transparent;
    cursor: pointer;
}

.rating-widget-header button:hover {
    color: #f2c866;
}

.rating-widget-header .all-matches-btn {
    height: 29px;
    min-height: 29px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(218, 166, 72, 0.34);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(14, 25, 36, 0.92), rgba(8, 16, 24, 0.90));
    color: #e9bd5c;
    font-family: "Manrope", system-ui, sans-serif;
    font-size: 10px;
    line-height: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 8px 20px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.rating-widget-header .all-matches-btn:hover {
    color: #f5d276;
    border-color: rgba(242, 200, 102, 0.58);
    background: linear-gradient(180deg, rgba(20, 34, 48, 0.96), rgba(10, 18, 27, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 10px 24px rgba(0, 0, 0, 0.28);
}

.rating-widget-header .all-matches-btn:active {
    transform: translateY(1px);
}

.rating-widget-header .all-matches-btn:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 3px rgba(217, 164, 65, 0.16),
        0 10px 24px rgba(0, 0, 0, 0.28);
}

.top-week-list,
.popular-civs-list {
    display: flex;
    flex-direction: column;
}

.top-week-row {
    height: 50px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 38px 32px minmax(0, 1fr) 48px 56px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.top-week-row:last-child,
.popular-civ-row:last-child {
    border-bottom: none;
}

.top-week-rank {
    font-family: "Cinzel", serif;
    font-size: 22px;
    font-weight: 700;
    color: #f2c866;
}

.top-week-avatar,
.recent-match-avatar {
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.top-week-avatar {
    width: 30px;
    height: 30px;
}

.top-week-name,
.recent-match-name,
.popular-civ-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-week-name {
    font-size: 13px;
    font-weight: 700;
    color: #f3ead7;
}

.top-week-player {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.top-week-record {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    line-height: 11px;
    white-space: nowrap;
}

.top-week-record-wins {
    color: rgba(74, 222, 128, 0.88);
}

.top-week-record-losses {
    color: rgba(255, 101, 93, 0.82);
}

.top-week-record-separator,
.top-week-record-dot,
.top-week-record-winrate {
    color: rgba(243, 234, 215, 0.48);
}

.top-week-wins {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 700;
    color: rgb(74, 222, 128);
    text-align: right;
}

.top-week-rating {
    font-family: "JetBrains Mono", monospace;
    font-size: 17px;
    font-weight: 700;
    color: #f2c866;
    text-align: right;
}

.popular-civs-list {
    min-height: 104px;
    padding: 6px 8px 8px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
}

.popular-civs-pagination {
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.popular-civs-pagination[hidden] {
    display: none;
}

.popular-civs-pagination button {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(242, 200, 102, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(242, 200, 102, 0.82);
    font: 700 18px/18px "Manrope", system-ui, sans-serif;
    cursor: pointer;
    transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.popular-civs-pagination button:hover:not(:disabled) {
    color: #f2c866;
    border-color: rgba(242, 200, 102, 0.42);
    background: rgba(242, 200, 102, 0.07);
}

.popular-civs-pagination button:focus-visible {
    outline: 1px solid rgba(242, 200, 102, 0.7);
    outline-offset: 2px;
}

.popular-civs-pagination button:disabled {
    opacity: 0.28;
    cursor: default;
}

.popular-civs-pagination span {
    min-width: 32px;
    color: rgba(243, 234, 215, 0.56);
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    text-align: center;
}

#rating-page .top-week-pagination .top-week-more-button {
    display: inline-flex;
    width: 22px;
    height: 22px;
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(242, 200, 102, 0.18);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(242, 200, 102, 0.82);
    font: 700 18px/18px "Manrope", system-ui, sans-serif;
    text-shadow: none;
    transition: color 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

#rating-page .top-week-pagination .top-week-more-button:hover:not(:disabled) {
    color: #f2c866;
    border-color: rgba(242, 200, 102, 0.42);
    background: rgba(242, 200, 102, 0.07);
    text-shadow: none;
}

#rating-page .top-week-pagination .top-week-more-button:focus-visible {
    outline: 1px solid rgba(242, 200, 102, 0.7);
    outline-offset: 2px;
    text-shadow: none;
}

#rating-page .top-week-pagination .top-week-more-button:disabled {
    opacity: 0.28;
    cursor: default;
    color: rgba(242, 200, 102, 0.82);
    border-color: rgba(242, 200, 102, 0.18);
    background: rgba(255, 255, 255, 0.025);
    text-shadow: none;
}

.popular-civ-row {
    position: relative;
    min-width: 0;
    height: 90px;
    padding: 4px 5px 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.055);
    border-bottom: 0;
    border-radius: 7px;
    cursor: help;
    transition: background-color 140ms ease, transform 140ms ease;
}

.popular-civ-row:last-child {
    border-right: 0;
}

.popular-civ-row:hover,
.popular-civ-row:focus-visible {
    z-index: 1;
    background: rgba(242, 200, 102, 0.055);
    transform: translateY(-1px);
}

.popular-civ-row:focus-visible {
    outline: 1px solid rgba(242, 200, 102, 0.58);
    outline-offset: -1px;
}

.popular-civ-name {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    font-size: 10px;
    line-height: 13px;
    font-weight: 700;
    color: rgba(243, 234, 215, 0.88);
}

.popular-civ-name span {
    display: block;
    width: 100%;
    text-align: center;
}

.popular-civs-card .popular-civ-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.38));
}

.popular-civ-winrate {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    line-height: 14px;
    font-weight: 700;
    text-align: center;
}

.popular-civ-games {
    color: rgba(243, 234, 215, 0.58);
    font-family: "JetBrains Mono", monospace;
    font-size: 9px;
    line-height: 11px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.civ-winrate--high {
    color: rgb(74, 222, 128);
}

.civ-winrate--mid {
    color: rgb(242, 200, 102);
}

.civ-winrate--low {
    color: rgb(245, 158, 11);
}

.popular-civ-pickrate {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: rgba(243, 234, 215, 0.68);
    text-align: right;
}

.recent-matches-panel {
    padding: 0;
}

.recent-matches-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 6px 12px 12px;
}

.recent-matches-panel .recent-match-card {
    position: relative;
    min-height: 116px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    background: linear-gradient(180deg, rgba(13, 27, 40, 0.80), rgba(7, 16, 25, 0.74));
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 7px;
    overflow: hidden;
}

.recent-matches-panel .recent-match-card:hover {
    border-color: rgba(218, 166, 72, 0.26);
    background: linear-gradient(180deg, rgba(18, 34, 48, 0.84), rgba(9, 20, 31, 0.78));
}

.recent-match-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: rgba(243, 234, 215, 0.58);
}

.recent-match-context {
    overflow: hidden;
    color: rgba(242, 200, 102, 0.86);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-match-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.recent-match-player {
    position: relative;
    min-width: 0;
    min-height: 42px;
    padding: 6px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 8px;
    transition: opacity 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.recent-match-player[data-tooltip] {
    overflow: visible;
}

.recent-match-player[data-tooltip]::before,
.recent-match-player[data-tooltip]::after {
    position: absolute;
    left: 50%;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 6px);
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 40;
}

.recent-match-player[data-tooltip]::before {
    content: '';
    bottom: calc(100% + 4px);
    width: 8px;
    height: 8px;
    border-top: 1px solid rgba(255, 223, 143, 0.24);
    border-left: 1px solid rgba(255, 223, 143, 0.24);
    background: rgba(18, 22, 32, 0.98);
    transform: translate(-50%, 6px) rotate(225deg);
}

.recent-match-player[data-tooltip]::after {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    width: min(240px, calc(200% + 24px));
    max-width: 240px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 223, 143, 0.24);
    border-radius: 8px;
    background: rgba(18, 22, 32, 0.98);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
    color: #ffdf8f;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.recent-match-player--team-1[data-tooltip]::after {
    left: 0;
    transform: translate(0, 6px);
}

.recent-match-player--team-2[data-tooltip]::after {
    right: 0;
    left: auto;
    transform: translate(0, 6px);
}

.recent-match-player[data-tooltip]:hover::before,
.recent-match-player[data-tooltip]:hover::after,
.recent-match-player[data-tooltip]:focus-visible::before,
.recent-match-player[data-tooltip]:focus-visible::after {
    opacity: 1;
}

.recent-match-player[data-tooltip]:hover::before,
.recent-match-player[data-tooltip]:focus-visible::before {
    transform: translate(-50%, 0) rotate(225deg);
}

.recent-match-player[data-tooltip]:hover::after,
.recent-match-player[data-tooltip]:focus-visible::after {
    transform: translate(-50%, 0);
}

.recent-match-player--team-1[data-tooltip]:hover::after,
.recent-match-player--team-1[data-tooltip]:focus-visible::after,
.recent-match-player--team-2[data-tooltip]:hover::after,
.recent-match-player--team-2[data-tooltip]:focus-visible::after {
    transform: translate(0, 0);
}

.recent-match-player[data-tooltip]:focus-visible {
    outline: 1px solid rgba(242, 200, 102, 0.7);
    outline-offset: 2px;
}

.recent-match-player.is-loser {
    opacity: 0.58;
}

.recent-match-player.is-winner {
    border-color: rgba(242, 200, 102, 0.32);
    background:
        linear-gradient(90deg, rgba(242, 200, 102, 0.15), rgba(242, 200, 102, 0.035));
    box-shadow:
        inset 3px 0 0 rgba(242, 200, 102, 0.72),
        inset 0 1px 0 rgba(255, 235, 176, 0.06),
        0 0 18px rgba(242, 200, 102, 0.06);
}

.recent-match-player.is-winner .recent-match-avatar {
    border-color: rgba(242, 200, 102, 0.82);
    box-shadow: 0 0 10px rgba(242, 200, 102, 0.22);
}

.recent-match-avatar {
    --recent-match-avatar-size: 30px;
    --recent-match-avatar-overlap: -9px;
    width: var(--recent-match-avatar-size);
    height: var(--recent-match-avatar-size);
    flex: 0 0 var(--recent-match-avatar-size);
    margin-left: var(--recent-match-avatar-overlap);
    object-fit: cover;
    border: 2px solid #142332;
    border-radius: 999px;
    box-sizing: border-box;
    z-index: calc(4 - var(--avatar-order));
}

.recent-match-avatar:first-child {
    margin-left: 0;
}

.recent-match-avatar-stack {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    isolation: isolate;
}

.recent-match-vs {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(243, 234, 215, 0.1);
    border-radius: 999px;
    background: rgba(3, 9, 15, 0.42);
    color: rgba(243, 234, 215, 0.45);
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}

.recent-match-winner-mark {
    position: absolute;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-left: auto;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 225, 137, 0.72);
    border-radius: 999px;
    background: linear-gradient(180deg, #f6d678, #c89531);
    color: #15202a;
    font-size: 11px;
    line-height: 1;
    font-weight: 1000;
    box-shadow: 0 0 10px rgba(242, 200, 102, 0.2);
}

.recent-matches-list > .rating-empty-state {
    grid-column: 1 / -1;
}

.recent-matches-empty {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: center;
}

.recent-matches-empty strong {
    color: #f3ead7;
}

.rating-empty-state {
    padding: 18px 16px;
    color: rgba(243, 234, 215, 0.62);
    font-size: 13px;
}

@media (max-width: 1180px) {
    .rating-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "sidebar"
            "matches";
    }

    .rating-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rating-sidebar > .support-banner {
        grid-column: 1 / -1;
    }

    .recent-matches-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .rating-layout {
        gap: 12px;
    }

    .rating-sidebar {
        grid-template-columns: 1fr;
    }

    .players-header {
        min-height: auto !important;
        padding: 12px !important;
        align-items: flex-start !important;
    }

    .players-header-title {
        flex-wrap: wrap;
        min-height: auto !important;
    }

    .players-header-title h2,
    .players-header h2 {
        font-size: 28px !important;
        line-height: 32px !important;
    }

    .season-button {
        height: 34px;
    }

    .players-header-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }

    .recent-matches-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .players-header {
        gap: 12px;
    }

    .players-header h2 {
        font-size: 1.4em;
    }

    .filter-switch {
        padding: 6px 12px;
    }

    .filter-label {
        font-size: 0.9em;
    }

    .switch-slider {
        width: 45px;
        height: 22px;
    }

    .switch-slider:before {
        width: 18px;
        height: 18px;
    }

    .table-container {
        margin-top: 8px;
        padding: 10px;
    }

    #players-table {
        min-width: 700px;
    }

    #players-table th:nth-child(1),
    #players-table td:nth-child(1) {
        width: 45px;
        min-width: 45px;
        padding: 8px 4px 8px 8px !important;
    }

    #players-table th:nth-child(2),
    #players-table td:nth-child(2) {
        min-width: 140px;
    }

    #players-table th[data-column="winrate"],
    #players-table td.winrate-cell {
        width: 100px;
        min-width: 100px;
    }

    #players-table th,
    #players-table td {
        font-size: 12px;
        padding: 8px 4px !important;
    }

    .winrate-cell {
        width: 100px;
        padding: 8px 3px !important;
    }

    .winrate-container {
        height: 18px;
        padding-right: 18px;
    }

    .winrate-text {
        font-size: 0.68em;
    }

    .winrate-notch {
        right: 6px;
        width: 6px;
        height: 6px;
    }

    #players-table td:nth-child(2) .player-nickname {
        font-size: 12px !important;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    #players-table th:nth-child(1),
    #players-table td:nth-child(1) {
        padding-left: 14px !important;
    }
}

.filter-switch input:checked + .switch-slider {
    box-shadow: 0 0 8px rgba(255, 223, 143, 0.4);
}

.filter-switch input:checked + .switch-slider:before {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#players-table tbody {
    transition: opacity 0.3s ease;
}

#players-table tbody.updating {
    opacity: 0.7;
}

#players-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    backdrop-filter: blur(12px);
}

#players-table th.is-sort-active {
    color: #fff2bf !important;
    background: linear-gradient(180deg, rgba(63, 73, 101, 0.98), rgba(37, 44, 62, 0.98));
    box-shadow: inset 0 -1px 0 rgba(255, 223, 143, 0.22);
}

#players-table th.is-sort-active::before {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 6px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255, 223, 143, 0.18), rgba(255, 223, 143, 0.98), rgba(230, 201, 125, 0.22));
}

#players-table th.sort-asc::after,
#players-table th.sort-desc::after {
    filter: drop-shadow(0 0 4px rgba(255, 223, 143, 0.45));
}

#players-table tr.top-1,
#players-table tr.top-2,
#players-table tr.top-3 {
    border-left-width: 3px;
    border-left-style: solid;
}

#players-table tr.top-1 {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.24), rgba(45, 37, 50, 0.98) 32%, rgba(24, 29, 41, 0.99) 100%) !important;
    border-left-color: #ff6b6b;
}

#players-table tr.top-2 {
    background: linear-gradient(90deg, rgba(255, 157, 107, 0.23), rgba(45, 39, 50, 0.98) 32%, rgba(24, 29, 41, 0.99) 100%) !important;
    border-left-color: #ff9d6b;
}

#players-table tr.top-3 {
    background: linear-gradient(90deg, rgba(255, 206, 107, 0.21), rgba(45, 42, 50, 0.98) 32%, rgba(24, 29, 41, 0.99) 100%) !important;
    border-left-color: #ffce6b;
}

#players-table tr.top-1:hover,
#players-table tr.top-2:hover,
#players-table tr.top-3:hover {
    transform: translateX(3px);
}

#players-table tr.top-1:hover {
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.31), rgba(51, 41, 55, 0.99) 34%, rgba(28, 33, 45, 1) 100%) !important;
}

#players-table tr.top-2:hover {
    background: linear-gradient(90deg, rgba(255, 157, 107, 0.29), rgba(51, 43, 55, 0.99) 34%, rgba(28, 33, 45, 1) 100%) !important;
}

#players-table tr.top-3:hover {
    background: linear-gradient(90deg, rgba(255, 206, 107, 0.27), rgba(51, 47, 55, 0.99) 34%, rgba(28, 33, 45, 1) 100%) !important;
}

#players-table td:nth-child(3) {
    background: linear-gradient(180deg, rgba(255, 223, 143, 0.05), rgba(255, 223, 143, 0.02));
}

#players-table td:nth-child(3) .player-rating-value {
    font-size: 1.08em;
    font-weight: 900;
    letter-spacing: 0.04em;
}

#players-table td.player-cell-games,
#players-table td.player-cell-wins,
#players-table td.player-cell-losses {
    color: #d2d9e8;
}

.players-table-empty,
.players-table-error {
    text-align: center;
    padding: 24px 16px !important;
    font-weight: 600;
}

.players-table-empty {
    color: #98a6bf !important;
}

.players-table-error {
    color: #ff8b8b !important;
}

@media (max-width: 768px) {
    .players-header-title {
        gap: 10px;
    }

    .players-header-actions {
        position: static;
        gap: 8px;
    }

    .players-add-button,
    .players-filter-button {
        width: 34px;
        height: 34px;
    }

    .players-search-panel,
    .players-filter-panel {
        width: min(221px, calc(100vw - 24px));
        top: calc(100% + 10px);
        padding: 14px;
        right: 0;
    }

    .players-add-panel {
        width: min(280px, calc(100vw - 24px));
        top: calc(100% + 10px);
        right: 42px;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .table-container {
        margin-top: 8px;
        padding: 10px;
    }

    #players-table {
        min-width: 700px;
    }

    #players-table th:nth-child(1),
    #players-table td:nth-child(1) {
        width: 45px;
        min-width: 45px;
        padding: 8px 4px 8px 8px !important;
    }

    #players-table th:nth-child(2),
    #players-table td:nth-child(2) {
        min-width: 140px;
    }

    #players-table th[data-column="winrate"],
    #players-table td.winrate-cell {
        width: 100px;
        min-width: 100px;
    }

    #players-table th,
    #players-table td {
        font-size: 12px;
        padding: 8px 4px !important;
    }

    .winrate-cell {
        width: 100px;
        padding: 8px 3px !important;
    }

    .winrate-container {
        height: 18px;
        padding-right: 18px;
    }

    .winrate-text {
        font-size: 0.68em;
    }

    .winrate-notch {
        right: 6px;
        width: 6px;
        height: 6px;
    }

    #players-table td:nth-child(2) .player-nickname {
        font-size: 12px !important;
    }
}

/* AoE rating landing table */
#rating-page .rating-players-list {
    position: relative;
    padding: 32px 24px 28px;
    border: 1px solid rgba(204, 151, 58, 0.58);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(15, 29, 44, 0.96), rgba(8, 18, 29, 0.98)),
        radial-gradient(circle at 18% 8%, rgba(255, 221, 128, 0.12), transparent 24%),
        rgba(8, 17, 28, 0.98);
    box-shadow:
        inset 0 1px 0 rgba(255, 223, 143, 0.12),
        inset 0 0 42px rgba(255, 220, 128, 0.035),
        0 24px 58px rgba(0, 0, 0, 0.36);
    overflow: visible;
}

#rating-page .rating-players-list::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent, rgba(255, 223, 143, 0.55), transparent) top / 100% 1px no-repeat,
        linear-gradient(180deg, rgba(255, 223, 143, 0.08), transparent 120px);
}

.players-header {
    justify-content: flex-start;
    margin: 0 0 22px;
    min-height: 64px;
}

.players-header-title {
    justify-content: flex-start;
    gap: 18px;
    min-height: 64px;
}

.players-header-title h2,
.players-header h2 {
    order: 1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    width: auto;
    min-width: 0;
    color: #f8dfaa;
    font-family: 'Cinzel', serif;
    font-size: 2.18rem;
    line-height: 1.05;
    letter-spacing: 0;
    text-align: left;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.58);
}

.players-header h2::before {
    content: '';
    width: 52px;
    height: 58px;
    flex: 0 0 52px;
    background:
        linear-gradient(180deg, rgba(255, 226, 145, 0.22), rgba(95, 60, 23, 0.1)),
        linear-gradient(180deg, rgba(16, 29, 40, 0.98), rgba(29, 36, 40, 0.98));
    border: 2px solid #d5a247;
    clip-path: polygon(50% 0, 91% 14%, 82% 72%, 50% 100%, 18% 72%, 9% 14%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 238, 182, 0.2),
        0 0 18px rgba(218, 166, 61, 0.22);
}

.players-header-actions {
    order: 2;
    position: static;
    margin-left: auto;
    gap: 14px;
}

.players-add-button,
.players-filter-button {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    border: 1px solid rgba(211, 155, 56, 0.86);
    background: linear-gradient(180deg, rgba(22, 37, 54, 0.97), rgba(8, 18, 30, 0.99));
    color: #ffd979;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 14px 24px rgba(0, 0, 0, 0.28);
}

.players-add-button {
    font-size: 40px;
    font-weight: 500;
    padding: 0;
}

.players-filter-button svg {
    width: 27px;
    height: 27px;
    fill: #ffd979;
}

.players-add-button:hover,
.players-add-button:focus-visible,
.players-add-button[aria-expanded="true"],
.players-filter-button:hover,
.players-filter-button:focus-visible,
.players-filter-button[aria-expanded="true"] {
    transform: translateY(-1px);
    border-color: #ffdc78;
    background: linear-gradient(180deg, rgba(34, 50, 70, 0.99), rgba(12, 24, 38, 0.99));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 0 20px rgba(255, 210, 91, 0.14),
        0 16px 26px rgba(0, 0, 0, 0.32);
}

.players-search-panel,
.players-filter-panel,
.players-add-panel {
    top: calc(100% + 10px);
    border-radius: 8px;
    border-color: rgba(211, 155, 56, 0.58);
    background: linear-gradient(180deg, rgba(18, 31, 45, 0.99), rgba(8, 17, 28, 0.99));
}

.table-container {
    margin-top: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 223, 143, 0.16);
    background: rgba(8, 16, 26, 0.76);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 18px 38px rgba(0, 0, 0, 0.22);
}

.table-container::before {
    display: none;
}

#players-table {
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

#players-table thead {
    background: linear-gradient(180deg, rgba(26, 43, 60, 0.98), rgba(10, 22, 34, 0.99));
}

#players-table th {
    height: 52px;
    border-bottom: 1px solid rgba(197, 139, 51, 0.34);
    color: #f5dfb0;
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

#players-table th.is-sort-active {
    color: #ffe38b !important;
    background: linear-gradient(180deg, rgba(255, 223, 143, 0.13), rgba(255, 223, 143, 0.03));
}

#players-table th.is-sort-active::before {
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffe072, transparent);
}

#players-table td {
    height: 56px;
    border-bottom: 1px solid rgba(255, 223, 143, 0.12);
    color: #e8edf5;
    font-size: 1.07rem;
}

#players-table tr,
#players-table tr:nth-child(even),
#players-table tr.active-player-4-9,
#players-table tr.active-player-4-9:nth-child(even) {
    background: linear-gradient(90deg, rgba(16, 30, 44, 0.95), rgba(9, 22, 35, 0.95)) !important;
}

#players-table tr:hover,
#players-table tr.active-player-4-9:hover,
#players-table tr.active-player-4-9:nth-child(even):hover {
    transform: none;
    background: linear-gradient(90deg, rgba(31, 44, 53, 0.96), rgba(11, 28, 43, 0.98)) !important;
}

#players-table tr.top-1 {
    background: linear-gradient(90deg, rgba(189, 129, 31, 0.34), rgba(33, 32, 26, 0.9) 22%, rgba(10, 22, 34, 0.96) 100%) !important;
    border-left-color: #f0bd4e;
}

#players-table tr.top-2 {
    background: linear-gradient(90deg, rgba(159, 184, 195, 0.28), rgba(32, 41, 46, 0.9) 22%, rgba(10, 22, 34, 0.96) 100%) !important;
    border-left-color: #c7d4dc;
}

#players-table tr.top-3 {
    background: linear-gradient(90deg, rgba(190, 103, 52, 0.28), rgba(39, 31, 26, 0.9) 22%, rgba(10, 22, 34, 0.96) 100%) !important;
    border-left-color: #d88449;
}

#players-table th:nth-child(1),
#players-table td:nth-child(1) {
    text-align: center;
    padding-left: 8px;
}

#players-table tr.top-1 td:first-child,
#players-table tr.top-2 td:first-child,
#players-table tr.top-3 td:first-child {
    position: relative;
    background: transparent !important;
    box-shadow: none !important;
    color: #fff3c3;
    font-size: 1.55rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    text-shadow:
        0 1px 0 rgba(0, 0, 0, 0.9),
        0 2px 8px rgba(0, 0, 0, 0.72);
}

#players-table tr.top-1 td:first-child {
    color: #ffe08a;
}

#players-table tr.top-2 td:first-child {
    color: #e8edf5;
}

#players-table tr.top-3 td:first-child {
    color: #e7a167;
}

#players-table tr.top-1 td:first-child::before,
#players-table tr.top-2 td:first-child::before,
#players-table tr.top-3 td:first-child::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 50px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    background-color: currentColor;
    opacity: 0.9;
    -webkit-mask: url('/static/image/laurel_branches.svg') center / contain no-repeat;
    mask: url('/static/image/laurel_branches.svg') center / contain no-repeat;
}

#players-table tr.top-1 td:first-child::before {
    background-color: #ffd24a;
    filter: drop-shadow(0 0 8px rgba(255, 210, 74, 0.28));
}

#players-table tr.top-2 td:first-child::before {
    background-color: #cfd8e3;
    filter: drop-shadow(0 0 8px rgba(207, 216, 227, 0.22));
}

#players-table tr.top-3 td:first-child::before {
    background-color: #c77943;
    filter: drop-shadow(0 0 8px rgba(199, 121, 67, 0.22));
}

#players-table td:nth-child(2) .player-nickname-wrap {
    gap: 12px;
}

#players-table td:nth-child(2) .player-avatar-frame {
    width: 32px;
    height: 32px;
}

#players-table td:nth-child(2) .player-nickname {
    color: #ffd45f !important;
    font-size: 1.05rem;
    font-weight: 800;
}

#players-table td:nth-child(3),
#players-table.show-hideout-rating td.player-cell-hideout {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 223, 143, 0.008));
}

#players-table td:nth-child(3) .player-rating-value,
#players-table td.player-cell-hideout .player-rating-value {
    color: #ffd760 !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.65rem;
    font-weight: 800;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.85),
        0 0 12px rgba(255, 211, 94, 0.22);
}

#players-table td.player-cell-games {
    color: #f0f2f6;
}

#players-table td.player-cell-wins {
    color: #67ef4b !important;
}

#players-table td.player-cell-losses {
    color: #ff4048 !important;
}

.winrate-container {
    height: 23px;
    border-radius: 5px;
    border-color: rgba(213, 166, 72, 0.38);
}

.winrate-fill {
    border-radius: 4px;
}

.winrate-text {
    color: #1c1606;
    font-size: 0.82rem;
    font-weight: 900;
    text-shadow: 0 1px 0 rgba(255, 246, 210, 0.34);
}

.winrate-low .winrate-text {
    color: #ffffff;
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.88),
        0 0 6px rgba(0, 0, 0, 0.32);
}

@media (max-width: 768px) {
    #rating-page .rating-players-list {
        padding: 20px 12px 16px;
        border-radius: 10px;
    }

    .players-header-title {
        align-items: flex-start;
        gap: 14px;
    }

    .players-header-title h2,
    .players-header h2 {
        font-size: 1.5rem;
        line-height: 1.15;
    }

    .players-header h2::before {
        width: 40px;
        height: 46px;
        flex-basis: 40px;
    }

    .players-header-actions {
        margin-left: 0;
    }

    .players-add-button,
    .players-filter-button {
        width: 44px;
        height: 44px;
    }

    .players-add-button {
        font-size: 31px;
    }

    #players-table {
        min-width: 760px;
    }
}

/* Reference pass: compact rating header/buttons/table proportions. */
#rating-page .rating-players-list {
    padding: 0 20px 24px;
    border-radius: 10px;
}

.players-header {
    min-height: 50px;
    margin-bottom: 12px;
}

.players-header-title {
    min-height: 50px;
    gap: 12px;
}

.players-header-title h2,
.players-header h2 {
    gap: 16px;
    color: #d9b56a;
    font-family: "Cinzel", "Cormorant Garamond", Georgia, serif;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: 0.01em;
    text-transform: none;
    text-shadow: 0 1px 0 #000, 0 0 12px rgba(218, 170, 78, 0.18);
}

#players-table th,
#players-table td {
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
}

#players-table th,
#players-table th.is-sort-active,
#players-table th.player-header-wins,
#players-table th.player-header-losses,
#players-table th.player-header-winLoss {
    color: #f3e0c3 !important;
}

#players-table td {
    font-weight: 500;
}

#players-table td:nth-child(2) .player-nickname {
    color: #d8d6d3 !important;
    font-family: 'Inter', 'Roboto', Arial, sans-serif;
    font-weight: 600;
}

#players-table th[data-column="wins"],
#players-table th.player-header-wins,
#players-table td.player-cell-wins {
    color: #73be46 !important;
}

#players-table th[data-column="losses"],
#players-table th.player-header-losses,
#players-table td.player-cell-losses {
    color: #d53038 !important;
}

#players-table th[data-column="winLoss"],
#players-table th.player-header-winLoss {
    color: #f3e0c3 !important;
}

#players-table th[data-column="wins"],
#players-table th[data-column="losses"],
#players-table th[data-column="winLoss"],
#players-table th.player-header-wins,
#players-table th.player-header-losses,
#players-table th.player-header-winLoss {
    color: #f3e0c3 !important;
}

#players-table td.player-cell-winloss {
    color: #d8d6d3 !important;
    font-family: 'Inter', 'Roboto', sans-serif;
    font-weight: 500;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
    white-space: nowrap;
}

.player-winloss-wins {
    color: #73be46;
}

.player-winloss-losses {
    color: #d53038;
}

.player-winloss-separator {
    margin: 0 4px;
    color: rgba(216, 214, 211, 0.58);
}

#players-table td.player-cell-games,
#players-table td.player-cell-wins,
#players-table td.player-cell-losses,
#players-table td.player-cell-winloss,
#players-table td.player-cell-streak,
#players-table tbody tr td:last-child {
    font-family: 'Inter', 'Roboto', sans-serif;
    font-weight: 500;
}

#players-table th[data-column="winLoss"],
#players-table th.player-header-winLoss,
#players-table td.player-cell-winloss {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
}

.players-header h2::before {
    width: 46px;
    height: 52px;
    flex-basis: 46px;
}

.players-header h2::before,
.players-header-title h2::before {
    content: none !important;
    display: none !important;
}

.players-header-actions {
    gap: 8px;
    padding-top: 4px;
    padding-right: 6px;
}

.players-add-button,
.players-filter-button {
    width: 42px;
    height: 42px;
    border-radius: 8px;
}

.players-add-button {
    font-size: 28px;
    line-height: 1;
}

.players-filter-button svg {
    width: 21px;
    height: 21px;
}

.players-search-panel,
.players-filter-panel {
    right: 0;
}

.players-search-panel {
    gap: 8px;
    padding: 12px;
}

.players-add-panel {
    right: 56px;
}

#players-table th {
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.94rem;
}

#players-table td {
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 1rem;
}

#players-table tbody tr {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
}

#players-table th,
#players-table td {
    box-sizing: border-box !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1 !important;
}

#players-table th:nth-child(1),
#players-table td:nth-child(1) {
    width: 64px;
}

#players-table td:nth-child(2) .player-nickname-wrap {
    gap: 11px;
}

#players-table td:nth-child(2) .player-avatar-frame {
    width: 34px;
    height: 34px;
}

#players-table td:nth-child(2) .player-avatar {
    width: 34px;
    height: 34px;
}

#players-table td:nth-child(2) .player-avatar-fallback {
    font-size: 0.78rem;
}

#players-table td:nth-child(2) .player-nickname {
    font-size: 0.95rem;
}

#players-table td:nth-child(3) .player-rating-value,
#players-table td.player-cell-hideout .player-rating-value {
    display: block;
    width: 100%;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.75),
        0 0 12px rgba(244, 200, 90, 0.18);
}

#players-table td:nth-child(3) .player-rating-value.rating-elite,
#players-table td.player-cell-hideout .player-rating-value.rating-elite,
#players-table td:nth-child(3) .player-rating-value.rating--high,
#players-table td.player-cell-hideout .player-rating-value.rating--high {
    color: #ffd24a !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-high,
#players-table td.player-cell-hideout .player-rating-value.rating-high,
#players-table td:nth-child(3) .player-rating-value.rating--mid,
#players-table td.player-cell-hideout .player-rating-value.rating--mid {
    color: #f6a623 !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-upper-mid,
#players-table td.player-cell-hideout .player-rating-value.rating-upper-mid,
#players-table td:nth-child(3) .player-rating-value.rating--low,
#players-table td.player-cell-hideout .player-rating-value.rating--low {
    color: #ff7a45 !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-mid,
#players-table td.player-cell-hideout .player-rating-value.rating-mid,
#players-table td:nth-child(3) .player-rating-value.rating-low-mid,
#players-table td.player-cell-hideout .player-rating-value.rating-low-mid,
#players-table td:nth-child(3) .player-rating-value.rating-base,
#players-table td.player-cell-hideout .player-rating-value.rating-base {
    color: #c4beb6 !important;
}

#players-table th[data-column="rating"],
#players-table th.player-header-rating,
#players-table td:nth-child(3) {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: center !important;
}

#players-table th[data-column="rating"].sort-asc::after,
#players-table th[data-column="rating"].sort-desc::after,
#players-table th.player-header-rating.sort-asc::after,
#players-table th.player-header-rating.sort-desc::after {
    right: 8px;
}

.winrate-container {
    height: 21px;
}

.winrate-text {
    font-size: 0.78rem;
}

/* Global redesign typography pass. */
.players-header-title h2,
.players-header h2 {
    font-family: var(--font-brand);
    font-size: 31px;
    line-height: 36px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

#players-table th,
#players-table td,
#players-table td:nth-child(2) .player-nickname,
#players-table td.player-cell-winloss,
#players-table td.player-cell-games,
#players-table td.player-cell-wins,
#players-table td.player-cell-losses,
#players-table td.player-cell-streak,
#players-table tbody tr td:last-child {
    font-family: var(--font-ui);
}

#players-table td:nth-child(3) .player-rating-value,
#players-table td.player-cell-hideout .player-rating-value,
.player-winloss-wins,
.player-winloss-losses,
.winrate-text {
    font-family: var(--font-number);
    font-variant-numeric: tabular-nums;
}

.widget-title,
.analytics-widget-title,
.stats-widget-title,
.rating-widget-title {
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 18px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    #rating-page .rating-players-list {
        padding: 14px 10px 14px;
    }

    .players-header-title h2,
    .players-header h2 {
        font-size: 1.34rem;
    }

    .players-add-button,
    .players-filter-button {
        width: 36px;
        height: 36px;
    }

    .players-add-button {
        font-size: 25px;
    }

    #players-table td:nth-child(2) .player-avatar-frame,
    #players-table td:nth-child(2) .player-avatar {
        width: 30px;
        height: 30px;
    }
}

/* Players table visual refresh. Scoped to the public leaderboard table only. */
#rating-page .rating-players-list > .table-container {
    overflow: hidden;
    margin-top: 16px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(218, 166, 72, 0.22);
    background:
        linear-gradient(180deg, rgba(8, 17, 27, 0.96), rgba(5, 12, 20, 0.94));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.045),
        0 18px 46px rgba(0, 0, 0, 0.34);
}

#rating-page .rating-players-list > .table-container::before {
    left: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(218, 166, 72, 0.32), transparent);
}

#players-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    border-radius: 0;
    background: transparent;
    color: #f3ead7;
}

#players-table thead {
    background: linear-gradient(180deg, rgba(15, 28, 40, 0.48), rgba(10, 22, 34, 0.40));
}

#players-table thead th {
    height: 44px;
    padding: 0 14px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.045);
    border-bottom: 1px solid rgba(218, 166, 72, 0.18);
    color: rgba(243, 234, 215, 0.78) !important;
    font-size: 12px;
    line-height: 14px;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: none;
    white-space: nowrap;
    background: transparent;
    box-shadow: none;
}

#players-table thead th:last-child {
    border-right: none;
}

#players-table th.player-header-wins,
#players-table th.player-header-losses,
#players-table th.player-header-winLoss {
    color: rgba(243, 234, 215, 0.78) !important;
}

#players-table th:hover,
#players-table th.is-sort-active {
    color: #f2c866 !important;
    background: rgba(217, 164, 65, 0.08);
}

#players-table th.is-sort-active::before {
    background: rgba(217, 164, 65, 0.72);
    box-shadow: none;
}

#players-table th.sort-asc::after {
    border-bottom-color: #d9a441;
}

#players-table th.sort-desc::after {
    border-top-color: #d9a441;
}

#players-table th:nth-child(1),
#players-table td:nth-child(1) {
    width: 86px;
    padding-left: 18px !important;
    text-align: center;
}

#players-table th:nth-child(2),
#players-table td:nth-child(2) {
    width: 285px;
    min-width: 0;
    padding-left: 14px !important;
    padding-right: 14px !important;
}

#players-table th:nth-child(3),
#players-table td:nth-child(3),
#players-table.show-hideout-rating th[data-column="rating2"],
#players-table.show-hideout-rating td.player-cell-hideout {
    width: 130px;
    text-align: center;
}

#players-table th[data-column="gamesPlayed"],
#players-table td.player-cell-games {
    width: 90px;
    text-align: center;
}

#players-table th[data-column="winLoss"],
#players-table td.player-cell-winloss,
#players-table.show-hideout-rating th[data-column="winLoss"],
#players-table.show-hideout-rating td.player-cell-winloss {
    width: 130px;
    text-align: center;
}

#players-table th[data-column="winrate"],
#players-table td.winrate-cell,
#players-table:not(.show-hideout-rating) th[data-column="winrate"],
#players-table:not(.show-hideout-rating) td.winrate-cell,
#players-table.show-hideout-rating th[data-column="winrate"],
#players-table.show-hideout-rating td.winrate-cell {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    text-align: center;
}

#players-table th[data-column="streak"],
#players-table tbody tr td:last-child,
#players-table:not(.show-hideout-rating) th[data-column="streak"],
#players-table:not(.show-hideout-rating) tbody tr td:last-child,
#players-table.show-hideout-rating th[data-column="streak"],
#players-table.show-hideout-rating tbody tr td:last-child {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: center;
}

#players-table tbody tr,
#players-table tbody tr:nth-child(even),
#players-table tbody tr.active-player-4-9,
#players-table tbody tr.active-player-4-9:nth-child(even) {
    position: relative;
    height: 50px;
    transform: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: rgba(7, 16, 25, 0.12) !important;
    transition: background 140ms ease, box-shadow 140ms ease;
}

#players-table tbody tr:nth-child(even),
#players-table tbody tr.active-player-4-9:nth-child(even) {
    background: rgba(10, 22, 34, 0.16) !important;
}

#players-table tbody tr:hover,
#players-table tbody tr.active-player-4-9:hover,
#players-table tbody tr.active-player-4-9:nth-child(even):hover {
    transform: none;
    background:
        linear-gradient(90deg, rgba(217, 164, 65, 0.08), rgba(255, 255, 255, 0.025) 42%, rgba(255, 255, 255, 0.015)) !important;
}

#players-table tbody tr.top-1 {
    background:
        linear-gradient(90deg, rgba(217, 164, 65, 0.13), rgba(10, 22, 34, 0.54) 36%, rgba(7, 16, 25, 0.42)) !important;
}

#players-table tbody tr.top-2 {
    background:
        linear-gradient(90deg, rgba(188, 198, 210, 0.105), rgba(10, 22, 34, 0.5) 36%, rgba(7, 16, 25, 0.42)) !important;
}

#players-table tbody tr.top-3 {
    background:
        linear-gradient(90deg, rgba(192, 107, 48, 0.12), rgba(10, 22, 34, 0.5) 36%, rgba(7, 16, 25, 0.42)) !important;
}

#players-table tbody tr.top-1:hover,
#players-table tbody tr.top-2:hover,
#players-table tbody tr.top-3:hover {
    transform: none;
}

#players-table tbody tr.top-1 td:first-child,
#players-table tbody tr.top-2 td:first-child,
#players-table tbody tr.top-3 td:first-child {
    position: relative;
}

#players-table tbody tr.top-1 td:first-child::after,
#players-table tbody tr.top-2 td:first-child::after,
#players-table tbody tr.top-3 td:first-child::after {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
}

#players-table tbody tr.top-1 td:first-child::after {
    background: #d9a441;
}

#players-table tbody tr.top-2 td:first-child::after {
    background: #b8c2cf;
}

#players-table tbody tr.top-3 td:first-child::after {
    background: #c06b30;
}

#players-table td {
    height: 50px;
    padding: 0 14px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: none;
    color: rgba(243, 234, 215, 0.88);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
    vertical-align: middle;
    background: transparent;
}

#players-table td:last-child {
    border-right: none;
}

#players-table td:nth-child(1) {
    color: rgba(243, 234, 215, 0.9);
    font-weight: 800;
}

#players-table tbody tr.top-1 td:first-child,
#players-table tbody tr.top-2 td:first-child,
#players-table tbody tr.top-3 td:first-child {
    font-family: var(--font-number);
    font-size: 18px;
    line-height: 22px;
    font-weight: 800;
}

#players-table tbody tr.top-1 td:first-child {
    color: #fff0ba;
}

#players-table tbody tr.top-2 td:first-child {
    color: #d7dde6;
}

#players-table tbody tr.top-3 td:first-child {
    color: #e3a36f;
}

#players-table tbody tr.active-player-4-9 td:first-child {
    position: relative;
}

#players-table tbody tr.active-player-4-9 td:first-child::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 19px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    background-color: #8292a5;
    opacity: 0.82;
    filter: drop-shadow(0 0 4px rgba(130, 146, 165, 0.2));
    -webkit-mask: url('/static/image/rank-side-wreaths.svg?v=20260923-1') center / contain no-repeat;
    mask: url('/static/image/rank-side-wreaths.svg?v=20260923-1') center / contain no-repeat;
}

#players-table td:nth-child(2) .player-nickname-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

#players-table td:nth-child(2) .player-avatar-frame {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}

#players-table td:nth-child(2) .player-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
}

#players-table tbody tr.top-1 .player-avatar-frame {
    border-color: rgba(217, 164, 65, 0.55);
}

#players-table tbody tr.top-2 .player-avatar-frame {
    border-color: rgba(184, 194, 207, 0.45);
}

#players-table tbody tr.top-3 .player-avatar-frame {
    border-color: rgba(192, 107, 48, 0.5);
}

#players-table td:nth-child(2) .player-nickname {
    max-width: 100%;
    overflow: hidden;
    color: #f3ead7 !important;
    font-size: 13px;
    line-height: 18px;
    font-weight: 800;
    text-overflow: ellipsis;
    text-shadow: none;
    white-space: nowrap;
}

#players-table tbody tr:hover .player-nickname {
    color: #f1c75c !important;
}

#players-table tbody tr.top-1 td:nth-child(2) .player-nickname {
    color: #f4d36f !important;
    text-shadow: none;
}

#players-table tbody tr.top-2 td:nth-child(2) .player-nickname,
#players-table tbody tr.top-3 td:nth-child(2) .player-nickname,
#players-table tbody tr.active-player-4-9 td:nth-child(2) .player-nickname {
    color: #f3ead7 !important;
    text-shadow: none;
}

#players-table tbody tr.top-1 td:nth-child(2) .player-nickname:hover,
#players-table tbody tr.top-2 td:nth-child(2) .player-nickname:hover,
#players-table tbody tr.top-3 td:nth-child(2) .player-nickname:hover,
#players-table tbody tr.active-player-4-9 td:nth-child(2) .player-nickname:hover {
    color: #ffe08a !important;
    text-shadow: 0 0 8px rgba(255, 224, 138, 0.42);
}

#players-table td:nth-child(3) .player-rating-value,
#players-table td.player-cell-hideout .player-rating-value {
    display: inline-block;
    font-size: 19px;
    line-height: 22px;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: none !important;
}

#players-table td:nth-child(3),
#players-table.show-hideout-rating td.player-cell-hideout {
    background: transparent !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-elite,
#players-table td.player-cell-hideout .player-rating-value.rating-elite {
    color: #ff655d !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-high,
#players-table td.player-cell-hideout .player-rating-value.rating-high {
    color: #ff927d !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-upper-mid,
#players-table td.player-cell-hideout .player-rating-value.rating-upper-mid {
    color: #f2a23a !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-mid,
#players-table td.player-cell-hideout .player-rating-value.rating-mid {
    color: #e7c86a !important;
}

#players-table td:nth-child(3) .player-rating-value.rating-low-mid,
#players-table td.player-cell-hideout .player-rating-value.rating-low-mid,
#players-table td:nth-child(3) .player-rating-value.rating-base,
#players-table td.player-cell-hideout .player-rating-value.rating-base {
    color: #cfd6df !important;
}

#players-table td.player-cell-games {
    color: rgba(243, 234, 215, 0.9);
    font-weight: 700;
}

#players-table td.player-cell-winloss {
    display: table-cell;
    color: rgba(243, 234, 215, 0.88);
    font-weight: 700;
    text-shadow: none;
}

.player-winloss-wins {
    color: #7bd66f;
}

.player-winloss-losses {
    color: #ff5e57;
}

.player-winloss-separator {
    margin: 0 7px;
    color: rgba(200, 192, 178, 0.45);
}

#players-table td.player-cell-streak,
#players-table tbody tr td:last-child {
    color: rgba(243, 234, 215, 0.72);
    font-weight: 800;
    text-shadow: none;
}

#players-table td.player-cell-streak.win-streak,
#players-table td.player-cell-streak.win-streak-2-3,
#players-table td.player-cell-streak.win-streak-4-6,
#players-table td.player-cell-streak.win-streak-7-plus {
    color: #7bd66f !important;
    text-shadow: none;
}

#players-table td.player-cell-streak.lose-streak,
#players-table td.player-cell-streak.lose-streak-2-3,
#players-table td.player-cell-streak.lose-streak-4-6,
#players-table td.player-cell-streak.lose-streak-7-plus {
    color: #ff655d !important;
    text-shadow: none;
}

.streak-with-icon {
    min-width: 30px;
    gap: 4px;
    font-weight: 800;
}

.streak-icon {
    width: 28px;
    height: 28px;
    filter: none;
}
.winrate-cell {
    width: 170px;
}

.winrate-container {
    position: relative;
    width: 130px;
    height: 16px;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.18)),
        rgba(20, 30, 41, 0.78);
    box-shadow: none;
    transform: none;
}

.winrate-container::before,
.winrate-notch {
    display: none;
}

.winrate-fill {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 3px;
    height: 100%;
    border-radius: 3px;
    box-shadow: none;
    transition: width 220ms ease;
}

.winrate-high .winrate-fill {
    background: linear-gradient(90deg, #b8792a, #e2b451 74%, #f2cf72);
}

.winrate-medium .winrate-fill {
    background: linear-gradient(90deg, #9c6b32, #d4a14b 74%, #e8bf69);
}

.winrate-low .winrate-fill {
    background: linear-gradient(90deg, #9d4939, #c76347 74%, #e08766);
}

.winrate-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8f0df;
    font-size: 10.5px;
    line-height: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    pointer-events: none;
}

.winrate-container:hover,
.winrate-high:hover,
.winrate-medium:hover,
.winrate-low:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.winrate-container:hover .winrate-fill {
    filter: none;
}

@media (max-width: 768px) {
    #rating-page .rating-players-list > .table-container {
        overflow-x: auto;
    }

    #players-table {
        min-width: 760px;
    }

    #players-table thead th,
    #players-table td {
        height: 46px;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    #players-table th:nth-child(1),
    #players-table td:nth-child(1) {
        width: 58px;
        min-width: 58px;
        padding-left: 10px !important;
    }

    #players-table th:nth-child(2),
    #players-table td:nth-child(2) {
        width: 210px;
    }

    #players-table th[data-column="winrate"],
    #players-table td.winrate-cell {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
    }

    .winrate-container {
        width: 112px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .rating-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .rating-widget,
    .recent-matches-panel {
        border-radius: 12px !important;
    }

    .rating-widget-header {
        height: 41px;
        padding: 0 12px;
        gap: 8px;
    }

    .rating-widget-header h3 {
        font-size: 13px;
        line-height: 16px;
    }

    .popular-civs-card .rating-widget-header h3 {
        font-size: 12px;
    }

    #popular-civs-meta {
        font-size: 10px;
    }

    .top-week-row {
        height: 48px;
        padding: 0 12px;
        grid-template-columns: 30px 28px minmax(0, 1fr) 44px 52px;
        gap: 8px;
    }

    .top-week-rank {
        font-size: 19px;
    }

    .top-week-heading h3 {
        font-size: 12px;
    }

    .top-week-subtitle {
        font-size: 8px !important;
    }

    #top-week-updated {
        font-size: 9px;
    }

    .top-week-avatar {
        width: 28px;
        height: 28px;
    }

    .popular-civ-row {
        height: 86px;
        padding: 3px;
        gap: 3px;
    }

    .popular-civs-card .popular-civ-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .popular-civ-name {
        font-size: 9px;
        line-height: 12px;
    }

    .recent-matches-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .recent-matches-panel .recent-match-card {
        min-height: 102px;
        padding: 12px;
    }

    .recent-match-body {
        grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
        gap: 7px;
    }

    .recent-match-vs {
        width: 22px;
        height: 22px;
    }

    .recent-match-name {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
