.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 15px 0;
}

.difficulty-btn {
    padding: 15px 25px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    background: #001100;
    color: #00ff00;
    border: 2px solid #00ff00;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-width: 140px;
}

.difficulty-btn:hover {
    background: #003300;
    box-shadow: 0 0 15px #00ff00;
    transform: scale(1.05);
}

.difficulty-btn.active {
    background: #00ff00;
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 20px #00ff00;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.game-container {
    background: #000;
    border: 4px solid #00ff00;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
}

.game-header {
    text-align: center;
    margin-bottom: 10px;
    padding: 10px;
    background: linear-gradient(90deg, #001100 0%, #003300 50%, #001100 100%);
    border: 2px solid #00ff00;
}

.game-header h1 {
    color: #00ff00;
    font-size: 2.5em;
    text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    letter-spacing: 8px;
    margin-bottom: 10px;
}

.score-display {
    display: flex;
    justify-content: space-around;
    font-size: 1.2em;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.score-display span {
    padding: 5px 15px;
}

#gameCanvas {
    display: block;
    border: 2px solid #00ff00;
    background: #000033;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.game-controls {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.instructions {
    color: #00ff00;
    font-size: 0.9em;
}

.instructions h3 {
    margin-bottom: 8px;
    text-shadow: 0 0 5px #00ff00;
}

.instructions p {
    margin: 3px 0;
    opacity: 0.8;
}

#startButton {
    background: linear-gradient(180deg, #00ff00 0%, #00cc00 100%);
    color: #000;
    border: 3px solid #00ff00;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
    transition: all 0.2s;
}

#startButton:hover {
    background: linear-gradient(180deg, #00ff00 0%, #00ff00 100%);
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.8);
    transform: scale(1.05);
}

#startButton:active {
    transform: scale(0.95);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#viewLeaderboardButton {
    background: linear-gradient(180deg, #0088ff 0%, #0066cc 100%);
    color: #fff;
    border: 3px solid #0088ff;
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.5);
    transition: all 0.2s;
}

#viewLeaderboardButton:hover {
    background: linear-gradient(180deg, #00aaff 0%, #0088ff 100%);
    box-shadow: 0 0 25px rgba(0, 136, 255, 0.8);
    transform: scale(1.05);
}

#viewLeaderboardButton:active {
    transform: scale(0.95);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #001100 0%, #003300 100%);
    border: 4px solid #00ff00;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    color: #00ff00;
    font-size: 2em;
    margin-bottom: 20px;
    text-shadow: 0 0 10px #00ff00;
    letter-spacing: 3px;
}

#playerNameInput {
    width: 100%;
    padding: 15px;
    font-size: 1.5em;
    font-family: 'Courier New', monospace;
    background: #000;
    color: #00ff00;
    border: 3px solid #00ff00;
    border-radius: 5px;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.2);
}

#playerNameInput:focus {
    outline: none;
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.4), 0 0 20px rgba(0, 255, 0, 0.5);
}

#submitNameButton,
#closeLeaderboardButton {
    background: linear-gradient(180deg, #00ff00 0%, #00cc00 100%);
    color: #000;
    border: 3px solid #00ff00;
    padding: 15px 50px;
    font-size: 1.3em;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transition: all 0.2s;
}

#submitNameButton:hover,
#closeLeaderboardButton:hover {
    background: linear-gradient(180deg, #00ff00 0%, #00ff00 100%);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
    transform: scale(1.05);
}

#submitNameButton:active,
#closeLeaderboardButton:active {
    transform: scale(0.95);
}

.name-hint {
    color: #00ff00;
    font-size: 0.8em;
    margin-top: 10px;
    opacity: 0.7;
}

/* Leaderboard Styles */
.leaderboard-content {
    max-width: 600px;
}

#leaderboardTable {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

#leaderboardTable thead {
    background: #003300;
}

#leaderboardTable th {
    color: #00ff00;
    padding: 12px;
    border: 2px solid #00ff00;
    text-align: center;
    font-size: 1.1em;
    text-shadow: 0 0 5px #00ff00;
}

#leaderboardTable td {
    color: #00ff00;
    padding: 10px;
    border: 1px solid #00ff00;
    text-align: center;
    font-size: 1em;
}

#leaderboardTable tbody tr:nth-child(1) td {
    background: rgba(255, 215, 0, 0.1);
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 5px #ffd700;
}

#leaderboardTable tbody tr:nth-child(2) td {
    background: rgba(192, 192, 192, 0.1);
    color: #c0c0c0;
    font-weight: bold;
}

#leaderboardTable tbody tr:nth-child(3) td {
    background: rgba(205, 127, 50, 0.1);
    color: #cd7f32;
    font-weight: bold;
}

#leaderboardTable tbody tr:hover {
    background: rgba(0, 255, 0, 0.1);
}

.rank-medal {
    font-size: 1.2em;
}

#closeLeaderboardButton {
    margin-top: 20px;
}

/* Mobile Responsive */
@media (max-width: 850px) {
    .game-container {
        padding: 10px;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .instructions {
        text-align: center;
    }
    
    .button-group {
        width: 100%;
    }
    
    #startButton,
    #viewLeaderboardButton {
        width: 100%;
    }
}