body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Startet oben */
    min-height: 100vh;
}

header {
    margin-top: 20px;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

#game-container {
    width: 400px; /* Feste Breite für den Spielcontainer */
    margin: 20px auto;
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#image-container {
    position: relative;
    width: 100%;
    height: 400px; /* Feste Höhe für den Bildcontainer */
    margin-bottom: 20px; /* Abstand nach unten */
    overflow: hidden; /* Damit nichts außerhalb des Containers angezeigt wird */
}

#current-image {
    width: 100%; /* Passe die Breite des Bildes an den Container an */
    height: 100%; /* Passe die Höhe des Bildes an den Container an */
    object-fit: cover; /* Behalte das Seitenverhältnis des Bildes bei */
}

#red-dot {
    display: none; /* Anfangs unsichtbar */
    position: absolute;
    background-color: red;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none; /* Verhindere, dass der Punkt Klicks blockiert */
}

#feedback-message {
    font-size: 24px;
    margin: 10px 0;
    text-align: center;
    transition: opacity 0.5s ease;
    opacity: 0;
}

.correct {
    color: green;
}

.wrong {
    color: red;
}

#scoreboard {
    margin-bottom: 20px;
    text-align: center;
}

#scoreboard p {
    font-size: 18px;
    margin: 5px 0;
}

/* Highscore-Bereich */
#highscore-section {
    margin: 20px auto;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

#highscore-list-container {
    max-height: 200px; /* Begrenze die Höhe für Scrollen */
    overflow-y: auto; /* Ermöglicht Scrollen */
    margin-top: 15px;
    padding: 10px;
    border-top: 1px solid #ddd; /* Obere Begrenzungslinie */
}

#highscore-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

#highscore-list li {
    padding: 10px;
    background-color: #e9e9e9;
    margin: 8px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 18px;
    text-align: left;
}

#highscore-list li:nth-child(odd) {
    background-color: #f5f5f5; /* Abwechselnde Farben für bessere Lesbarkeit */
}

#player-name {
    padding: 8px;
    width: 200px;
    margin-right: 10px;
}

button {
    padding: 8px 16px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
}

button:hover {
    background-color: #0056b3;
}

footer {
    margin-top: 40px;
    text-align: center;
}

/* Anpassungen für den Countdown und die Spielfunktionen */
#countdown-message {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

/* Anpassungen für das Spiel-Ende-Modal */
.modal {
    display: none; /* Standardmäßig ausgeblendet */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Halbtransparenter Hintergrund */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 300px;
    border-radius: 8px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* Anpassungen für Toast-Nachrichten */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.toast {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    animation: fadeInOut 3s forwards; /* Animationsdauer */
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Anpassungen für die Popups */
.popup {
    display: none; /* Popup versteckt */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Halbtransparenter Hintergrund */
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px; /* Maximale Breite des Popups */
    text-align: center;
    position: relative;
}

.popup.show {
    display: flex;
}

/* Ein-/Ausblenden von versteckten Elementen */
.hidden {
    display: none;
}

/* Toast-Nachrichten */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
}

.toast {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Konfetti-Canvas */
#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10; /* Höhere Z-Ebene, um über dem Bild zu liegen */
}

/* Shake Animation */
@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shake {
    animation: shake 0.5s; /* Dauer und Timing der Shake-Animation */
    animation-timing-function: ease-in-out;
}

/* Anpassungen für Kontaktformular */
#contact-form-container {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#contact-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 400px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#contact-form input, #contact-form textarea {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    margin: 5px 0;
    border-radius: 4px;
    border: 1px solid #ccc;
    resize: none;
    box-sizing: border-box;
}

#contact-form textarea {
    height: 100px;
}

#contact-form button {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#contact-form button:hover {
    background-color: #0056b3;
}

/* Anpassungen für das Chatfenster */
#chat-container {
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 10px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#chat-box {
    display: flex;
    flex-direction: column;
    height: 300px;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    height: 200px;
}

.message {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 8px;
    max-width: 80%;
}

.message.admin {
    background-color: #e9e9e9;
    text-align: left;
    margin-left: 0;
}

.message.user {
    background-color: #007bff;
    color: #fff;
    text-align: right;
    margin-left: auto;
}

#chat-input {
    padding: 8px;
    width: 80%;
    margin-right: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#chat-container button {
    padding: 8px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#chat-container button:hover {
    background-color: #0056b3;
}

/* Start-Knopf spezifische Anpassung */
#start-button-logged-in,
#start-button-guest {
    display: inline-block; /* Stelle sicher, dass die Knöpfe angezeigt werden */
    margin-top: 10px;
}

#auth-buttons button {
    margin: 5px;
}

#admin-container {
    width: 400px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#image-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 20px;
    overflow: hidden;
}

#image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#highlight-rect {
    position: absolute;
    border: 2px dashed red;
    pointer-events: none;
    display: none;
    box-sizing: border-box;
}

#controls {
    margin-top: 20px;
    text-align: center;
}

#coords {
    margin-top: 10px;
    text-align: center;
}

.control-group {
    margin-bottom: 10px;
    text-align: center;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
}

.control-group input {
    padding: 8px;
    width: 100%;
    max-width: 80px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}

input[type="file"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}
