body {
    margin: 0;
    padding: 0;
}


.wrapper {
    box-sizing: border-box;
    overflow: auto;
    margin: 0;
    padding: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background-color: hsl(219, 13%, 78%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-size: 16px;
}
p {
    margin: 0px;
    font-size: 16px;
}

label {
    display: inline-block;
    width: 80px;
    margin: 0 10px;
    }

/*///////////////// Starting window ///////////////////*/
@keyframes blinking {
    0%   {transform: scale(1) }
    25%   {transform: scale(1.1) }
    50%   {transform: scale(1.2) }
    75%   {transform: scale(1.1) }
    100%   {transform: scale(1) }
  }

@keyframes rotate {
    0%   {transform: rotate(0) scale(1) }
    100%   {transform: rotate(360deg) scale(0) }
  }

.rotateEver {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: rotate 0.5s 1.2s
}
.logo {
    display: block;
    animation: blinking 1s linear infinite reverse;
}


.loaderStart {
    color: #ffa700;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    z-index: 900;
    position: absolute;
    top: 0;
    left: 0;
    background-color: #555555;
    transition: all 0.3s ease-in-out
}
/*///////////////// Helper ///////////////////*/

.backdrop {
    display: none;
    width: 100%;
    height: 100%;
    z-index: 100;
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgb(0,0,0,0.5)
}
.help {
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    padding: 10px;
    overflow-Y: auto;
    overflow-X: hidden;
    border-radius: 5px;
    background-color: white;
    -webkit-box-shadow: 10px 10px 17px -12px rgba(0,0,0,0.75);
            box-shadow: 10px 10px 17px -12px rgba(0,0,0,0.75);
    width: 80%;
    height:70%;
    position: fixed;
    z-index: 800;
    top: 15%;
    left: 10%;
    -webkit-transition: -webkit-transform 0.3s ease-in-out;
    transition: -webkit-transform 0.3s ease-in-out;
    -o-transition: transform 0.3s ease-in-out;
    transition: transform 0.3s ease-in-out;
    transition: transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;
    -webkit-transform: translateY(-100vh);
        -ms-transform: translateY(-100vh);
            transform: translateY(-100vh)
}

.questionMark {
    outline: none;
    right: 10px;
    top: 10px;
    border-radius: 20px;
    position: fixed;
    color: #888888;
    border: 3px solid #888888;
    font-size: 20px;
    font-weight: bold;
    width: 30px;
    height: 30px;
    background-color: transparent;
}

img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    height: 100%;
}

/*///////////////// Binary Representation ///////////////////*/
.binaryRep {
    width: 100%;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
        -ms-flex-direction: row;
            flex-direction: row;
    padding: 10px 10px;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
}

.binaryRepItem {
    -webkit-box-flex: 1;
        -ms-flex-positive: 1;
            flex-grow: 1;
    border-right: 1px solid white;
    padding: 0 2px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;

}
.binaryRepItem:last-child {
    border-right: none;

}
.binaryRepCluster {
    font-size: 3px;
}


.isZero, .isOne, .binaryOutput {
    margin: 0px;
    width: 10px;
    height: 15px;
    display: inline-block;
    border-radius: 3px;
    background-color: #dfdfde;
    color: black;
    text-align: center;
    font-weight: bold;
}
.binaryOutput {
    font-size: 12px;
}
.isZero {
    background-color: #dfdfde;
}
.isOne {
    background-color: #ffa700;

}
/*///////////////// Control form ///////////////////*/

form {
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    padding: 10px;
    -webkit-box-ordinal-group: 2;
        -ms-flex-order: 1;
            order: 1;
    color: #c0c5ce;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
        -ms-flex-align: start;
            align-items: flex-;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify; 
            justify-content: space-between;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -ms-flex-item-align: end;
        align-self: flex-end;
    width: 100%;
    height: 30%;
    background-color: #555555;
    margin: 0;
}

.controlPanel {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    
}

.rule, .steps {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    margin-bottom: 20px;
    margin-right: 20px;
}

.plus, .minus {
    border-radius: 20px;
    border: 2px solid white;;
    font-size: inherit;
    font-weight: bold;
    background-color: transparent;
    color: white;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent

    
}

button.touch {
    -webkit-transform: scale(1.2);
        -ms-transform: scale(1.2);
            transform: scale(1.2);
}

.buttonSubmit {
    width: 100px;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid white;
    border-radius: 20px;
    padding: 10px;
    border: 1px solid #ffa700;
    background-color: #ffa700;
    font-size: inherit;
    outline: none;
}




/*///////////////// Cellular pattern  ///////////////////*/

.programOutput {
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    padding: 10px;
    border-radius: 10px;
    -webkit-box-shadow: 10px 10px 17px -12px rgba(0,0,0,0.75);
            box-shadow: 10px 10px 17px -12px rgba(0,0,0,0.75);
    background-color: white;

    --prOutput-width: 300px;
    width: var(--prOutput-width);
    height: var(--prOutput-width);
    margin-top: 50px;
}


canvas {
    position: absolute;
    left: -10px;
    top: 0;
}



/*///////////////// Input Range ///////////////////*/

input[type=range] {
    -webkit-appearance: none;
    width: 110px;
    margin: 10px 10px;
    background: transparent;
    border: transparent;
  }
  input[type=range]:focus {
    outline: none;
  }
  input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: #c0c5ce;
    border-radius: 25px;
  }
  
  input[type=range]::-webkit-slider-thumb {
    border: 3px solid #555555;
    height: 30px;
    width: 30px;
    border-radius: 50px;
    background: #ffa700;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -12.1px;
  }
  input[type=range]:focus::-webkit-slider-runnable-track {
    background: #c0c5ce;
  }

  

  input[type=range].touch::-webkit-slider-thumb {
    -webkit-box-shadow: 0px 0px 13px #ffa700, 0px 0px 0px #ffb01a;
            box-shadow: 0px 0px 13px #ffa700, 0px 0px 0px #ffb01a;
    height: 33px;
    width: 33px;
    margin-top: -14.1px;
  }
  


/*/////////////////Query media ///////////////////*/

@media(min-width: 374px){
    .programOutput {
        --prOutput-width: 320px;
        --prOutput-width: 320px;
    }
    .alert {
        --alert-width: 300px;
        --alert-height: 200px;
    }

    input[type=range] {
        width: 160px;
    }

}

@media (min-width: 500px) {
    .programOutput {
        --prOutput-width: 350px;
        --prOutput-width: 350px;
    }
    .binaryRep {
        width: 500px;
    }
    
}

@media(min-width: 700px){
    .help img {
        height: 50%;
        width: 50%;
    }
    form {
        order: 0;
        height: 20%;
        -webkit-box-pack: start;
            -ms-flex-pack: start;
                justify-content: space-between;
        padding: 20px 10px;
        
    }
    .programOutput {
        --prOutput-width: 450px;
        --prOutput-width: 450px;
        -webkit-box-ordinal-group: 2;
        -ms-flex-order: 1;
            order: 2;
        margin-bottom: 40px;
        margin-top: 0px;
    }

    .controlPanel {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
            -ms-flex-direction: row;
                flex-direction: row;
    }

    .rule, .steps {
        margin-bottom: 0;
    }
   
    input[type=range]:active::-webkit-slider-thumb {
        -webkit-box-shadow: 0px 0px 13px #ffa700, 0px 0px 0px #ffb01a;
                box-shadow: 0px 0px 13px #ffa700, 0px 0px 0px #ffb01a;
        height: 33px;
        width: 33px;
        margin-top: -14.1px;
      }

      button:active {
        -webkit-transform: scale(1.2);
            -ms-transform: scale(1.2);
                transform: scale(1.2)
    }

        .buttonSubmit {
            -webkit-box-ordinal-group: 1;
                -ms-flex-order: 0;
                    order: 1;
        }
        .binaryRepItem, .binaryRep {
            padding: 0;
        }
    
}

  

 
@media(min-width: 1200px){
    form {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
            -ms-flex-direction: row;
                flex-direction: row;
        height: 10%;
        -webkit-box-align: center;
            -ms-flex-align: center;
                align-items: center;
        -webkit-box-pack: start;
            -ms-flex-pack: start;
                justify-content: start;
    }

    .questionMark {
        top: 11%;
    }
    .programOutput {
        --prOutput-width: 500px;
        --prOutput-width: 500px;
    }
}