* {
    touch-action: manipulation;
}

html {
    font-size: 35px;
    font-family: Helvetica, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;

    user-select: none;
}

header {
    font-size: 1.5rem;
    font-family: 'karnakpro-condensed', serif;
    letter-spacing: 0.02rem;
    transform: scale(1, 0.8);
    width: 100%;
    text-align: center;
    margin-top: 0;
    border-bottom: solid #d2d8db;
}

header span {
    font-size: .7rem;
    font-family: 'Homemade Apple', Helvetica, sans-serif;
    letter-spacing: 0.01rem;
    display: inline-block;
    position: relative;
    top: -14px;
    transform: scale(1, 1.25) rotate(-10deg);
}

.main {
    display: flex;
    width: 30rem;
    max-width: calc(100vw - 20px);
    justify-content: center;
    align-items: center;
    gap: 10%;
    padding-top: 10px;
}

.inputs {
    padding: 0 50px;

    position: relative;
}

.section1 {
    margin-bottom: 10px;
    letter-spacing: 0.001rem;
}

.step-section {
    display: flex;
}

h1 {
    font-family: 'Caveat Brush', cursive;
    font-size: .7rem;
    margin: 10px 0 3px 0;
}

i {
    align-self: center;
    margin-top: .3rem;
    margin-left: 15px;
    font-size: .6rem;
}

.section2 i, 
.results i {
    align-self: flex-start;
    margin-top: .45rem;
    margin-left: 10px;
}

i #sec1-info,
i #sec2-info,
i #sec3-info {
    display: none;
    padding: 10px;
    width: 150px;
    background-color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
    font-family: Helvetica, sans-serif;
    font-size: .35rem;
    text-align: center;
    z-index: 1;

    position: absolute;
}

.step-section>i:hover, 
.results i:hover {
    cursor: help;
}

i:hover #sec1-info,
i:hover #sec2-info,
i:hover #sec3-info {
    display: block;
}

.count-section {
    display: flex;
    align-items: center;
}

.guessCount {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 1rem;
    height: 1rem;
    font-size: .7rem;
    font-weight: 700;
    margin: 0 5px;
}

.guessCount:hover {
    cursor: pointer;
}

.countPicked {
    background-color: darksalmon;
    color: white;
    border-radius: 50%;
}

#colorbtn-img {
    display: inline-block;
    height: .3rem;
    vertical-align: middle;
}


.guess-section {
    display: flex;
    flex-direction: column;
}

.guess {
    display: flex;
    gap: 8px;

    margin-bottom: 0.2rem;
}

.letter {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.letter>.input {
    width: 1.5rem;
    height: 0.9rem;
    border-radius: 0;

    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    padding: 8px 0 6px 0;

    border: 1px solid #d2d8db;
}

.color-select {
    background-color: gainsboro;
    color: black;
    border: 1px solid gainsboro;
    cursor: pointer;
    width: calc(1.5rem + 2px);

    height: .6rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.input.green {
    background-color: #6baa64;
    border-color: #6baa64;
    color: white;
}

.input.yellow {
    background-color: #c8b458;
    border-color: #c8b458;
    color: white;
}

.input.gray {
    background-color: #787c7e;
    border-color: #787c7e;
    color: white;
}

.letter>.currentBox {
    border: 2px solid black;
}

.round {
    font-size: .5rem;
}

.round1 {
    color: #6baa64;
}

.round2 {
    color: #c8b458;
}

.round3 {
    color: #787c7e;
}

.disabled {
    opacity: 0.3;
}

#generate {
    border: none;
    padding: 5px 10px 2px 10px;
    font-weight: 700;
    font-size: 0.4rem;
    border-radius: 3px;
    box-shadow: 0px 1px 0px 0px rgba(9, 30, 66, .25);
    background-color: darksalmon;
}

#generate:hover {
    cursor: pointer;
    transform: scale(1.05);
}

.results {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#displayList {
    width: 8rem;
    height: 65vh;
    background-color: rgba(220, 220, 220, 0.543);
    text-transform: uppercase;
    overflow-y: scroll;
    text-align: center;
}

.results h1 {
    position: relative;
}

.up {
    display: none;
}

#errorMsg {
    color: white;
    font-size: .6rem;
    font-weight: 700;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: indianred;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 1;

    opacity: 0;
    visibility: hidden;
    transition: visibility 0s ease-in-out 300ms, opacity 300ms;
}

#errorMsg.show {
    opacity: .8;
    visibility: visible;
    transition: visibility 0s ease-in-out 0s, opacity 300ms;
}

::-webkit-scrollbar {
    -webkit-appearance: none;
    width: 7px;
    height: 0;
}

::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background-color: rgba(0, 0, 0, .5);
    box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

li {
    list-style: none;
    font-size: 0.5rem;
    line-height: 1rem;
}

li:nth-child(even) {
    background-color: white;
}

li:hover{
    cursor: pointer;
    color: darksalmon;
    font-weight: 700;
}

.keyboard {
    display: flex;
    font-size: 0.6rem;
    font-weight: 700;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.hide {
    display: none;
}

.kb-row {
    display: flex;
    gap: 5px;
    margin: 3px 0;
}

.key {
    width: 1.1rem;
    height: 1.5rem;
    background-color: #d2d8db;
    border-radius: 3px;

    display: flex;
    justify-content: center;
    align-items: center;
}

#key-ent,
#key-back {
    font-size: .6em;
    width: fit-content;
    padding: 0 5px;
}

#key-ent {
    background-color: darksalmon;
    font-size: .9em;
}

#key-back i {
    margin: 0 5px;
}

.instructions{
    background-color: rgba(220, 220, 220, 0.724);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

.popup{
    font-size: min(0.5rem, 3vmin);
    font-weight: 700;
    width: 500px;
    max-width: 80vw;
    height: max-content;
    max-height: 70vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    background-color: white;
    border-radius: 10px;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;

    padding: min(5%, 20vmin);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h2{
    margin: 0;
    font-family: 'Homemade Apple', Helvetica, sans-serif;
}

.exit{
    color: gray;
    position: absolute;
    top: 10px;
    right: 15px;
}

.exit:hover, .up:hover{
    cursor: pointer;
}

.popup>img{
    width: min(60%, 45vmin);
    height: auto;
    box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
    border-radius: 3px;
}

.submit-int{
    background-color: darksalmon;
    display: inline-block;
    color: black;
    padding: 5px 10px;
    border-radius: 2px;
}

@media (max-width:980px) {
    html {
        font-size: 28px;
    }

    h1 {
        margin-top: 0;
        line-height: 1.2rem;
    }

    i {
        margin-top: 0;
    }

    .section2 i {
        margin-top: .3rem;
    }

    .round {
        font-size: .3rem;
    }
}

@media (orientation:portrait) {
    .main {
        flex-direction: column;
        align-items: center;
    }

    .inputs {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .section1 {
        align-self: flex-start;
    }

    .results {
        margin-top: 50px;
        height: 100vh;
    }

    .up {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
        font-size: .6rem;
        color: #787c7e;
        box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 1px 3px 1px;
    }
}

@media (hover:hover) {
    .color-select:hover {
        background-color: white;
        border-color: white;
    }

    .disabled .color-select:hover {
        cursor: auto;
        background-color: gainsboro;
        border-color: gainsboro;
    }

}

@media (hover:none) {

    i:active #sec1-info,
    i:active #sec2-info, 
    i:active #sec3-info {
        display: block;
    }
}