* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'Courier New', monospace;
    color: #fff;
    padding: 20px;
}

.main-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    max-width: 1600px;
    width: 100%;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.leaderboard-container {
    width: 280px;
    background-color: #111;
    border: 2px solid #333;
    padding: 20px;
    border-radius: 8px;
}

.leaderboard-container h2 {
    font-size: 18px;
    text-align: center;
    margin-bottom: 15px;
    color: #fff;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 5px 0;
    background-color: #1a1a1a;
    border-left: 3px solid #444;
    font-size: 14px;
}

.leaderboard-entry.highlight {
    background-color: #2a2a00;
    border-left-color: #ffff00;
    color: #ffff00;
}

.leaderboard-entry .rank {
    font-weight: bold;
    margin-right: 10px;
    color: #888;
}

.leaderboard-entry .pseudo {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-entry .time {
    color: #aaa;
    margin-left: 10px;
}

.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.score-board {
    display: flex;
    align-items: center;
    gap: 60px;
    font-size: 48px;
    font-weight: bold;
    letter-spacing: 5px;
}

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

.center-line {
    width: 4px;
    height: 60px;
    background-color: #fff;
}

#pongCanvas {
    border: 2px solid #fff;
    background-color: #000;
    display: block;
}

.instructions {
    text-align: center;
    font-size: 14px;
    letter-spacing: 2px;
    line-height: 1.8;
    opacity: 0.7;
}

.instructions p {
    margin: 5px 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #1a1a1a;
    border: 3px solid #fff;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #ffff00;
}

.time-display {
    font-size: 24px;
    margin-bottom: 20px;
    color: #0f0;
}

.modal-content p {
    font-size: 16px;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    background-color: #000;
    color: #fff;
    border: 2px solid #333;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content input:focus {
    outline: none;
    border-color: #fff;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-buttons button {
    padding: 12px 24px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid #fff;
    border-radius: 5px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #0f0;
    color: #000;
}

.btn-primary:hover {
    background-color: #0c0;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: #333;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #555;
    transform: scale(1.05);
}

.error-message {
    color: #f00;
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
}

/* Scrollbar personnalisée */
.leaderboard-list::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: #000;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive */
@media (max-width: 1400px) {
    .main-container {
        flex-direction: column;
        align-items: center;
    }
    
    .leaderboard-container {
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .score-board {
        font-size: 32px;
        gap: 40px;
    }
    
    .instructions {
        font-size: 12px;
    }
    
    .leaderboard-container h2 {
        font-size: 16px;
    }
    
    .modal-content {
        padding: 25px;
    }
    
    .modal-content h2 {
        font-size: 28px;
    }
}
