* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f4f6f8;
    color: #1f2937;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 30px 20px 50px;
}


/* HEADER */

header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 30px;
}

.logo {
    font-size: 55px;
}

h1 {
    margin: 0;
    font-size: 32px;
}

header p {
    margin: 5px 0 0;
    color: #6b7280;
}


/* CONTROLS */

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
}

.controls label {
    font-weight: 600;
}

select,
input {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: white;
    padding: 11px 14px;
    font-size: 15px;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.search input {
    width: 280px;
}


/* SUMMARY */

.summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.summary-card span {
    display: block;
    font-size: 25px;
}

.summary-card strong {
    display: block;
    font-size: 27px;
    margin-top: 5px;
}

.summary-card small {
    color: #6b7280;
}


/* PODIUM */

.podium {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 18px;
    margin: 35px 0;
}

.podium-card {
    background: white;
    border-radius: 18px;
    padding: 25px 30px;
    text-align: center;
    width: 30%;
    box-shadow: 0 3px 12px rgba(0,0,0,.08);
}

.podium-card.first {
    padding-top: 35px;
    padding-bottom: 35px;
}

.medal {
    font-size: 42px;
}

.podium-name {
    font-size: 20px;
    font-weight: 700;
    margin: 8px 0;
}

.podium-km {
    font-size: 25px;
    font-weight: 800;
}

.podium-rides {
    color: #6b7280;
    margin-top: 5px;
}


/* TABLE */

.ranking {
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    overflow: hidden;
}

.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
}

.ranking-header h2 {
    margin: 0;
}

#updated {
    color: #9ca3af;
    font-size: 13px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 13px 20px;
    background: #f9fafb;
    color: #6b7280;
    font-size: 13px;
}

td {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
}

td:first-child {
    font-weight: 700;
    color: #6b7280;
}

td:last-child {
    font-weight: 800;
    text-align: right;
}

th:last-child {
    text-align: right;
}

.participant-name {
    font-weight: 600;
}


/* LOADING */

.loading {
    text-align: center;
    width: 100%;
    padding: 40px;
    color: #6b7280;
}


/* FOOTER */

footer {
    text-align: center;
    margin-top: 30px;
    color: #9ca3af;
    font-size: 13px;
}


/* MOBILE */

@media (max-width: 700px) {

    .container {
        padding: 20px 12px 40px;
    }

    h1 {
        font-size: 25px;
    }

    .logo {
        font-size: 42px;
    }

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

    .search {
        margin-left: 0;
    }

    .search input {
        width: 100%;
    }

    .summary {
        gap: 8px;
    }

    .summary-card {
        padding: 14px 5px;
    }

    .summary-card strong {
        font-size: 20px;
    }

    .summary-card small {
        font-size: 11px;
    }

    .podium {
        gap: 6px;
    }

    .podium-card {
        width: 33%;
        padding: 18px 5px;
    }

    .podium-card.first {
        padding: 25px 5px;
    }

    .medal {
        font-size: 30px;
    }

    .podium-name {
        font-size: 14px;
        overflow-wrap: anywhere;
    }

    .podium-km {
        font-size: 19px;
    }

    th,
    td {
        padding: 12px 10px;
    }

    th:nth-child(4),
    td:nth-child(4) {
        display: none;
    }
}
