/*************************/
/* LEADERBOARD PODIUMS */

#leaderboard {
    text-align: center;
    margin-top: 20px;
}

.podium-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    gap: 20px;
    padding-top: 20px;
    padding-bottom: 10px;
}

.podiums {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* allow wrapping of podiums on narrower screens */
    flex-wrap: wrap;
    width: 100%;
    max-width: 800px;
    gap: 50px;
    margin-top: 120px;
}

.podium {
    width: 120px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium.first::before {
    height: 100px; 
}

.podium.second::before {
    height: 80px;
}

.podium.third::before {
    height: 60px;
}

.podium::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    background-color: #e8491d;
    z-index: 0; 
    border-radius: 10px 10px 0 0;
}

.podium-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    position: absolute;
    bottom: 40px;
    z-index: 1;
}

.podium.first .podium-image {
    bottom: 105px;
}

.podium.second .podium-image {
    bottom: 85px;
}

.podium.third .podium-image {
    bottom: 65px;
}

.podium-name,
.podium-stat {
    font-family: "Kanit", sans-serif;
    position: relative;
    text-align: center;
    z-index: 2;
}

.podium-name {
    font-size: 1em;
    font-weight: bold;
    color: #ffffff;
}

.podium-stat {
    font-size: 0.9em;
    color: #ffffff;
}

.error-message {
    color: red;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* On small screens, keep podiums in a row with wrapping and tighter spacing */
    .podiums {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
        /* reduce top margin to bring podiums closer to header */
        margin-top: 20px;
    }

    .podium {
        width: 100px;
    }

    .podium-image {
        width: 60px;
        height: 60px;
    }

    .podium.first::before {
        height: 100px;
    }

    .podium.second::before {
        height: 80px;
    }

    .podium.third::before {
        height: 60px;
    }

    .podium.first .podium-image {
        bottom: 105px;
    }

    .podium.second .podium-image {
        bottom: 85px;
    }

    .podium.third .podium-image {
        bottom: 65px;
    }
}

.ranking-note {
    font-size: 0.75em;
    color: grey;
    margin-left: 10px;
    font-weight: normal;
}

/* Mobile override: break ranking-note under title and allow wrap */
@media (max-width: 800px) {
  #leaderboard-title {
    flex-wrap: wrap;
  }
  #leaderboard-title .ranking-note {
    flex-basis: 100%;
    margin: 0.5em 0 0 0;
    margin-left: 0;
  }
}