:root {
    --altoHeader: 5em;
    --altoFooter: 4.5em;
}
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
}
h1,h2,h3,p {margin: 0;}

table {
    border-collapse: collapse;
}
footer {
    padding-top: 15px;
    margin: auto;
    background-color: #459650;
    text-align: center;
    height: var(--altoFooter);
    color: white;

    a {
        text-decoration: aquamarine wavy underline;
        color: aquamarine;
        transition: 0.3s;
    }
    a:hover {
        color: blue;
        mix-blend-mode: multiply;
        text-decoration: none;
    }
    p {line-height: 30px; display: inline-block;}
    span {margin-right: 15px;}
    img {
        display: inline-block;
        height: 25px;
        translate: 0 25%;
        transition: all .3s ease-in-out;
    }
    span img:hover {transform: scale(1.15);}
    span > a {text-decoration: none;}
}
#contenedorSopa {
    min-width: clamp(400px, 50%, 50%);
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    justify-content: space-evenly;
}

#contenedorSopa > div.botones > button {
    background: white;
    border: 4px solid #4e9645;
    border-radius: 6px;
    cursor: pointer;

    width: max-content;
    padding: 8px 25px;
    font-size: 1rem;
    transition: all .5s ease;
}
#contenedorSopa > div.botones > button:hover {
    background: hsl(113, 37%, 90%);
    border: 4px solid hsl(113, 37%, 40%);
}

#sopaLetras{
    --tamañoLetras: 1.25rem;
    --expoSeparacion: 1.25;

    display: var(--flex);
    position: relative;
    text-align: center;
    line-height: var(--tamañoLetras);
    user-select: none;
    align-items: center;
    td {
        font-size: var(--tamañoLetras);
        height: calc(var(--tamañoLetras) * var(--expoSeparacion));
        width: calc(var(--tamañoLetras) * var(--expoSeparacion));
        padding: 0;
    }
    table {
        display: inline-block;
        margin: 15px;
        margin-bottom: 75px;
        margin-bottom: clamp(10px, 40px, 40px);
    }
}

header {height: var(--altoHeader); background: #4e9645;}
footer {height: var(--altoFooter); background: #459650;}
main {
    min-height: calc(100vh - var(--altoHeader) - var(--altoFooter));
    justify-content: space-evenly;
    height: calc(100vh - var(--altoHeader) - var(--altoFooter));
}
head,footer,main {display: flex;}
header,footer {
    position: relative;
    color: white;
    text-align: center;
    padding: 5px 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
    align-content: center;
}

#seleccionado {
    background: red;
}

#checkInternet {
    position: relative;
    bottom: -5px;
    left: 0; right: 0;
    width: 100vw;
    font-weight: bold;
    text-align: center;
    color: white;
    background: red;
    padding: 0;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.5s ease, opacity 0.5s ease;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Cuando tenga contenido */
#checkInternet:not(:empty) {
    display: block;
    padding: 5px 0;
    opacity: 1;
    transform: translateY(0);
    background: linear-gradient(to bottom, rgba(255,0,0,0.8), red);
}

#puntuaciones {
    display: block;
    overflow-y: auto;
    max-height: 100%; /* nunca más que main */
    align-self: stretch;
    width: 433px;
    padding: 10px;
    padding-top: 0;
    padding-bottom: 40px;
    max-height: 100%;
    background: linear-gradient(00deg,hsl(128, 37%, 37%) 0%, rgba(69, 150, 80, 1) 3.5%,  hsl(113, 37%, 43%) 100%);
}

#puntuaciones table {
    width: 100%;

    & thead {
        position: sticky;
        top: 0;
        background-color: hsl(113, 37%, 43%);
        & td,th { padding-top: 10px; }
    }
    & tbody {overflow-y: auto; overflow-x: none;}

    td,th { border-bottom: 1px solid black; }
    & td { padding: 4px 0; text-align: center; font-size: 0.9rem; }

    & thead tr { height: 1.6rem; font-size: 1.1rem; }
    & tr {width: 100%; height: 1.25rem;}
    & tr>th:nth-child(1) { width: 10%; }
    /* & tr>th:nth-child(2) { width: 50%; } */
    & tr>th:nth-child(3) { width: 36%; }

    & tr:last-child > td {border-bottom: none;}
}

#palabras {
    display: var(--grid);
    opacity: 0;
    width: 100%;
}
#palabras > div {
    display: var(--grid);
    grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
    gap: 5px;
    justify-content: center;
    justify-items: center;
    margin: 15px auto 0 auto;
    line-height: 1.4rem;
    width: 100%;
}
#palabras > div > p {width: min-content;}
#palabras > div > .encontrada {
    color: gray;
    opacity: .25;
    text-decoration: line-through;
    font-weight: lighter;
}

/* Keyframes para desaparecer botón */
@keyframes fadeOutBtn {
    0%   { opacity: 1;}
    100% { opacity: 0; display: none; }
}

/* Keyframes para aparecer divs */
@keyframes fadeInDivs {
    0%   { opacity: 0; display: var(--display); }
    100% { opacity: 1; display: var(--display); }
}
.antesAnimacion {
    --flex: none;
    --grid: none;
    --block: none;
}
.despuesAnimacion {
    --flex: flex;
    --grid: grid;
    --block: block;
}

.fade-out { animation: fadeOutBtn 0.75s forwards; }
div.fade-in { animation: fadeInDivs 1s forwards; }

#temporizador {
    position: absolute;
    top: -15px;
    left: 50%;
}

#fondoPrompt {
    display: var(--block);
    size: 0;
    position: fixed;
    top: 0; left: 0;
    height: 100vh; width: 100vw;
    background: rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

#cuerpoPrompt {
    position: absolute;
    padding: 20px;
    border: 6px solid #4e9645;
    border-radius: 10px;
    min-height: 10vh;
    min-width: 10vw; max-width: 700px;
    background: rgb(255, 255, 255);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 5px 5px 15px 3px #000000;
    overflow-wrap: break-word;
    word-break: break-word;
}

#cuerpoPrompt h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: #2f5e2a;
    text-align: center;
}

#datoPrompt {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 15px;
    font-size: 1rem;
    border: 2px solid #4e9645;
    border-radius: 5px;
    outline: none;
}

#datoPrompt:focus {
    border-color: #2f5e2a;
}
#datoPrompt.error {
    border: 2px solid red;
    background-color: #ffe6e6;
}

#cuerpoPrompt button {
    width: 100%;
    padding: 8px;
    font-size: 1rem;
    background: #4e9645;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#cuerpoPrompt button:hover {
    background: #3c7435;
}

