body{
    background-color: rgb(18, 18, 18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    gap: 6px;
    padding: 10px;
    font-weight: bold;
}

#gameContainer{
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 300px; 
    font-size: 32px;
    margin: 10px;
}

#keyboard{
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    width: 484px;
    gap: 6px;
    height: 184px;
    font-size: 20px;
}

.keyboardRow{
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.keyboardBox{
    background-color: rgb(130, 131, 133);
    display: flex;
    justify-content: center;   
    align-items: center;
    width: 43px;
    height: 100%;
    border-radius: 5px;
    user-select: none; 
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none;
}

.keyboardBox.correctLetter{
    background-color: rgb(181, 159, 58);
}

.keyboardBox.correctSpot{
    background-color: rgb(82, 141, 77);
}

.keyboardBox.incorrectLetter{
    background-color: rgb(58, 58, 58);
}

.letterBox.correctLetter{
    --background-color: rgb(181, 159, 58);
    --border: 2px solid rgb(181, 159, 58);
    animation: flip 0.8s ease forwards;
}

.letterBox.correctSpot{
    --background-color: rgb(82, 141, 77);
    --border: 2px solid rgb(82, 141, 77);
    animation: flip 0.8s ease forwards;
}

.letterBox.incorrectLetter{
    --background-color: rgb(58, 58, 58);
    --border: 2px solid rgb(58, 58, 58);
    animation: flip 0.8s ease forwards;
}

.letterBox{
    border: 2px solid rgb(58, 58, 58);
    aspect-ratio: 1/1;
    display: flex;
    justify-content: center;   
    align-items: center;
    user-select: none; 
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none;
}

.candidate{
    animation: slam 0.1s ease-in-out forwards;
}

.specialKey{
    width: 64px;
    font-size: 12px;
}

.currentBox{
    border: 2px solid rgb(150, 150, 150) !important;
}

svg{
    width: 20px;
    height: 20px;
    fill: white;
    pointer-events: none;
}

@keyframes flip{
    0% {
        transform: rotateX(0deg);
        background-color: rgb(18, 18, 18);
        border: 2px solid rgb(88, 88, 88);
    }

    45%{
        transform: rotateX(90deg);
        background-color: rgb(18, 18, 18);
        border: 2px solid rgb(88, 88, 88);
    }

    55%{
        transform: rotateX(90deg);
        background-color: var(--background-color);
        border: 2px solid var(--border);
    }

    100%{
        transform: rotateX(0deg);
        background-color: var(--background-color);
        border: 2px solid var(--border);
    }

}

@keyframes slam{
    0%{
        transform: scale(1);
        border: 2px solid rgb(58, 58, 58);
    }

    50%{
        transform: scale(1.12);
        border: 2px solid rgb(88, 88, 88);
    }

    100%{
        transform: scale(1);
        border: 2px solid rgb(88, 88, 88);
    }
}

#gameContainer > :nth-child(5n + 2).filled{
    animation-delay: .3s;
}

#gameContainer > :nth-child(5n + 3).filled{
    animation-delay: .5s;
}

#gameContainer > :nth-child(5n + 4).filled{
    animation-delay: .7s;
}

#gameContainer > :nth-child(5n + 5).filled{
    animation-delay: .9s;
}

.errorBox{
    padding: 8px;
    font-size: 18px;
    background-color: white;
    color: black;
    border-radius: 5px; 
}

#errorList{
    position: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    top: 5%;
    z-index: 1000;
}

.overlay{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 98vw;
    height: 98vh;
    background-color: rgb(18, 18, 18);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
}

.overlay h1{
    margin: 24px;
    padding: 0 32px;
}

.overlay h2{
    margin: 24px;
}

#helpOverlay{
    overflow-y: auto;
    font-weight: normal;
    justify-content: flex-start;
}

#helpOverlay h1{
    font-size: 2.5em;
    margin-bottom: 20px;
}

#helpOverlay h2{
    font-size: 1.5em;
    margin-top: 20px;
    margin-bottom: 10px;
}

#helpOverlay li{
    text-align: left;
    margin: 0 10px 5px;
}

#helpOverlay ul{
    margin-top: 5px;
}

#helpOverlay p{
    font-size: 1.2rem;
    margin: 10px;
}

.exampleRow {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    align-items: center;
    gap: 3px;
} 

#helpOverlay .letterBox{
    width: 40px;
    height: 40px;
    font-weight: bold;
    font-size: 1.2rem;
}

#helpOverlay .letterBox.correctLetter {
    background-color: rgb(181, 159, 58) !important; 
    border: 2px solid rgb(181, 159, 58) !important;
}

#helpOverlay .letterBox.correctSpot {
    background-color: rgb(82, 141, 77) !important;
    border: 2px solid rgb(82, 141, 77) !important;
}

#helpOverlay .letterBox.incorrectLetter {
    background-color: rgb(58, 58, 58) !important;
    border: 2px solid rgb(58, 58, 58) !important;
}

#buttons{
    display: flex;
    padding: 18px;
    padding-top: 0px;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    gap: 24px;
    flex-wrap: wrap;
}

button{
    padding: 18px;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: 20px;
    border-radius: 55px;
    background-color: rgb(18, 18, 18);
    border: 2px solid rgb(58, 58, 58);
    color: white;
    z-index: 9999999;
}

#abstractView{
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 300px;
}

.abstractBox{
    background-color: white;
    aspect-ratio: 1/1;
}

#close{
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2100;
    fill: white;
    width: 40px;
    height: 40px;
    fill: white;
    pointer-events: auto;
}

#close * {
    fill: inherit;
}

#home{
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2100;
    fill: white;
    width: 40px;
    height: 40px;
    fill: white;
    pointer-events: auto;
}

#home * {
    fill: inherit;
}

button{
    pointer-events: auto;
}

@media (hover: hover) {
    #home:hover{
        fill: rgb(77, 141, 127);
        cursor: pointer;
    }
    button:hover{
        cursor: pointer;
        border-color: white;
    }

    #statsBtn:hover{
        background-color: rgb(181, 159, 58);
    }

    #shareBtn:hover{
        background-color: rgb(181, 159, 58);
    }
    
    #practiceBtn:hover{
        background-color: rgb(82, 141, 77);
    }

    #helpBtn:hover{
        background-color: rgb(82, 141, 77);
    }

    .keyboardBox:hover{
        cursor: pointer;
    }

    #close:hover{
        fill: rgb(181, 58, 58);
        cursor: pointer;
    }
}


.hidden{
    display: none;
}

#statsOverlay{
    justify-content: flex-start;
}

#graphContainer{
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    width: 400px;
    margin: 0 25px;
}

.row{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    flex-grow: 0;
    width: 100%;
}

.bar{
    background-color: rgb(82, 141, 77);
    color: white;
    height: 100%;
    padding: 2px;
    flex-grow: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
}

.label{
    color: white;
    text-align: center;
    font-weight: bold;
    font-size: 1.15rem;
}


#statsContainer{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    font-weight: normal;
    margin: 0 25px 25px 25px;
}

#statsContainer > div{
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    gap: 10px;
    width: 84px
}

.number{
    font-size: 3rem;
}

@media screen and (max-width: 768px) {
    #keyboard{
        width: 100vw;
    }
    .keyboardBox{
        width: 8vw;
    }
    .specialKey{
        width: 12vw;
    }
    #gameContainer{
        margin-top: 8vh;
    }
    .overlay h1{
        margin-top: 10vh;
    }

    .overlay{
        height: 100vh;
        overflow: auto;
    }

    #graphContainer{
        width: 280px;
    }
    #statsContainer{
        width: 280px;
    }
    .number{
        font-size: 2rem;
    }
    .label{
        font-size: 1rem;
    }
}
