body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Ändere von center auf flex-start, um es nicht zu mittig zu machen */
    min-height: 100vh;
    margin: 0;
    background-color: #f4f4f4;
    color: #333;
    padding: 20px; /* Zusätzlicher Abstand, besonders für kleine Bildschirme */
    box-sizing: border-box; /* Stellt sicher, dass Padding innerhalb der Box bleibt */
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 500px; /* Maximale Breite, damit es auf großen Bildschirmen nicht zu breit wird */
}

h1 {
    color: #0056b3;
    margin-bottom: 25px;
}

/* Schwierigkeitsauswahl */
.difficulty-selection {
    margin-bottom: 20px;
}

.difficulty-selection button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.difficulty-selection button:hover {
    background-color: #0056b3;
}

/* Spielbereich */
#game-area {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

.hangman-display {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

#hangmanCanvas {
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.word-display {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 5px;
}

#guesses-left, #guessed-letters {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.input-area {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px; /* Abstand zwischen Input und Button */
}

#letter-input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.2em;
    text-transform: uppercase; /* Eingabe wird zu Großbuchstaben */
    width: 60px; /* Feste Breite für das Eingabefeld */
    text-align: center;
}

#guess-button, #restart-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

#guess-button:hover, #restart-button:hover {
    background-color: #218838;
}

#restart-button {
    margin-top: 20px;
    background-color: #6c757d;
}

#restart-button:hover {
    background-color: #5a6268;
}

.message {
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
    color: #dc3545; /* Standardmäßig rot für Fehlermeldungen/Verloren */
}

/* Responsive Design für kleinere Bildschirme */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    .difficulty-selection button {
        display: block; /* Buttons untereinander auf kleinen Bildschirmen */
        width: calc(100% - 10px); /* Volle Breite mit Padding */
        margin: 5px auto;
    }

    .input-area {
        flex-direction: column; /* Input und Button untereinander */
        align-items: center;
    }

    #letter-input {
        width: calc(100% - 22px); /* Volle Breite, berücksichtigt Padding und Border */
        max-width: 150px;
    }
}