:root {
    --color-light: #f0f0f0;
    --color-white: #ffffff;
    --color-main: #001eff;
    --color-right: #acfe42;
    --color-wrong: #fe0101;

    --border: 2px dashed var(--color-main);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    color: var(--color-main);
    background-color: var(--color-light);
    -webkit-text-stroke: 5px var(--color-white);
    paint-order: stroke fill;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

body::after {
    content: "";
    position: fixed;
    inset: 3vmin;
    box-sizing: border-box;
    border: var(--border);
    pointer-events: none;
}

h1 {
    -webkit-text-stroke: 10px var(--color-white);
}

p {
    margin: 1rem 0;
}

button {
    font: inherit;
    cursor: pointer;
    color: var(--color-main);
    border: var(--border);
    background-color: var(--color-light);
    padding: 1rem 3rem;
    transition: 0.5s;
}

button:hover {
    box-shadow: inset 0 0 30px 10px var(--color-main);
}

.start-button {
    margin-top: 3rem;
    width: 50%;
}

main {
    position: relative;
    width: min(100% - 2rem, 70rem);
    margin: 0 auto;
    padding: 3rem 0;
}

.scoreboard {
    position: fixed;
    top: 5vmin;
    right: 5vmin;
    z-index: 1;
    display: flex;
    gap: 1rem;
    transform-origin: top right;
}

.scoreboard[hidden] {
    display: none;
}

.scoreboard.is-exiting {
    animation: scale-out 0.34s cubic-bezier(0.6, 0, 0.8, 0.2) both;
}

.screen {
    display: none;
}

.screen.is-active {
    display: block;
}

.intro,
.results {
    padding: 12vh 0;
    text-align: center;
}

.quiz-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quiz-header h1 {
    margin: 0;
}

.question-number {
    margin: 0 0 0.5rem;
}

.answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.answer {
    min-height: 9rem;
    padding: 1rem;
    border: var(--border);
    background-color: var(--color-light);
    text-align: left;
}

.answer.is-correct {
    box-shadow: inset 0 0 50px 20px var(--color-right);
}

.answer.is-wrong {
    box-shadow: inset 0 0 50px 20px var(--color-wrong);
}

.answer:disabled {
    cursor: default;
}

.transition-element {
    transform-origin: center;
}

.answer.is-correct.is-feedback {
    animation: answer-right 0.42s ease-out both;
    animation-delay: var(--transition-delay);
}

.answer.is-wrong.is-feedback {
    animation: answer-wrong 0.42s ease-out both;
    animation-delay: var(--transition-delay);
}

.transition-element.is-entering {
    animation: scale-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--transition-delay);
}

.transition-element.is-exiting:not(.answer) {
    animation: scale-out 0.34s cubic-bezier(0.6, 0, 0.8, 0.2) both;
    animation-delay: var(--transition-delay);
}

.answer.is-answer-exiting {
    animation: scale-out 0.34s cubic-bezier(0.6, 0, 0.8, 0.2) both;
    animation-delay: var(--transition-delay);
}

@keyframes answer-right {
    from {
        box-shadow: inset 0 0 0 0 transparent;
    }
    to {
        box-shadow: inset 0 0 50px 20px var(--color-right);
    }
}

@keyframes answer-wrong {
    from {
        box-shadow: inset 0 0 0 0 transparent;
    }
    to {
        box-shadow: inset 0 0 50px 20px var(--color-wrong);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scale-out {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0);
    }
}

.explanation {
    padding: 12vh 0;
}

.explanation img {
    display: block;
    max-width: 100%;
    max-height: 50vh;
    margin: 1rem 0;
}

.feedback-actions {
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .answers {
        grid-template-columns: 1fr;
    }

    .quiz-header {
        align-items: center;
    }

    body::after {
        inset: 1vmin;
    }
}
