body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #2980b9, #2c3e50);
    color: #fff;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.game-info {
    display: flex;
    justify-content: space-around;
    width: 300px;
    margin-bottom: 20px;
}

.game-area {
    width: 400px;
    height: 400px;
    background-color: #000;
    position: relative;
    border: 2px solid #fff;
    display: grid;
    grid-template-columns: repeat(20, 20px);
    grid-template-rows: repeat(20, 20px);
}

.controls {
    margin-top: 20px;
}

button {
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    background-color: #e74c3c;
    color: white;
    cursor: pointer;
    transition: transform 0.3s;
}

button:hover {
    transform: scale(1.1);
}

.snake {
    background-color: #0f0;
    border-radius: 5px;
}

.food {
    background-color: red;
    border-radius: 5px;
}

.game-over {
    display: none;
    font-size: 2em;
    color: #e74c3c;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    cursor: pointer;
}

.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.middle-controls {
    display: flex;
    justify-content: space-between;
    width: 200px; /* Increased width for spacing */
    margin-top: 10px;
}

.control-button {
    width: 60px;
    height: 60px;
    background-color: #e74c3c;
    color: white;
    border: none;
    margin-bottom: 20px;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    transition: transform 0.3s;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.control-button:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .mobile-controls {
        display: flex;
    }
}
