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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

.game-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    max-width: 500px;
    width: 100%;
}

h1 {
    color: #4CAF50;
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.game-controls {
    margin-bottom: 10px;
}

.difficulty-controls {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.difficulty-controls span {
    margin-right: 10px;
    font-weight: bold;
}

.difficulty-controls select {
    padding: 5px;
    border-radius: 5px;
    border: 1px solid #4CAF50;
    background-color: white;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    margin: 0 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
}

.horizontal-controls {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 5px 0;
}

.direction-btn {
    width: 50px;
    height: 50px;
    font-size: 24px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px;
    background-color: #388E3C;
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
}

#gameCanvas {
    background-color: #e8f5e9;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.instructions {
    margin-top: 20px;
    text-align: left;
    font-size: 14px;
    color: #666;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
}

.instructions h3 {
    color: #4CAF50;
    margin-bottom: 10px;
}

.instructions p {
    margin-bottom: 5px;
}

@media (max-width: 500px) {
    .game-container {
        padding: 10px;
    }
    
    .game-info {
        font-size: 16px;
    }
    
    button {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    #gameCanvas {
        width: 300px;
        height: 300px;
    }
}