html {
    overflow-x: clip;
}

* {
    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;
}

body > h1 {
    margin-top: 40px;
    font-size: clamp(26px, 4vw, 36px);
    color: #fff;
}

#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;
    font-size: clamp(26px, 4vw, 36px);
}

/* nav bar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    position: relative;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);

    margin-top: -30px;
    margin-bottom: 0;
    padding: 12px 30px;

    background: #EFBF04;
    color: #222;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #222;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap;
}

.navbar-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.navbar-links a {
    color: #222;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
}

.navbar-links a:hover {
    text-decoration: underline;
}

/* nav bar for smaller screens */
@media (max-width: 650px) {
    .navbar {
        width: calc(100% + 16px);
        margin-left: -8px;
        flex-direction: column;
        gap: 12px;
        padding: 12px 8px;
    }

    .navbar-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px 20px;
    }

    .navbar-links a {
        font-size: 14px;
    }
}

/* info page */
.info-page {
    width: 100%;
    max-width: 1000px;
    margin: 35px auto 50px;
}

.info-header {
    text-align: center;
    margin-bottom: 28px;
}

.info-header h1 {
    margin: 0 0 10px;
    font-size: clamp(26px, 4vw, 36px);
    color: #fff;
}

.info-header p {
    margin: 0;
    color: #bbb;
    font-size: 15px;
    line-height: 1.6;
}

.info-section {
    margin-bottom: 18px;
    padding: 24px 28px;
    background: rgba(30, 30, 30, 0.94);
    border: 1px solid rgba(239, 191, 4, 1);
    border-radius: 10px;
}

.info-section h2 {
    margin: 0 0 18px;
    padding-bottom: 10px;
    color: #EFBF04;
    font-size: 23px;
    border-bottom: 1px solid rgba(239, 191, 4, 1);
}

.info-section h3 {
    margin: 24px 0 12px;
    color: #fff;
    font-size: 18px;
}

.info-section h3:first-of-type {
    margin-top: 0;
}

.info-section p {
    margin: 0 0 15px;
    color: #ddd;
    font-size: 15px;
    line-height: 1.8;
}

.info-section p:last-child {
    margin-bottom: 0;
}

.info-section strong {
    color: #fff;
}


.info-section a {
    color: #EFBF04;
    font-weight: bold;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.info-section a:hover {
    color: #ffdc55;
    text-decoration-thickness: 2px;
}

/* info page on smaller screens */
@media (max-width: 650px) {
    .info-page {
        margin-top: 25px;
    }

    .info-section {
        padding: 19px 16px;
    }

    .info-section h2 {
        font-size: 20px;
    }

    .info-section p {
        font-size: 14px;
        line-height: 1.75;
    }
}