body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #2c3e50;
    color: #ecf0f1;
    margin: 0;
    padding: 20px; 
}

.container {
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    text-align: center;
    width: 100%;
    max-width: 500px;
}

h1 {
    color: #f1c40f;
    margin-bottom: 20px;
}

.game-area {
    position: relative;
    margin-bottom: 20px;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: repeat(20, 1fr);
    width: 300px;
    height: 300px;
    border: 5px solid #2980b9;
    background-color: #95a5a6;
    margin: 0 auto;
}

.cell {
    background-color: #95a5a6;
}

.snake {
    background-color: #2ecc71;
    border-radius: 20%;
}

.head {
    background-color: #27ae60;
}

.food {
    background-color: #e74c3c;
    border-radius: 50%;
}

#status-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 5px;
    z-index: 10;
}

.score-panel {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #7f8c8d;
    border-bottom: 1px solid #7f8c8d;
    margin-bottom: 20px;
}

.list-container {
    text-align: left;
    padding: 10px;
    background-color: #2c3e50;
    border-radius: 5px;
}

.list-container ol {
    list-style: none;
    padding: 0;
}

.list-container li {
    padding: 5px 0;
    border-bottom: 1px dotted #7f8c8d;
}

.list-container li:last-child {
    border-bottom: none;
}

/* --- Mobile-Steuerung (NEU) --- */
.touch-controls {
    display: none; /* Standardmäßig ausblenden */
    margin-top: 20px;
}

.control-row {
    display: flex;
    justify-content: center;
}

.control-button {
    background-color: #1abc9c;
    color: white;
    font-size: 1.5em;
    width: 60px;
    height: 60px;
    margin: 5px;
    border: none;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    touch-action: manipulation;
}

/* Media Query für kleine Bildschirme (Smartphones) */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    #game-board {
        width: 250px;
        height: 250px;
    }
    .touch-controls {
        display: block; /* Auf kleinen Bildschirmen einblenden */
    }
    /* Sorgt für das T-förmige Layout der Buttons */
    .control-row:nth-child(2) .control-button:nth-child(2) {
        visibility: hidden;
    }
}