body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
}

#gameContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

#gameCanvas {
    border: 1px solid black;
    background-color: white;
    width: 90vw;
    max-width: 400px;
    height: 90vw;
    max-height: 400px;
}

#score {
    font-size: 24px;
    margin-bottom: 10px;
}

#controls {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(2, 100px);
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

button {
    font-size: 32px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

#up    { grid-column: 2; grid-row: 1; }
#left  { grid-column: 1; grid-row: 2; }
#right { grid-column: 3; grid-row: 2; }
#down  { grid-column: 2; grid-row: 2; }

@media (max-width: 500px) {
    #controls {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(2, 80px);
        gap: 10px;
    }
    button {
        width: 80px;
        height: 80px;
        font-size: 24px;
    }
}

#muteButton {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

#gameOver {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}
