body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100vw;
}

.leaderboard-container {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: clamp(16px, 4vw, 32px) clamp(12px, 3vw, 24px);
    width: min(520px, 94vw);
    max-width: 520px;
    position: relative;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    word-break: break-word;
    margin: auto 0;
}

h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
    text-align: center;
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
}

.subtitle {
    font-size: clamp(0.72rem, 3vw, 0.8rem);
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: clamp(16px, 4vw, 24px);
    text-align: center;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.table-responsive {
    width: 100%;
    max-height: 55vh;
    max-height: 55dvh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid rgba(245, 166, 35, 0.12);
    background: rgba(0, 0, 0, 0.15);
}

.table-responsive::-webkit-scrollbar {
    width: 4px;
}
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(245, 166, 35, 0.3);
    border-radius: 4px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    text-align: left;
    table-layout: fixed;
}

th {
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: clamp(0.68rem, 2.5vw, 0.76rem);
    padding: 10px 8px;
    border-bottom: 1px solid rgba(245, 166, 35, 0.2);
    position: sticky;
    top: 0;
    background: rgba(30, 24, 18, 0.96);
    z-index: 2;
}

td {
    padding: 10px 8px;
    font-size: clamp(0.8rem, 3vw, 0.92rem);
    background-color: rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease;
    word-break: break-all;
    overflow-wrap: anywhere;
}

tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    padding-left: 10px;
}

tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    padding-right: 10px;
}

@media (hover: hover) {
    tr:hover td {
        background-color: rgba(245, 166, 35, 0.15);
        color: var(--text-main);
    }
}

.rank {
    width: 50px;
    text-align: center;
    color: var(--accent-color);
    font-weight: 800;
}

.score {
    width: 85px;
    text-align: right;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
}
