*,
::before,
::after {
    box-sizing: border-box;
    font-family: 'Varela Round', sans-serif;
    font-weight: normal;
}

:root {
    --calc-btn-size: 75px;
    --wrong: rgb(233, 27, 27);
    --right: rgb(79, 199, 9);
    --font-size: clamp(16px, 14vw, 70px);

    --change-mode-bgcolor: rgb(34, 34, 34);
    --bgcolor: rgba(255,255,255, 1);
    --font-color: rgb(127, 127, 127);
    --answer-dash: rgba(0,0,0,1);
    --answer-font-color: rgba(0,0,0,1);
    --number-btn-hover-color: rgba(128, 0, 128, 0.1);
}

html,
body {
    margin: 0;
    padding: 0;
}

.dark
{
    --change-mode-bgcolor: rgb(255,255,255);
    --bgcolor: rgb(34, 34, 34);
    --font-color: rgb(226, 226, 226);
    --answer-dash: rgb(224, 224, 224);
    --answer-font-color: rgba(255,255,255,1);
    --number-btn-hover-color: rgb(184, 117, 184);

    background-color: var(--bgcolor);
}

#container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    position: relative;
    z-index: 2;
    width: 100vw;
    height: 100vh;
    color: var(--font-color);
}

.calcContainer{
    height: 50vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.question {
    padding: 50px 0;
    font-size: var(--font-size);
    opacity: 0.9;
}

.answerContainer {
    text-align: center;
}

.answer {
    font-size: var(--font-size);
    color: var(--answer-font-color);
    padding: 0 20px;
    display: block;
    min-height: 115px;
}

.answerContainer:after {
    content: " ";
    display: block;
    background-color: var(--answer-dash);
    animation: glow 0.7s ease-in-out infinite alternate;
    height: 7px;
    width: 100%;
    border-radius: 5px;
}

@keyframes glow {
    from {
        opacity: 0.3;
    }

    to {
        opacity: 1;
    }
}

.answer.correct {
    color: var(--right);
}

.answer.wrong {
    color: var(--wrong);
    transform: translate3d(0, 0, 0);
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.next {
    border: 6px solid rgb(5, 156, 0);
    background-color: var(--right);
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    margin-top: 40px;
    padding: 15px 60px;
    font-size: 1.5rem;
    z-index: 500;
    display: block;
    position: relative;
    margin: 50px auto;
}

.number-grid {
    display: grid;
    justify-content: center;
    align-content: center;
    grid-template-columns: repeat(3, var(--calc-btn-size));
    grid-template-rows: minmax(var(--calc-btn-size), auto) repeat(3, var(--calc-btn-size));
    bottom: 20px;
    position: fixed;
}

.number-grid>button {
    color: rgb(0, 0, 0);
    cursor: pointer;
    font-size: 1.5rem;
    border: 2px solid rgb(127, 127, 127);
    outline: none;
    background-color: white;
    border-radius: 5px;
    margin: 2px;
    text-align: center;
}

.number-grid>button:hover {
    background-color: var(--number-btn-hover-color);
}

.number-grid>button.backspace {
    background-color: rgb(197, 197, 197);
}

.number-grid>button:last-child {
    background-color: rgb(87, 224, 87);
}

#canvas {
    position: absolute;
    z-index: 1;
    width: 100vw;
    height: 100vh;
}


.introduction {
    position: absolute;
    inset: 0;
    z-index: 99;
    background-color: var(--bgcolor);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.introduction .introductionText {
    width: 80%;
}

.introduction .introductionText input[type=checkbox] {
    display: none;
}

.introduction .introductionText .labelmethod {
    -webkit-tap-highlight-color:  rgba(255, 255, 255, 0); 
    position: relative;
    cursor: pointer;
}

.introduction .introductionText .method {
    margin: 45px;
}

.introduction .introductionText svg {
    transform: scale(3);
}

.introduction .introductionText svg.plus {
    transform: rotate(45deg) scale(3);
}

.introduction .introductionText .check {
    position: absolute;
    bottom: 26px;
    right: 22px;
}

.introduction .form .minmaxlabel {
    width: 100px;
    display: inline-block;
}

.introduction .form .min,
.introduction .form .max {
    width: 70px;
    padding: 10px;
    margin: 5px;
}

.changeprofile{
    position: fixed;
    bottom: 23px;
    right: 20px;
    width: 35px;
    transform: rotate(90deg);
    cursor: pointer;
}

.change-mode{
    position: relative;
    bottom: 25px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 0;
    background-color: var(--change-mode-bgcolor);
    cursor: pointer;
    -webkit-tap-highlight-color:  rgba(255, 255, 255, 0); 
}

.change-mode::after{
    display: block;
    content: " ";
    background-color: var(--bgcolor);
    width: 20px;
    height: 20px;
    position: absolute;
    top: -5px;
    border-radius: 50%;
    transition: transform 0.7s;
    transform: translateX(5px);
}

.dark .change-mode::after{
    transform: translateX(20px) translateY(-20px);
}

@media all and (max-width: 750px) {
    :root {
        --calc-btn-size: 70px;
    }

    .answer {
        min-height: 77px;
    }

    .next {
        margin-top: 20px;
        padding: 10px 30px;
        font-size: 1.0rem;
    }

    .number-grid>button {
        margin: 10px;
    }

    .introduction .introductionText .method {
        margin: 25px 22px;
    }

    .introduction .introductionText .check {
        bottom: 8px;
        right: 4px;
      }
}
