/* Leaderboard styles */
#leaderboardContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: 'Courier New', monospace;
}

.leaderboard-panel {
    background-color: #121212;
    border: 2px solid #55AAFF;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #FFFFFF;
    box-shadow: 0 0 20px rgba(85, 170, 255, 0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-panel h2 {
    text-align: center;
    margin: 0 0 15px 0;
    color: #55AAFF;
    font-size: 24px;
    text-shadow: 0 0 5px rgba(85, 170, 255, 0.5);
}

.submit-score {
    background-color: rgba(85, 170, 255, 0.1);
    border: 1px solid #55AAFF;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.name-input {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

#playerNameInput {
    flex-grow: 1;
    padding: 8px;
    background-color: #1E1E1E;
    border: 1px solid #55AAFF;
    border-radius: 4px;
    color: #FFFFFF;
    font-family: 'Courier New', monospace;
}

#submitScoreBtn {
    padding: 8px 15px;
    background-color: #55AAFF;
    border: none;
    border-radius: 4px;
    color: #000000;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

#submitScoreBtn:hover {
    background-color: #77BBFF;
}

#submitScoreBtn:disabled {
    background-color: #555555;
    cursor: not-allowed;
}

.leaderboard-list {
    width: 100%;
    overflow-x: auto;
}

.leaderboard-list table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.leaderboard-list th, 
.leaderboard-list td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #333333;
}

.leaderboard-list th {
    background-color: #000000;
    color: #55AAFF;
    font-weight: bold;
}

.leaderboard-list tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.05);
}

.leaderboard-list tr:hover {
    background-color: rgba(85, 170, 255, 0.1);
}

.top-rank {
    background-color: rgba(255, 215, 0, 0.1) !important;
}

.top-rank:nth-child(1) {
    background-color: rgba(255, 215, 0, 0.2) !important;
}

.no-data {
    text-align: center;
    color: #888888;
    padding: 20px 0;
}

#closeLeaderboardBtn {
    align-self: center;
    padding: 10px 20px;
    background-color: #333333;
    border: 1px solid #55AAFF;
    border-radius: 4px;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 15px;
}

#closeLeaderboardBtn:hover {
    background-color: #444444;
}

.success-message {
    color: #55FF55;
    margin: 5px 0 0 0;
}

.error-message {
    color: #FF5555;
    margin: 5px 0 0 0;
}

/* Column widths */
.leaderboard-list th:nth-child(1),
.leaderboard-list td:nth-child(1) {
    width: 10%;
}

.leaderboard-list th:nth-child(2),
.leaderboard-list td:nth-child(2) {
    width: 35%;
}

.leaderboard-list th:nth-child(3),
.leaderboard-list td:nth-child(3) {
    width: 25%;
}

.leaderboard-list th:nth-child(4),
.leaderboard-list td:nth-child(4) {
    width: 30%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .leaderboard-panel {
        width: 95%;
        padding: 15px;
    }
    
    .name-input {
        flex-direction: column;
    }
    
    .leaderboard-list th:nth-child(4),
    .leaderboard-list td:nth-child(4) {
        display: none;
    }
}
