.leaderboard-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    /* or rgba(0,0,0,0.5) for dark overlay */
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    padding: 0px 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.leaderboard-title {
    text-align: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.leaderboard-controls {
    display: flex;
    justify-content: space-between;
}

.leaderboard-button {
    margin-top: 20px;
    padding: 12px 25px;
    font-size: 14px;
    border: 1px solid #666;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
}

.leaderboard-page-button {
    margin-top: 20px;
    margin-right: 10px;
    margin-left: 10px;
    margin-bottom: 20px;
    padding: 12px 25px;
    font-size: 14px;
    border: 1px solid #666;
    border-radius: 4px;
    background: #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    width: 150px;
}

.leaderboard-button:hover:enabled {
    background: #ddd;
}

.leaderboard-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.leaderboard-close {
    position: sticky;
    top: 10px;
    right: 15px;
    font-size: 48px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #444;
    line-height: 1;
    z-index: 100;
    align-self: flex-end;
}

.leaderboard-close:hover {
    color: #ff3333;
}

.leaderboard-message {
    margin-top: 50px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.leaderboard-message.hiscore {
    color: green;
}

.leaderboard-message.oldscore {
    color: gray;
}

.leaderboard-row {
    display: flex;
    width: 400px;
    justify-content: space-between;
    padding: 4px 8px;
    font-family: monospace;
    /* ensures alignment */
    font-size: 16px;
    border-bottom: 1px solid #ddd;
}

.rank-name {
    flex: 1;
    text-align: left;
}

.score {
    text-align: right;
    min-width: 80px;
}