body {
    margin: 0;
    overflow: hidden; /* Verhindert Scrollbalken */
    font-family: sans-serif;
    background-color: #f0f0f0;
}

#login-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e0e0e0;
}

#username-input,
#join-chat-button {
    padding: 10px 20px;
    margin: 10px;
    border: none;
    border-radius: 5px;
}

#username-input {
    width: 300px;
    text-align: center;
}

#join-chat-button {
    background-color: #4CAF50;
    color: white;
    cursor: pointer;
}

#chat-screen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative; /* Für absolute Positionierung des Overlays */
}

#chat-canvas {
    border: 1px solid black;
    background-color: black; /* Hintergrund auf Schwarz gesetzt */
    flex-grow: 1; /* Nimmt den verfügbaren Platz ein */
}

#top-right-buttons {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 10; /* Sicherstellen, dass sie über dem Canvas liegen */
}

#top-right-buttons button {
    width: 40px; /* Feste Breite und Höhe für runde Buttons */
    height: 40px;
    border-radius: 50%; /* Rund machen */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Leichter Schatten */
    background-color: #3d3d3d; /* Neue Farbe */
}

#logout-button {
    background-color: #dc3545; /* Rote Farbe für Logout */
}

.button-like-input {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em;
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    background-color: #3d3d3d; /* Same as other buttons */
}

.chat-message-item {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    margin-bottom: 15px;
}

.sender-info {
    display: flex;
    align-items: center;
    margin-right: 10px; /* Space between avatar/name and message text */
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
    border: 1px solid #eee;
}

.message-avatar-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    color: white;
    margin-right: 5px;
    border: 1px solid #eee;
}

.message-text {
    flex-grow: 1; /* Take remaining space */
    word-break: break-word; /* Break long words */
}


#toggle-particles-button.particles-inactive {
    filter: grayscale(100%); /* Emoji grau machen */
}

#chat-overlay {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%; /* Oder eine feste Breite */
    max-width: 600px; /* Maximale Breite für bessere Lesbarkeit */
    display: flex;
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.8); /* Leicht transparenter Hintergrund */
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    padding: 15px; /* Erhöhter Abstand zu den Seiten */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    box-sizing: border-box; /* Padding in die Breite einbeziehen */
}

#chat-messages {
    height: 100px;
    overflow-y: scroll;
    padding: 5px;
    margin-bottom: 15px; /* Mehr Abstand nach unten */
    background-color: #fff;
    border-radius: 5px;
    height: 50vh;
    min-height: 500px;
}

#chat-messages div {
    margin-bottom: 15px; /* Abstand zwischen den Nachrichten */
}

.chat-message-item {
    display: flex;
    align-items: flex-start; /* Align items to the top */
    margin-bottom: 15px;
}

.sender-info {
    display: flex;
    align-items: center;
    margin-right: 10px; /* Space between avatar/name and message text */
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
    border: 1px solid #eee;
}

.message-avatar-fallback {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    color: white;
    margin-right: 5px;
    border: 1px solid #eee;
}

.message-text {
    flex-grow: 1; /* Take remaining space */
    word-break: break-word; /* Break long words */
}

#chat-input-area {
    display: flex;
    flex-direction: column; /* Standardmäßig Spaltenlayout */
    gap: 10px; /* Abstand zwischen den Zeilen */
}

#message-send-row {
    display: flex;
    width: 100%;
    gap: 10px; /* Abstand zwischen Input und Button */
}

#message-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    /* margin-right: 10px; -- Wird jetzt durch gap in #message-send-row geregelt */
}

#send-message-button {
    padding: 10px 15px;
    background-color: #008CBA;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em; /* Größer für Symbol */
}

#action-buttons-row {
    display: flex;
    justify-content: flex-end; /* Buttons rechts ausrichten */
    gap: 10px; /* Abstand zwischen den Buttons */
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    #chat-overlay {
        width: 100%;
        /* max-width: none; -- Entfernt wie gewünscht */
        border-radius: 0; /* Ecken abrunden entfernen */
        padding: 15px; /* Erhöhtes Padding für mehr Abstand */
        background-color: transparent; /* Hintergrundfarbe entfernen */
    }

    #chat-input-area {
        flex-direction: column; /* Sicherstellen, dass es gestapelt bleibt */
    }

    #message-send-row {
        width: 100%;
        gap: 5px; /* Etwas weniger Abstand auf kleinen Bildschirmen */
    }

    #message-input {
        margin-right: 0; /* Abstand entfernen, da gap in #message-send-row */
    }

    #action-buttons-row {
        justify-content: flex-start; /* Buttons links ausrichten auf Mobile */
        width: 100%;
        gap: 5px; /* Etwas weniger Abstand auf kleinen Bildschirmen */
    }

    #top-right-buttons {
        top: 10px;
        right: 10px;
        gap: 5px;
    }

    #top-right-buttons button {
        width: 35px;
        height: 35px;
        font-size: 1.3em;
    }
}
