html {
    user-select: none;
    scroll-behavior: smooth;


    --headerHeight: 45px;
    --headerHeight-large: 80px;

}

body,
html {
    width: 100%;
    margin: 0;
    padding: 0;
    overscroll-behavior: none;
}

body {
    background-color: #e5e5e5 !important;
}

.sticky {
    position: sticky;
    top: 0;
    z-index: 2;
}



#layout {
    background-color: #e5e5e5;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
    /* Fallback for browsers that do not support Custom Properties */
    min-height: calc(var(--vh, 1vh) * 100 - var(--headerHeight));
}

header {
    background-color: var(--headerColor);
    height: var(--headerHeight);
    margin: 0 auto;
    z-index: 10;
    top: 0;
    position: relative;
    display: flex;
    align-items: center;

    .title {
        color: var(--titleColor);
        padding: 0 0 0 0.5em;
        font-size: 1.4em;
        font-weight: 300;
    }

    i {
        padding-right: 10px;
    }
}

.q {
    padding: 0.625em;
    margin: 0.625em 0 0.625em 0;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    background-color: white;
    transition: all 1s ease-in-out;
    position: sticky;
    top: 50px;
    z-index: 2;
}

.qnum {
    color: var(--blue);
    font-size: 1rem;
    font-weight: bold;
    padding-bottom: 5px;
}


#toggleYouTube {
    display: none;
}

#waiting-for-question-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;

    .introText {
        margin: auto;
        padding: 2em 10vw 0 10vw;
        text-align: center;
        font-size: 2em;
    }

    .wait-anim {
        position: absolute;
        top: 30%;
        width: 100vw;
        text-align: center;

        img {
            width: 200px;
        }
    }

    svg {
        box-sizing: content-box;
    }
}


.answer-input {
    position: absolute;
    bottom: 20px;
    left: 40px;
    right: 40px;


    input {
        font-size: 1.5em;
    }

    a {
        margin: 10px 0 10px 0;
        float: right;
    }
}

.qdesc {
    padding: 10px;
    font-style: italic;
    font-weight: bold;
}

.choices {
    margin: 0 10px;

    &>div {
        color: #333;
        background: white;
        border-left: 7px solid white;
        cursor: pointer;
        width: 100%;
        padding: 0 0.625em 0 0.625em;
        margin-bottom: 10px;
        transition: opacity 0.3s ease-in-out, background-color 0.1s ease-in-out;
        line-height: 4em;
        box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.2);
        user-select: none;
        position: relative;

        &.show {
            opacity: 1;
        }

        .stat {
            position: absolute;
            right: 0;
            top: 0;
            padding-right: 1em;
            line-height: 4em;
            height: 4em;
        }

        .ansletter {
            font-size: 2.5em;
            width: 0.9em;
        }

        &.notChosen {
            opacity: 0.75;
            cursor: auto;
        }

        &.chosen {
            background-color: #3867d6;
            color: white;
            cursor: auto;
            font-weight: bold;
        }

        &.correctAnswer {
            background-color: var(--correct) !important;
            color: white;
        }

        &.wrongAnswer {
            background-color: var(--wrong) !important;
            color: white;
        }
    }

    &.points div.chosen {
        cursor: pointer !important;
    }

    .a {
        border-color: var(--a);
        opacity: 0;
    }

    .b {
        border-color: var(--b);
        opacity: 0;
    }

    .c {
        border-color: var(--c);
        opacity: 0;
    }

    .d {
        border-color: var(--d);
        opacity: 0;
    }

    .e {
        border-color: var(--e);
        opacity: 0;
    }

    .f {
        border-color: var(--f);
        opacity: 0;
    }
}


.choices.answered>div {
    cursor: not-allowed !important;
}

.choices.already.answered>div {
    background-color: #cacaca;
}

.choices>div::after {
    background-color: blue;
    position: absolute;
    width: 20px;
    height: 1em;
}

#submitAnswerButton {
    background: #388E3C;
    padding: 1em;
    margin: 20px 10px;
    border-radius: 0.5em;
    text-align: center;
    font-weight: bold;
    color: white;
    cursor: pointer;
    border: 0;

    &[disabled] {
        background: #aaaaaa !important;
        cursor: no-drop;
    }
}

#submitAnswerButton:hover {
    background: darken(#388E3C, 10%);
}

#submitAnswerButton:active {
    background: lighten(#388E3C, 10%);
    box-shadow: inset 0px 0px 5px #c1c1c1;
    outline: none;
}





.qt {
    font-size: 1.2rem;
}

#qimg img {
    width: 100%;
    max-height: 24em;
    object-fit: contain;
    margin-bottom: 0.714em;
}





#currentquestion {
    display: flex;
    flex-grow: 1;
    flex-flow: column;
    min-height: 1px;
}



iframe.qvid {
    width: calc(90vw);
    height: calc(56.25vw);
    margin: auto 5vw 0.5em auto;
    max-width: 85%;
    max-height: 25em;
}

.exit {
    display: inline-block;
    position: absolute;
    right: 20px;
    color: white;
    height: 32px;
    width: 45px;
    border: 1px solid white;
    border-radius: 10px;
    line-height: 30px;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

audio {
    margin: 0 auto;
    display: block;
    margin-bottom: 10px;
}


#currentquestion>div:last-child {
    margin-bottom: 60px;
}


.minileague-result {
    opacity: 0;
    background-color: white;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.5);
    padding: 10px;
    z-index: 2;
    margin-top: 1em;
    flex-flow: column;

    >div {
        display: flex;
        margin: auto;
        flex: 0 0 0;
    }

    &.show {
        transition: opacity 0.5s ease-in-out;
        opacity: 1;
    }

    .position {
        font-weight: bold;
        font-size: 1.5rem;
        padding: 0 10px 0 10px;
    }

    .team {
        flex: 1 1 40%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 2em;
        vertical-align: middle;
        font-weight: bold;
        color: var(--blue);
    }

}



#result {
    opacity: 0;
    background-color: white;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.5);
    padding: 10px;
    z-index: 2;
    margin-top: 1em;
    flex-flow: column;

    &.show {
        transition: opacity 0.5s ease-in-out;
        opacity: 1;
    }

    &>div:first-child {
        color: var(--blue);
        font-size: 1rem;
        font-weight: bold;
        padding-bottom: 5px;
    }

    & div:not(first-child) {
        display: flex;

        >div {
            margin: auto;
            flex: 0 0 0;
        }

        .position {
            font-weight: bold;
            font-size: 1.5rem;
            padding: 0 10px 0 10px;
        }

        .image {
            background-color: white;
            background-size: cover;
            border-radius: 50% 50%;
            height: 50px;
            flex-basis: 50px;
            margin-right: 20px;
            border: 3px solid var(--headerColor);
        }

        .team {
            flex: 1 1 40%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding-right: 10px;
        }

        .total {

            background-color: #ccc;
            padding: 5px 10px;
            border-radius: 10% 10%;
            margin-right: 10px;
        }
    }

}

.permission-cont {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
}

.permission {

    margin: auto auto;
    top: 40%;
    height: 200px;
    padding: 2em;
    background-color: var(--correct);
    color: white;
    font-size: 1.2em;
    font-weight: 300;
    border: 0;
    width: 400px;
    max-width: 70%;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;

    &:hover {
        filter: brightness(75%);
    }
}

.alert {
    position: fixed;
    left: 0;
    right: 0;
    height: 40px;
    line-height: 40px;
    color: white;
    bottom: -40px;
    opacity: 0;
    transition: all 0.5s ease-in-out, opacity 0.3s ease-in-out;
    text-align: center;
    z-index: 2;
    display: block !important;

    &.show {
        bottom: 0;
        opacity: 1;
    }
}

#correctMsg {
    background-color: var(--correct);
}

#someCorrectMsg {
    background-color: var(--some);
}

#wrongMsg {
    background-color: var(--wrong);

}


.register {
    .i {
        margin-top: 1em;
        font-size: 0.8em;
    }
}


@media (max-width: 320px) {
    html {
        font-size: 10px;
    }

    .lb {
        font-size: 10px;
    }
}

@media (max-width: 799px) {
    html {
        font-size: 12px;
    }

    header {
        display: flex;
        align-items: center;
    }

    .lb {
        .flag {
            display: none;
        }
    }
}

@media (min-width: 800px) {

    #currentquestion {
        width: 800px;
        margin: 0 auto;
    }

    .alert {
        width: 800px;
        margin: 0 auto;
    }

    #toggleYouTube {
        display: block;
    }

    #qmp3 {
        width: 800px;
    }

    #youtube {
        position: absolute;
        top: 2em;
        left: calc(2em + 800px);

        iframe {
            margin: auto;
            display: block;
        }

    }
}

@media (min-width: 1400px) {
    #currentquestion {
        width: 100vw;
        margin: 0;
    }

    #qimg {
        position: absolute;
        top: 9em;
        left: 850px;
        padding-left: 2em;
        margin-right: 2em;

        img {
            max-height: 30em;
            max-width: 1000px;
            object-position: 0 0;
            margin: 0;
        }
    }



    .q {
        width: 800px;
        margin-left: 2em;
    }

    .choices {
        width: 800px;
        margin-left: 2em;
        padding: 1em;
    }

    #submitAnswerButton {
        width: 780px;
        margin-left: 3em;
        padding: 1em;
    }

    #result,
    .minileague-result {
        width: 800px;
        margin-left: 2em;
    }
}

#chart {
    margin: 2em;
}
