*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        interpolate-size: allow-keywords;
    }
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}

input,
button,
textarea,
select {
    font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}


p {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: balance;
}

#root,
#__next {
    isolation: isolate;
}

:root {
    --green: hsl(94, 98%, 40%);
    --green: hsl(94, 98%, 32%);
    --red: hsl(357, 84%, 56%);
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

main {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    width: 30%;
    max-width: 50vw;
}

header {
    display: flex;
    justify-content: space-between;
    width: 100%;

    .score {
        display: flex;
        justify-content: center;
        position: relative;

        span {
            min-width: 2rem;
            text-align: center;
            padding: .5rem 1rem;
            color: white;
            font-family: monospace;
            font-size: 1.2rem;
        }

        .good {
            border-radius: .5rem 0 0 .5rem;
            background: var(--green);
            border-right: 4px dotted black;
        }

        .bad {
            border-radius: 0 .5rem .5rem 0;
            background: var(--red);
            border-left: 4px dotted black;
        }
    }

    button {
        border: none;
        background: none;
        color: grey;
        transition: all .2s;

        &:hover {
            color: var(--green);
        }
    }
}

main > section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flag-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

.flag-container img {
    height: fit-content;
    place-self: center;
    border-radius: 1rem;
    max-width: 100%;
    max-height: 300px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.choices {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 1rem;
}

.choices hr {
    color: rgba(0, 0, 0, 0.2);
    width: 33%;
    transition: all .2s;
    margin: auto;
}

.choices #choice-next {
    &:disabled {
        color: rgba(0, 0, 0, 0.2);
    }
}

section button {
    padding: .5rem 2rem;
    background: white;
    border: 1px solid rgb(209, 209, 209);
    border-radius: .5rem;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 1rem;
    transition: background .2s, color .2s;
    display: flex;
    letter-spacing: 0.15cap;
    justify-content: center;

    &:not(:disabled, .correct, .wrong) {
        box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);

        &:hover,
        &:focus,
        &:focus-visible,
        &:active {
            background: rgb(245, 245, 245);
            box-shadow: 0 0px 0px rgba(0, 0, 0, 0.1);
        }
    }

    &.correct {
        background: var(--green);
        color: white;
    }

    &.wrong {
        background: var(--red);
        color: white;
    }
}

#lang-panel {
    .container {
        display: flex;
        flex-direction: column;
        gap: .5rem;
    }

    button {
        background: white;
        position: relative;
        display: flex;
        padding: .5rem 1rem;
        gap: 1rem;
        align-items: center;
        justify-content: space-between;

        &.selected {
            /* border: 1px solid hsla(94, 98%, 40%, .8); */
            border: none;
            box-shadow: none;
            top: 0;
            left: 0;
            inset: 0;
            color: white;
            background: var(--green);
        }

        img {
            width: 10%;
        }
    }
}

.hidden {
    display: none !important;
}

button.toggled {
    color: var(--green);
}

#menu-panel {
    h1 {
        text-align: center;
    }
}

@media screen and (max-width: 1000px) {
    main {
        width: 60%;
        max-width: 60vw;
    }
}

@media screen and (max-width: 600px) {
    main {
        width: 90%;
        max-width: 90vw;
    }

    #lang-select button>img {
        width: 20%;
    }

    .flag-container {
        height: 200px;

        img {
            max-height: 200px;
        }
    }
}