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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: #f7f7f7;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 20px;
    flex-wrap: wrap;
}

.score-board {
    background: #2d3748;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.2em;
    font-weight: bold;
    display: flex;
    gap: 30px;
}

.leaderboard {
    background: #edf2f7;
    padding: 15px 25px;
    border-radius: 10px;
    min-width: 200px;
}

.leaderboard h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1em;
    text-align: center;
}

#leaderboardList {
    font-size: 0.9em;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #cbd5e0;
}

.leaderboard-rank {
    color: #718096;
    width: 30px;
}

.leaderboard-name {
    flex: 1;
    font-weight: bold;
}

.leaderboard-score {
    color: #48bb78;
    font-weight: bold;
}

canvas {
    border: 3px solid #2d3748;
    border-radius: 10px;
    background: white;
    display: block;
    margin: 0 auto;
    cursor: pointer;
}

.controls {
    margin-top: 20px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn:hover {
    transform: scale(1.05);
    background: #38a169;
}

.instructions {
    text-align: center;
    margin-top: 20px;
    color: #4a5568;
    font-size: 0.9em;
}

kbd {
    background: #2d3748;
    color: white;
    padding: 3px 8px;
    border-radius: 5px;
    font-family: monospace;
}

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

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
}

.modal-content input {
    padding: 10px;
    font-size: 1em;
    margin: 15px 0;
    width: 100%;
    border: 2px solid #cbd5e0;
    border-radius: 5px;
}

.loading {
    text-align: center;
    color: #718096;
    padding: 10px;
}