#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/images/warteraum.jpg');
    
    background-position: center top; 
    
    background-repeat: no-repeat;
    background-size: cover; 
    
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    /* Hier die Kachel für die gesamte Seite */
    background-image: url('/static/images/Kachel2.jpg');
    background-repeat: repeat;
    background-attachment: fixed; /* Das Muster bleibt stehen beim Scrollen */
    
    display: flex;
    justify-content: center; /* Zentriert den Chat-Container horizontal */
    height: 100vh;
}
.chat-header { 
    background: #075e54; 
    color: white; 
    padding: 15px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.chat-wrapper {
    width: 100%;
    max-width: 600px; 
    height: 100vh;
    /* Nutzt die volle verfügbare Höhe auf mobilen Browsern */
    height: calc(100 * var(--vh, 1vh)); 
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* SPEZIELLE REGELN FÜR MOBILE GERÄTE (max 600px Breite) */
@media (max-width: 600px) {
    body {
        /* Auf dem Handy brauchen wir keine seitlichen Kacheln */
        background-image: none; 
        background-color: #f5f5f5;
    }

    .chat-wrapper {
        max-width: 100%; /* Volle Breite nutzen */
        height: 100vh;
        box-shadow: none; /* Schatten auf Handy unnötig */
    }

    .message {
        max-width: 90%; /* Etwas mehr Platz für Text auf schmalen Screens */
        font-size: 16px; /* Bessere Lesbarkeit auf dem Handy */
    }

    .input-area {
        /* Verhindert, dass die Tastatur das Eingabefeld überdeckt */
        padding-bottom: 20px; 
    }

    #user-input {
        font-size: 16px; /* Verhindert automatisches Rein-Zoomen bei iOS */
    }
}

/* Das Chat-Fenster innen drin bleibt clean */
.chat-window { 
    flex: 1; 
    overflow-y: auto; 
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    gap: 10px; 
    justify-content: flex-start; /* Zwingt Nachrichten, oben zu beginnen */
    background-color: #f5f5f5; 
}
/* Tarnung: Gleiche Farbe wie Header-Hintergrund */
#score-display, #attempt-display {
    font-size: 10px;
    color: #075e54; 
    cursor: default;
    user-select: none;
    margin-left: 10px;
}

/* Tarnung im Header */
#score-display, #attempt-display {
    font-size: 10px;
    color: #075e54; /* Gleiche Farbe wie Header-Hintergrund */
    cursor: default;
    user-select: all; /* Wichtig: Erlaubt das Markieren */
    margin-left: 10px;
    opacity: 1;      /* Sicherstellen, dass es nicht ganz weg ist */
}

/* Wenn der Text markiert wird */
#score-display::selection, #attempt-display::selection {
    background-color: #ff9800; /* Auffälliges Orange beim Markieren */
    color: #ffffff;            /* Weißer Text beim Markieren */
}

/* Für Firefox benötigt man einen extra Präfix */
#score-display::-moz-selection, #attempt-display::-moz-selection {
    background-color: #ff9800;
    color: #ffffff;
}
.message { 
    padding: 8px 12px; 
    border-radius: 8px; 
    max-width: 80%; 
    font-size: 14px; 
    line-height: 1.4; 
    white-space: pre-wrap; /* WICHTIG: Erlaubt Zeilenumbrüche im Text */
}
.system { align-self: center; background: #fff3cd; text-align: center; border: 1px solid #ffeeba; color: #856404; }
.user { align-self: flex-end; background: #dcf8c6; }
.imperator { align-self: flex-start; background: #ffffff; border: 1px solid #ccc; }

.input-area { padding: 10px; background: #f0f0f0; display: flex; flex-direction: column; }
#user-input { width: 100%; height: 60px; border-radius: 5px; border: 1px solid #ccc; padding: 10px; box-sizing: border-box; resize: none; }
#send-btn { margin-top: 5px; padding: 10px; background: #075e54; color: white; border: none; border-radius: 5px; cursor: pointer; }
#send-btn:disabled { background: #ccc; cursor: not-allowed; }
.char-counter { font-size: 12px; text-align: right; color: #666; margin-bottom: 2px; }
.warning { color: red; font-weight: bold; }

.login-box {
    background: rgba(0, 0, 0, 0.4); /* Leichter dunkler Schleier für bessere Lesbarkeit */
    padding: 30px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#password-input {
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 8px;
    border: 2px solid #ff9800;
    width: 250px;
    text-align: center;
}

#login-btn {
    padding: 12px 40px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(to bottom, #ffc107, #ff9800);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

#login-btn:hover {
    transform: scale(1.05);
}

#login-error {
    color: #ff5252;
    font-weight: bold;
    display: none;
    text-shadow: 1px 1px 2px black;
}

#restart-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

#login-btn:disabled {
    background: #555 !important; /* Grau statt Orange/Gold */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}