:root {
    --main: #176DA6;
    --main-dark: #125681;
    --main-medium: #3986B7;
    --main-light: #8DBBD9;
    --main-pale: #D5E8F4;
    --background: #EDF5FA;

    --white: #FFFFFF;
    --text: #000000;
    --muted: #23445A;
    --border: #B5D2E5;
    font-family: Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--background);
    color: var(--text);
}

.container {
    max-width: 1250px;
    margin: 40px auto;
    padding: 0 25px;
}

.filters {
    background: var(--main-pale);
    border-color: var(--border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 160px;
}

.filter-group label {
    font-size: 13px;
    font-weight: bold;
}
.custom-select {
    position: relative;
    width: 190px;
}

.select-trigger {
    width: 100%;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: black;
    font-size: 14px;
}

.select-options {
    display: none;
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px #0002;
    z-index: 100;
    overflow: hidden;
}

.custom-select.open .select-options {
    display: block;
}

.nation-option {
    width: 100%;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: white;
    cursor: pointer;
    text-align: left;
    color: black;
}

.nation-option:hover {
    background: var(--main-pale);
}

.nation-option img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}

.dropdown-arrow {
    color: var(--main);
}

#nation-selected {
    display: flex;
    align-items: center;
    gap: 10px;
}

#nation-selected img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    vertical-align: middle;
}

select, input {
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 14px;
    color: black;
    background: white;
}

.search-group {
    flex: 1;
}

button {
    background: var(--main);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background: var(--main-dark);
}

.leaderboard-row {
    transition: filter 0.15s ease;
}

.leaderboard-row:hover {
    filter: brightness(1.12);
}

.leaderboard-row td {
    color: #000;
}

.leaderboard-section {
    background: var(--main-pale);
    border-color: var(--border);
}

.leaderboard-heading {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.leaderboard-heading h2 {
    font-size: 20px;
}

.player-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.player-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.rank-cell {
    text-align: center;
    vertical-align: middle;
}

.rank-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
}

.country-cell {
    vertical-align: middle;
}

.country-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.country-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

#run-count {
    color: var(--muted);
    font-size: 13px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

thead {
    background: var(--main-light);
}

th {
    padding: 15px;
    font-size: 13px;
    color: black;
}

td {
    padding: 15px;
    border-top: 1px solid #eeeeee;
    font-size: 14px;
}

tbody tr {
    background: var(--main-pale);
}

tbody tr:nth-child(even) {
    background: #C5DFEF;
}

tbody tr:hover {
    background: var(--main-light);
}

select, input {
    background: var(--background);
    border-color: var(--border);
    color: var(--text);
}

.loading {
    text-align: center;
    padding: 35px;
    color: var(--muted);
}

.video-link {
    color: var(--main);
    font-weight: bold;
    text-decoration: none;
}

.video-link:hover {
    text-decoration: underline;
}

@media (max-width: 650px) {
    .container {
        padding: 0 12px;
        margin-top: 25px;
    }

    .filters {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .search-group {
        flex: auto;
    }

    .navbar {
        padding: 15px;
    }

    .page-heading h1 {
        font-size: 26px;
    }
}
