* {
    box-sizing: border-box;
}

body {
    max-width: 1450px;
    margin: 30px auto;
    padding: 0 15px;
    background: url("gdBackground.png") center / cover fixed no-repeat;
    color: #eee;
    font-family: Arial, sans-serif;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

h1,
body > p {
    text-align: center;
}

h1 {
    margin-bottom: 8px;
}

body > p {
    color: #999;
    margin-top: 0;
}

#leaderboard {
    width: 100%;
    margin-top: 25px;
}

.player {
    display: grid;
    grid-template-columns: 78px 68px minmax(180px, 0.65fr) minmax(0, 2.8fr);
    align-items: center;
    gap: 14px;
    padding: 17px;
    margin-bottom: 10px;
    background: #242424;
    border: 1px solid #ffffff;
    border-radius: 8px;
}

.rank-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
}

.rank {
    font-size: 32px;
    font-weight: bold;
    line-height: 1.1;
    color: #f0f0f0;
}

.rank-points {
    color: #f5c451;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    overflow-wrap: anywhere;
}

.pfp {
    display: block;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
}

.player-info {
    min-width: 0;
}

.player-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 9px;
    width: 100%;
}

.username {
    font-size: 20px;
    font-weight: bold;
    overflow-wrap: anywhere;
}

.player-header .fi {
    flex-shrink: 0;
    font-size: 23px;
}

.hardest-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    min-width: 0;
    width: 100%;
}

.hardest {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
    min-height: 58px;
    padding: 9px 8px;
    background: var(--tier-background, #2b2b2b);
    border: 2px solid var(--tier-main, #3b3b3b);
    border-radius: 5px;
}

.hardest.unknown-tier {
    background: #2b2b2b;
    border-color: #3b3b3b;
}

.hardest-label {
    color: #b6b6b6;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

.hardest-name {
    width: 100%;
    color: #f0f0f0;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* smaller screens */
@media (max-width: 850px) {
    .player {
        grid-template-columns: 52px 46px minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
    }

    .rank {
        font-size: 22px;
    }

    .rank-points {
        font-size: 10px;
    }

    .pfp {
        width: 44px;
        height: 44px;
    }

    .username {
        font-size: 15px;
    }

    .player-header .fi {
        font-size: 17px;
    }

    .hardest-list {
        grid-column: 1 / -1;
        gap: 5px;
        padding-top: 4px;
    }

    .hardest {
        min-height: 46px;
        padding: 6px 5px;
    }

    .hardest-label {
        font-size: 9px;
    }

    .hardest-name {
        font-size: 11px;
    }
}

@media (max-width: 420px) {
    body {
        padding: 0 8px;
    }

    .player {
        gap: 7px;
        padding: 9px;
    }

    .hardest-list {
        gap: 4px;
    }

    .hardest {
        min-height: 44px;
        padding: 5px 4px;
    }

    .hardest-label {
        font-size: 8px;
    }

    .hardest-name {
        font-size: 10px;
    }
}

.title-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.title-header img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.title-header h1 {
    margin: 0;
}