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

/*Variables generales para tipogrfía, color de fuente, tamaño
de fuente y tamaño de fuente de botones*/
:root {
    --font-family: 'Segoe UI', sans-serif;
    --font-color: white;
    --font-size: 1em;
    --font-size-buttons: 1em;
}

html {
    font-family: var(--font-family);
    color: var(--font-color);
}

h1 {
    font-size: 4em;
}

p {
    font-size: var(--font-size);
    color: var(--font-color);
}

/*-------Inicio Botones Generales-------*/
/*Boton con fondo negro y gradiante al pasar el mouse*/
html
body
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 50px;
    font-size: var(--font-size-buttons);
    color: var(--font-color);
    text-decoration: none;
    background-color: black;
    border-radius: 2em;
    border-color: hsl(160, 70%, 58%);
    transition: all 0.4s ease-out;
    cursor: pointer;
}

.btn:hover {
    text-shadow: 1px 3px 4px rgba(0, 0, 0, 0.7);
    background: rgb(118,75,144);
    background: linear-gradient(90deg, rgba(118,75,144,1) 0%, rgba(66,139,92,1) 53%, rgba(68,94,148,1) 100%);
    box-shadow: 0.1em 0.1em 0.1em 0.1em rgba(255, 255, 255, 0.4);
}
/*-------Fin Botones Generales-------*/

/*Inicio Elementos Ocultos por JavaScript*/
html
body
.hide-header {
    display: none;
}

html
body
#container
.main-content {
    display: none;
}

.show-main-content
.mensaje-ganaste-hidden {
    display: none;
}

.show-main-content
.mensaje-perdiste-hidden {
    display: none;
}
/*Fin Elementos Ocultos por JavaScript*/

/*--------------Inicio Sección Bienvenida (header)--------------*/
html
body
.seccion-bienvenida {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    background-image:linear-gradient(
        rgba(0, 0, 0, 0.5),
        rgba(0, 0, 0, 0.5)), 
    url("../img/fondo.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.seccion-bienvenida
#instrucciones {
    padding: 1em;
    margin: 1em 2em;
    min-width: 45%;
    text-align: center;
}

.seccion-bienvenida
.div-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1em;
    min-width: 60%;
    width: 60%;
}

.div-box
.btn
.animation-code {
    display: flex;
    margin-left: 0.5em;
    font-size: var(--font-size);
    transition: all 0.3s ease-out;
}

.div-box
.btn:hover
.animation-code {
    transform: translate(4.5px);
}

.div-box
.input-texto[type="text"] {
    padding: 0.8em;
    border-radius: 0.4em;
    margin-bottom: 1em;
    max-width: 60%;
    width: 100%;
    height: 2.6em;
    font-size: 0.8em;
}

.div-box
.input-texto[type="text"]:focus {
    border-color: hsl(160, 70%, 58%);
    outline: 0 none;
}

.seccion-bienvenida
#contact {
    position: fixed;
    top: 1em;
    right: 1em;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-items: center;
    justify-content: center;
    padding: 0.2em;
    border-radius: 2em;
    background-color: hsl(160, 70%, 58%);
}

#contact
p {
    color: black;
}

#contact
.links-footer {
    transition: all 0.2s ease-out;
}

#contact
.links-footer:hover {
    transform: translate(0, 0.3em);
}

#contact
.iconos {
    margin: 0.2em;
    width: 30px;
}

@media only screen and (max-width: 926px) {
    .seccion-bienvenida
    #instrucciones {
        margin: 0.2em 0.6em;
    }

    .seccion-bienvenida
    .div-box {
        padding: 0.2em;
        min-width: 60%;
        width: 90%;
    }

    #contact
    .iconos {
        width: 25px;
    }
}
/*--------------Fin Sección Bienvenida (header)--------------*/

/*--------------Inicio Sección Juego (show-main-content)--------------*/
html
body
#container {
    margin: 0 auto;
    width: 100%;
    background-image:linear-gradient(
        rgba(0, 0, 0, 0.5),
        rgba(0, 0, 0, 0.5)), 
    url("../img/fondodos.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

#container
.show-main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
    padding: 1em;
    height: 100vh;
    margin: auto;
}

.show-main-content
.letra-ingresada[type="text"] {
    border: 0;
    margin-bottom: 0.5em;
    width: 100%;
    font-size: 2em;
    color: var(--font-color);
    text-align: center;
    background-color: transparent;
}

.show-main-content
.letra-ingresada[type="text"]:focus {
    outline: 0 none;
}

.show-main-content
#ahorcado {
    box-shadow: 0.5em 0.1em 0.5em 0.1em rgba(7, 7, 7, 0.712);
    max-width: 700px;
    width: 100%;
    max-height: 390px;
    height: 100%;
    background-color: inherit;
}

@media only screen and (max-width: 738px) {
    .show-main-content
    #ahorcado {
        height: 290px;
    }
}

@media only screen and (max-width: 428px) {
    
    html
    body
    #container
    .show-main-content {
        padding-top: 0;
    }

    .show-main-content
    #ahorcado {
        height: 190px;
    }
}

.show-main-content
.menu-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-top: 0.5em;
    width: 100%;
}

.show-main-content
.letras-erroneas {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.8em;
}

.show-main-content
.btn
.go-home-btn {
    width: 20px;
}

/*
Para ajustar los tamaños del grid sin
generar desbordamiento, ajustar las siguientes
propiedades de los selectores con un mismo valor:
.palabra -> padding
.mis-palabras -> font-size, y width

Para centrar los recuadros donde "n" es cualquier valor:
.palabras -> grid-template.columns: repeat(auto-fill, minmax(n, 1fr));
.palabras -> gap: n-1;
*/
.show-main-content
.palabras {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2em, 1fr));
    grid-template-rows: 1fr;
    gap: 1em;
    padding: 1.5em;
    width: 100%;
    list-style-type: none;
}

.show-main-content
.palabras
.mis-palabras {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6em;
    border-top: 0;
    border-right: 0;
    border-bottom: solid 0.1em rgb(255, 250, 250);
    border-left: 0;
    width: 1.5em;
    height: 2em;    
    font-size: 1.5em;
}

@media only screen and (max-width: 428px) {
    
    .show-main-content
    .palabras {
        grid-template-columns: repeat(auto-fill, minmax(1em, 1fr));
        grid-template-rows: 1fr;
        gap: 1em;
        padding: 1.2em;
    }

    .show-main-content
    .palabras
    .mis-palabras {
        padding: 0.2em;
        width: 1.2em;
        height: 1.3em;
        font-size: 1.2em;
    }
}

.show-main-content
.show-mensaje-ganaste {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image:linear-gradient(
        rgba(0, 0, 0, 0.5),
        rgba(0, 0, 0, 0.5)), 
    url("../img/gifs/you-win.gif");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top;
    background-attachment: fixed;
}

.show-mensaje-ganaste
p {
    margin: 0.5em;
    font-size: 3em;
    text-align: center;
}

.show-main-content
.show-mensaje-perdiste {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image:linear-gradient(
        rgba(0, 0, 0, 0.5),
        rgba(0, 0, 0, 0.5)), 
    url("../img/gifs/you-lost.gif");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: top;
    background-attachment: fixed;
}

.show-mensaje-perdiste
p {
    margin: 0.5em;
    font-size: 3em;
    text-align: center;
}

@media only screen and (max-width: 738px) {
    .show-main-content
    .show-mensaje-ganaste {
        justify-content: flex-start;
    }

    .show-main-content
    .show-mensaje-perdiste {
        justify-content: flex-start;
    }
}
/*--------------Fin Sección Juego (show-main-content)--------------*/