body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #e6e6e6;
    /* Verhindert Zoom-Gesten auf dem Körper der Seite */
    touch-action: manipulation;
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    grid-column-gap: 10px;
    grid-row-gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.box {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid #000;
    background-color: white;
    cursor: pointer;
}

.selected {
    border: 3px solid #007bff;
    background-color: #f8f9fa;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.3);
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Countdown-Styles */
.countdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.countdown-number {
    font-size: 120px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Popup-Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 350px;
    margin: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.popup-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.popup-text {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.popup-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.popup-arrow {
    font-size: 32px;
    color: #007bff;
    animation: bounce 2s infinite;
}

.popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.popup-btn {
    padding: 12px 28px;
    font-size: 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

.popup-btn-yes {
    background-color: #28a745;
    color: white;
}

.popup-btn-yes:hover {
    background-color: #218838;
}

.popup-btn-no {
    background-color: #6c757d;
    color: white;
}

.popup-btn-no:hover {
    background-color: #545b62;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Pulsierendes rotes Blinken */
@keyframes pulse-red {
    0% {
        color: #ff0000;
        text-shadow: 0 0 5px #ff0000;
    }
    50% {
        color: #cc0000;
        text-shadow: 0 0 10px #ff0000;
    }
    100% {
        color: #ff0000;
        text-shadow: 0 0 5px #ff0000;
    }
}

.pulse-red {
    animation: pulse-red 1.5s ease-in-out infinite;
    font-weight: bold;
}

.green {
    background-color: green !important;
    color: white !important;
}

.orange {
    background-color: orange !important;
    color: white !important;
}

.grey {
    background-color: grey !important;
    color: white !important;
}

#message {
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
}

/* "Nochmal"-Button zu Beginn verstecken */
#restartButton, #newGameButton {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    background-color: #007bff;
    color: white;
    transition: background-color 0.2s;
}

#restartButton {
    display: none;
    margin-left: auto;
    margin-right: auto;
}

#newGameButton {
    display: inline-block !important;
    background-color: #28a745;
    margin-left: 10px;
}

#restartButton:hover, #newGameButton:hover {
    opacity: 0.8;
}

/* Virtuelle Tastatur */
#keyboard {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}

.keyboard-row {
    display: flex;
    margin-bottom: 5px;
    justify-content: center;
}

.key {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 50px;
    margin: 1px;
    border-radius: 5px;
    background-color: #d3d6da;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.key-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 24px;
    background-color: #818384;
    color: white;
    margin: 1px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.key.green {
    background-color: green;
    color: white;
}

.key.orange {
    background-color: orange;
    color: white;
}

.key.red {
    background-color: #818384;
    color: #c00;
}

.key.grey {
    background-color: grey;
    color: white;
}

/* Feuerwerks-Animation */
.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 0 0 5px 2px #fff;
    animation: explode 5s ease-out forwards;
}

@keyframes explode {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(10);
    }
}

/* Erdbeben-Animation */
.shake {
    animation: shake 0.5s;
    animation-iteration-count: 3;
}

@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); }
}

.footer-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.footer-links a {
    text-decoration: none;
    color: #000;
    font-size: 16px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.footer-links a:hover {
    text-decoration: underline;
}
