:root {
    --gray: #EEE;
    --ok: #4DAD45;
    --not-ok: #EC2232;
    --navigation: color-mix(in srgb, var(--gray), black 20%);
}

body {
    font-family: Poppins, sans-serif;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-weight: 700;
    margin: 0;
    padding: 0;
}

main {
    width: 100%;
    max-width: 1200px;
    height: auto;
    padding: 15px;
    box-sizing: border-box;
}

.start-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.quiz-container {
    box-sizing: border-box;
    background-color: white;
    border-radius: 20px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    width: 100%;
}

.question-answer-wrapper {
    display: flex;
    flex-direction: row;
    column-gap: 5vw;
    min-height: 65vh;
}

.quiz-container .question-wrapper {
    text-align: left;
    color: #000000;
    width: 50%;
}

.question {
    font-size: 2rem;
}

.quiz-container .question-wrapper .questions-counter .max-possible-score{
    font-size: 1rem;
}

.quiz-container .question-wrapper .question {
    padding: 0;
    margin: 0;
}

.quiz-container .answers {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 50%;
}

.quiz-container .answers button {
    color: black;
    background-color: var(--gray);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 400;
    padding: 10px;
    min-height: 6rem;
    font-family: Poppins;
    width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

.quiz-container .answers button.correct {
    background-color: var(--ok);
}

.quiz-container .answers button.incorrect {
    background-color: var(--not-ok);
}

.quiz-container .navigation {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 15px;
}

.navigation p {
    text-align: left;
    padding: 0;
    margin: 0;
}

.quiz-container .navigation .nav-button {
    background-color: var(--navigation);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: 400;
    height: 3rem;
    padding: 10px;
    margin: 10px 0 0 0;
    width: 10ch;
    align-self: flex-end;
    display: none;
    border-radius: 5px;
}
.quiz-container .navigation .nav-button.visible {
    display: block;
    align-self: flex-end;
}

.navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.score-gif {
    display: none;
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    margin-left: 15px;
}

.score-gif.visible {
    display: inline-block;
}

.navigation .score {
    display: flex;
    align-items: center;
}

.timeout-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 100;
}

.timeout-popup img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.timeout-popup p {
    font-size: 2rem;
    margin-top: 15px;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .question-answer-wrapper {
        flex-direction: column;
    }
    
    .quiz-container .question-wrapper {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .question {
        font-size: 1.5rem;
    }
    
    .quiz-container .answers {
        width: 100%;
    }
    
    .quiz-container .answers button {
        font-size: 1.2rem;
        min-height: 4rem;
    }
    
    .quiz-container .navigation {
        flex-wrap: wrap;
    }
    
    .quiz-container .navigation .nav-button {
        font-size: 1.2rem;
        height: 2.5rem;
        width: 8ch;
    }
}

@media (max-width: 480px) {
    .quiz-container {
        max-width: 95vw;
        margin: 0 auto;
    }
    
    .question {
        font-size: 1.5rem;
    }
    
    .quiz-container .answers button {
        font-size: 1.2rem;
        min-height: 3.5rem;
        padding: 8px;
    }
    
    .quiz-container .navigation .nav-button {
        font-size: 1.2rem;
        min-width: fit-content;
    }
    
    .questions-counter {
        font-size: 0.9rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .question-answer-wrapper {
        flex-direction: row;
        min-height: auto;
    }
    
    .quiz-container .question-wrapper {
        width: 40%;
    }
    
    .quiz-container .answers {
        width: 60%;
    }
    
    .question {
        font-size: 1.2rem;
    }
}

/* Schütteln bei falscher Antwort */
@keyframes shake {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-8px); }
    75%  { transform: translateX(8px); }
    100% { transform: translateX(0); }
}

button.incorrect {
    background-color: var(--not-ok);
    animation: shake 0.3s ease-in-out;
}

/* leuchte blop bei richtiger antwort */
@keyframes correctAnimation {
    0%   { transform: translateY(0);     box-shadow: 0 0 0px var(--ok); }
    40%  { transform: translateY(-12px); box-shadow: 0 0 20px var(--ok); }
    70%  { transform: translateY(-6px);  box-shadow: 0 0 15px var(--ok); }
    100% { transform: translateY(0);     box-shadow: 0 0 0px var(--ok); }
}

button.incorrect {
    background-color: var(--not-ok);
    animation: shake 0.3s ease-in-out;
}

button.correct {
    background-color: var(--ok);
    animation: correctAnimation 0.5s ease-in-out;
}

@keyframes titleBounceIn {
    0%   { transform: translateY(-60px); opacity: 0; }
    70%  { transform: translateY(10px);  opacity: 1; }
    100% { transform: translateY(0); }
}

@keyframes pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.start-screen h1 {
    animation: titleBounceIn 0.6s ease-out;
}

.start-btn {
    animation: pulse 1.5s ease-in-out infinite;
}