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

:root {
    /* Fondo */
    --background: #ffffff;
    --text: #121213;

    /* Bordes */
    --border: #d3d6da;
    --border-filled: #878a8c;

    /* Estados Wordle */
    --correct: #6aaa64;   /* verde */
    --present: #c9b458;   /* amarillo */
    --absent: #787c7e;    /* gris */

    /* Botones */
    --button: #3aaa35;
    --button-hover: #2f922c;
}

[data-theme="dark"] {

    /* Fondo */
    --background: #121213;
    --text: #ffffff;

    /* Bordes */
    --border: #3a3a3c;
    --border-filled: #565758;

    /* Estados Wordle */
    --correct: #538d4e;
    --present: #b59f3b;
    --absent: #3a3a3c;

    /* Botones */
    --button: #538d4e;
    --button-hover: #467842;
}

body{
    min-height: 100dvh;
    font-family: "Libre Franklin", sans-serif;
    background-color: var(--background);
    color: var(--text);
    transition: ease .4s;
}

button, select{
    font-family: "Libre Franklin", sans-serif;
}

nav{
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 16px;
    gap: 24px;
    border-bottom: 2px solid var(--border-filled);

    & div{
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 16px;

        &:nth-of-type(2){
            justify-content: flex-start;
        }

        & i{
            cursor: pointer;
            font-size: 24px;
        }
    }
}

.title{
    text-align: center;
    font-size: 52px;
}

.game{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
    margin-top: 48px;
    animation: opacity ease-out .4s forwards;
}

.difficulty{
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    gap: 8px;
    margin-bottom: 24px;

    & select{
        padding: 4px 8px;
        border-radius: 4px;
    }
}

.board{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.try{
    display: flex;
    gap: 16px;

    & input{
        width: 40px;
        box-shadow: 0 0 0 2px var(--border);
        border: none;
        border-radius: 8px;
        text-align: center;
        pointer-events: none;
        user-select: none;
        font-size: 36px;
        caret-color: transparent;

        &:focus{
            outline: 3px solid var(--button);
        }
    }
}

.currentTry{
    
    & input{
        pointer-events: all;
        user-select: all;
    }
}

.guess-btn{
    width: 100%;
    border: none;
    padding-block: 6px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    margin-top: 16px;
    color: white;
    background-color: var(--button);
    cursor: pointer;
    transition: ease-out .2s;

    &:hover{
        background-color: var(--button-hover);
    }
}

.correct{
    box-shadow: 0 0 0 2px var(--correct) !important;
    color: var(--text);
    background-color: var(--correct);
}

.missplaced{
    box-shadow: 0 0 0 2px var(--present) !important;
    color: var(--text);
    background-color: var(--present);
}

.incorrect{
    box-shadow: 0 0 0 2px var(--absent) !important;
    color: var(--text);
    background-color: var(--absent);
}

.black-background{
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.447);
    animation: opacity ease-out .3s forwards;
}

.modal{
    width: 100%;
    max-width: 400px;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 16px 32px;
    border-radius: 12px;
    margin-inline: 16px;
    opacity: 0;
    background-color: var(--background);
    animation: show ease-out .4s forwards .3s;

    & button{
        padding: 8px 16px;
        margin-top: 24px;
        border-radius: 8px;
        font-size: 18px;
        cursor: pointer;
        border: none;
        color: white;
        background-color: var(--button);
        transition: ease-out .2s;

        &:hover{
            background-color: var(--button-hover);
        }
    }
}

.modal-subt{
    margin-top: 8px;
    text-align: center;
}

.statusHistory{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 100%;
    max-width: 150px;
    gap: 8px;
    margin-top: 12px;

    & span{
        aspect-ratio: 1/1;
        border-radius: 4px;
    }
}

@media (width < 500px){
    .title{
        font-size: 34px;
    }
}

@keyframes opacity {
    from{
        opacity: 0;
    }

    to{
        opacity: 1;
    }
}

@keyframes show {
    from{
        opacity: 0;
        transform: translateY(100px);
    }

    to{
        opacity: 1;
        transform: translateY(0);
    }
}