@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800');
@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

:root{
    --color-green: rgb(0 166 62);
    --color-red: rgb(208 0 2);
    --color-yellow: rgb(223 158 0);
    
    --color-right: rgb(0 166 62);
    --color-wrong: rgb(40 40 40);
    --color-misplaced: rgb(223 158 0);

    --body-bg : #0d0d0d;
    --bg-dim: rgba(0,0,0,0.2);
    --bg-blur: 1.5px;

    --vgap: 10px;
    
    --restart-duration : 0.4s;

}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    
}

body {
    background-color: var(--body-bg) ;
    color: #e3e3e3;
    letter-spacing: 0.5px;
    font-family: "Open Sans" ; 
}

.title-bar{
    display: grid;
    grid-template-columns: 1fr auto 1fr ;
    align-items: center;
    justify-items: center;
    width: 100vw;
    max-width: 600px;
    margin: auto;
    user-select: none;
    padding: var(--vgap) 0 ;

    position: relative;
    z-index: 99;
    background-color: var(--body-bg);
}

.btn-new-game,.btn-guide{
    cursor: pointer;
    /* Ensure i's above message overlay so restart button is clickable at game end */
    z-index: 99; 
}

.btn-guide> svg, .btn-new-game > svg{
    height: auto;
    width: 35px;
}
.btn-new-game > svg{
    transform:scaleX(-1) rotate(350deg);
    transition: rotate var(--restart-duration) ease-in-out;
}

.btn-new-game.rotate{
    transform:scaleX(-1) rotate(350deg);
    animation: rotate var(--restart-duration) forwards;
}

.title {
    grid-column:2;
    justify-self: center;
    display: flex;
    justify-content: center;
    gap: 2px;
    width: fit-content;
    font-family:  "roboto" ;
    font-weight: 600;
    font-size: 3rem;
    color: #ffffff;
    text-transform: uppercase;
    text-shadow: -4px 0px 0 #064709 , -4px 4px 0 #064709, 0px 4px 0 #064709;
}

.title>.wrong{
    color: var(--color-red);
    text-shadow: -4px 0px 0 #470606 , -4px 4px 0 #470606, 0px 4px 0 #470606;
}

.title>.right{
    color: var(--color-right);
    text-shadow: -4px 0px 0 #064709 , -4px 4px 0 #064709, 0px 4px 0 #064709;
}

.title>.misplaced{
    color: var(--color-misplaced);
    text-shadow: -4px 0px 0 #473406 , -4px 4px 0 #473406, 0px 4px 0 #473406;
}

.game {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: auto;
    user-select: none;
    padding: var(--vgap) 0;
    max-height: 55vh;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.guess-row {
    display: flex;
    justify-content: center;
    margin: 5px 0;
    width: fit-content;
}

.letter-box {
    --box-dim: 50px;
    width: var(--box-dim);
    height: var(--box-dim);
    margin: 5px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: bold;
    border: 1.5px solid #666;
    border-radius: 4px;
    text-transform: uppercase;
    cursor: pointer;
}
.letter-box{
    transition: all var(--restart-duaration) ease-in-out;
    box-shadow: 0 0 10px rgba(137, 193, 88, 0.05);
}

.running>.letter-box{
    border: 1px solid rgb(255, 255, 255);
}

.letter-box.right{
    background-color: var(--color-right);
    border: 0;
    
}
.letter-box.misplaced{
    background-color: var(--color-misplaced);
    border: 0;
}

.letter-box.wrong{
    border: 0;
    background-color: var(--color-red);

}

.letter-box.finished{
    animation: flip 0.5s ease-in-out forwards;
}

.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.shake-attention{
    animation: shake_attention 1.5s cubic-bezier(.3,0.8,0.4,-1.5) infinite
}

@media (max-width: 410px) {
    .letter-box{
        --box-dim : 40px;
        font-size: 1em;
    }
}