:root {
    --bg-color: #0E0E0E;
    --disabled-color: #202020;
    --green-color-dim: #133218;
    --green-color: #4AC45A;
    --neutral-color: grey;
    --red-color-dim: rgb(35, 0, 0);
    --red-color: darkred;
}

@font-face {
    font-family: PixelifySans;
    src: url(../assets/fonts/PixelifySans-VariableFont-wght.ttf);
    font-display: swap;
}

body {
    background-color: var(--bg-color);
    color: var(--green-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    width: 100vw;
    height: 100vh;
    font-family: PixelifySans, Helvetica, sans-serif;
    margin: 0;
}

header, footer {
    width: 100%;
    opacity: 50%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    overflow: hidden;
}
header h1, footer h1 {
    font-size: 5em;
    margin: 0;
}
header img, footer img {
    height: 60px;
}
.title.red {
    color: var(--red-color);
}

main {
    width: 50vw;
    max-width: 500px;
    min-height: 35vh;
    border: 1px solid var(--green-color);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0px 0px 30px var(--green-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

main.red {
    border: 1px solid var(--red-color);
    box-shadow: 0px 0px 30px var(--red-color);
}

button {
    min-height: 40px;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
}

#heading {
    width: 100%;
    text-align: center;
    margin: 0;
    font-weight: 100;
}


/* Tutorial section */

#tutorial-section {
    color: var(--neutral-color);
    line-height: 150%;
}
#tutorial-section ol {
    margin-block-start: 0;
}

#select-difficulty {
    display: flex;
    justify-content: center;
    gap: 6px;
}

#select-difficulty button {
    background-color: var(--bg-color);
    color: var(--neutral-color);
    font-family: inherit;
    font-size: 1em;
    border: 1px solid var(--neutral-color);
}
#select-difficulty button.selected {
    border-color: var(--green-color);
    color: var(--green-color);
}


/* Answers section */

#answers-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    column-gap: 12px;
    row-gap: 12px;
    width: 100%;
}

#answers-section button {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--neutral-color);
    border: 1px solid var(--neutral-color);
    font-family: inherit;
}

#answers-section button.disabled {
    cursor: auto;
}

#answers-section button:hover {
    background-color: var(--disabled-color);
}

#answers-section button.disabled:hover {
    background-color: var(--bg-color);
}

#answers-section button.correct {
    border-color: var(--green-color);
    color: var(--green-color);
}

#answers-section button.incorrect {
    border-color: var(--red-color);
    color: var(--red-color);
}

#answers-section button.correct.selected {
    background-color: var(--green-color-dim);
}

#answers-section button.incorrect.selected {
    background-color: var(--red-color-dim);
}


/* Results section */

#results-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50%;
}

#results-section #score {
    font-size: 3em;
}


/* Submit button */

#submit-button {
    background-color: var(--green-color);
    color: var(--bg-color);
    font-family: inherit;
    font-size: 1.1em;
    border: none;
    width: 200px;
}

#submit-button.disabled {
    background-color: var(--disabled-color);
}


/* Special styles */

.flip-text {
    -webkit-transform:rotateY(180deg);
    -moz-transform:rotateY(180deg);
    -o-transform:rotateY(180deg);
    -ms-transform:rotateY(180deg);
}

.hidden {
    display: none!important;
}


/* Media queries */

/* Most mobile and tablet sizes */
@media screen and (max-width: 768px) {
    body {
        justify-content: space-evenly;
    }
    main {
        width: 70vw;
        min-height: 60vh;
        max-height: 75vh;
        justify-content: space-between;
        padding: 36px;
    }
    header {
        height: 10vh;
    }
    header h1, footer h1 {
        font-size: 2em;
    }
    header .symbol, footer .symbol {
        max-height: 6vh;
    }
    #heading.shrink {
        font-size: 1.4em;
    }
    #tutorial-section ol {
        padding-inline-start: 20px;
        margin-bottom: 24px;
    }
    #select-difficulty {
        flex-direction: column;
    }
    #answers-section {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr 1fr 1fr;
    }
    #answers-section button {
        font-size: 1em;
    }
    #submit-button {
        width: 100%;
    }
}

/* Landscape mobile */
@media screen 
and (max-width: 1024px) 
and (max-height: 768px)
and (orientation: landscape) {
    body {
        flex-direction: row;
    }
    main {
        width: 70vw;
        max-height: none;
        padding: 36px;
    }
    header, footer {
        width: 20%;
        transform: rotate(-90deg);
    }
    header h1, footer h1 {
        font-size: 2em;
        text-align: center;
    }
    header h1.title, footer h1.title {
        white-space: nowrap;
        margin: 6px;
    }
    .title {
        display: none;
    }
    #heading.shrink {
        font-size: 1.4em;
    }
}

/* small devices such as iPhone 5 */
@media screen and (max-height: 600px) and (orientation: portrait) {
    body {
        height: auto;
        justify-content: flex-end;
    }
    main {
        max-height: 80vh;
        height: 80vh;
        width: 80vw;
        border-radius: 24px 24px 0px 0px;
        border-width: 0;
        padding: 36px;
    }
    header {
        height: 10vh;
    }
    footer {
        display: none;
    }
}

/* small devices landscape */
@media screen and (max-width: 600px) and (orientation: landscape) {
    body {
        flex-direction: column;
        height: auto;
    }
    main {
        height: auto;
        width: 70vw;
        max-height: none;
        margin: 5vh 0;
    }
    header {
        height: 20vh;
        width: 100%;
        transform: none;
    }
    header .title {
        display: block;
    }
    header, footer {
        display: none;
    }
    #heading {
        font-size: 1.4em;
    }
    #heading.shrink {
        font-size: 1.3em;
    }
    #select-difficulty {
        flex-direction: row;
    }
    #answers-section {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
}