.juego_container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
}



.level-buttons button {
    padding: 10px 20px;
    margin: 5px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.level-buttons button:hover {
    background-color: #0056b3;
}

.modal-content {
    background-color: white;
    padding: 10px;
    width: 100%;
    border: 1px solid #888;
    display: flex;
    flex-direction: column;
    z-index: 1;
    border-radius: 10px;
    margin: auto;
}
.content-endgame{
    position: relative;
    text-align: right;
}
.content-endgame .close{
    font-weight: normal;
    font-size: 18px;
    position: initial;
    display: inline-block;
    margin-bottom: 2px;
}

.close {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    width: 30px;
    line-height: 20px;
    height: 30px;
    background-color: #f4f4f9;
    border-radius: 5px;
    border: 1px solid #ddd;
    text-align: center;
}
#modal_final .close{
    background-color: transparent;
    border: none;
}

.close:hover,
.close:focus {
    color: red;
    cursor: pointer;
    text-decoration: none;
}


.info {
    display: flex;
    margin-bottom: 10px;
    padding: 5px;
    background-color: #f4f4f9;
    border-radius: 5px;
    border: 1px solid #ddd;
}



.hidden {
    display: none;
}

.visible {
    display: flex;
}

.infoElements{
    width: 30%;
    margin: 5px;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-wrap: wrap;
}
.infoButtons{
    width: 70%;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex-wrap: wrap;
}

#puntos {
    font-size: 1.0rem;
    margin-right: auto;
    margin-left: 10px;
    
}

.cuerpo_container {
    display: flex;
    justify-content: start;
    align-items: start;
}


.definiciones_container {
    display: flex;
    flex-direction: column;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    overflow-y: auto;
    
}

.definiciones {
    margin-top: 5px;
    font-size: 0.7rem;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}
.definiciones div {
    margin-top: 5px;
    font-size: 0.7rem;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}


.definiciones div.tachado {
    text-decoration: line-through;
    color: gray;
}

.palabras {
    text-align: center;
    margin-bottom: 5px;
    font-weight: 600;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}



.sopa-container {
    display: grid;
    margin: 25px 10px 10px 10px;
    gap: 0px;
}


.sopa-container div {
    transition: background-color 0.3s; 
}

.sopa-container div:hover {
    background-color: #b0bec5; 
}




.sopa-letra {
    
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.sopa-letra-span {
    transition: background-color 0.2s ease;
    user-select: none;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
}

.sopa-letra.seleccionada {
    background-color: rgba(226, 194, 112, 0.3);
}

.sopa-letra.found {
    background-color: rgba(226, 194, 112);
}

.sopa-letra.rounded-left {
    border-top-left-radius: 50%;
    border-bottom-left-radius: 50%;
}

.sopa-letra.rounded-right {
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
}

.sopa-letra.rounded-top {
    border-top-left-radius: 50%;
    border-top-right-radius: 50%;
}

.sopa-letra.rounded-bottom {
    border-bottom-left-radius: 50%;
    border-bottom-right-radius: 50%;
}

/* Reset total (todos los bordes redondeados coinciden) */
.sopa-letra.rounded-left.rounded-right.rounded-top.rounded-bottom {
    border-top-left-radius: 0%;
    border-top-right-radius: 0%;
    border-bottom-left-radius: 0%;
    border-bottom-right-radius: 0%;
}

/* Combinaciones de dos bordes */

/* Izquierdo y derecho */
.sopa-letra.rounded-left.rounded-right {
    border-top-left-radius: 0%;
    border-bottom-left-radius: 0%;
    border-top-right-radius: 0%;
    border-bottom-right-radius: 0%;
}

/* Izquierdo y superior */
.sopa-letra.rounded-left.rounded-top {
    border-top-left-radius: 50%;
    border-bottom-left-radius: 0%;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Izquierdo y inferior */
.sopa-letra.rounded-left.rounded-bottom {
    border-top-left-radius: 0%;
    border-bottom-left-radius: 50%;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Derecho y superior */
.sopa-letra.rounded-right.rounded-top {
    border-top-right-radius: 50%;
    border-bottom-right-radius: 0%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Derecho y inferior */
.sopa-letra.rounded-right.rounded-bottom {
    border-top-right-radius: 0%;
    border-bottom-right-radius: 50%;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Superior e inferior */
.sopa-letra.rounded-top.rounded-bottom {
    border-top-left-radius: 0%;
    border-top-right-radius: 0%;
    border-bottom-left-radius: 0%;
    border-bottom-right-radius: 0%;
}

/* Combinaciones de tres bordes */

/* Izquierdo, derecho y superior */
.sopa-letra.rounded-left.rounded-right.rounded-top {
    border-top-left-radius: 0%;
    border-top-right-radius: 0%;
    border-bottom-left-radius: 0%;
    border-bottom-right-radius: 0;
}

/* Izquierdo, derecho y inferior */
.sopa-letra.rounded-left.rounded-right.rounded-bottom {
    border-top-left-radius: 0%;
    border-bottom-left-radius: 0%;
    border-top-right-radius: 0%;
    border-bottom-right-radius: 0%;
}

/* Izquierdo, superior y inferior */
.sopa-letra.rounded-left.rounded-top.rounded-bottom {
    border-top-left-radius: 0%;
    border-bottom-left-radius: 0%;
    border-top-right-radius: 0%;
    border-bottom-right-radius: 0%;
}

/* Derecho, superior y inferior */
.sopa-letra.rounded-right.rounded-top.rounded-bottom {
    border-top-right-radius: 0%;
    border-bottom-right-radius: 0%;
    border-top-left-radius: 0%;
    border-bottom-left-radius: 0%;
}





#modal_final {
    z-index: 10;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    width: 50%;
    max-width: 500px;
    height: 50%;
    max-height: 300px;   
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 10px;
    display: none;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

#bg_modal_final{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #00000080;
    display: none;
    z-index: 2;
}

#modal_final.visible {
    visibility: visible;
    
}

#modal_final h3 {
    margin-bottom: 20px;
}


#modal_final .close:hover {
    color: red;
    cursor: pointer;
}

#sopa{
    align-items: center;
}

#temporizador {
    margin-bottom: 15px;
}


@media (max-width: 768px) {
    #temporizador {
        margin-bottom: 4px;
    }

    .cuerpo_container {
        flex-direction: column;
        justify-content: start;
        align-items: center;
    }

    .definiciones{
        margin: 0%;

    }
    .close{          
        padding: 0px; 
        width: auto; 
        line-height: auto; 
        height: auto;         
    }
    .content-endgame .close{
        padding: 5px;
    }
    .definiciones div{
        display: inline-flex;
        margin: 5px;
    }
    .definiciones_container {
        flex-direction: row;
        flex-wrap: wrap;
        max-height: 100px;
        overflow-y: scroll;
       width: 100%;
    }
    .info {
        flex-wrap: wrap;
        margin-bottom: 10px;
        padding: 5px;
        background-color: #f4f4f9;
        border-radius: 5px;
        border: 1px solid #ddd;
    }
    .infoElements{
        width: 100%;
    }
    .infoButtons{
        width: 100%;
    }
  
    .sopa-letra-span {
        font-size: 0.85rem;
        padding: 0px;
    }
    #sopa{
        align-items: unset;
        user-select: none;
    }
    .palabras {
        margin-bottom: 0px;
        padding: 0px;
        font-size: 0.75rem;
    }
    
    #modal_final {
        width: 80%;
    }

    .sopa-container {
        margin: 25px 0px 0px 0px;
    }

    #contenedor-juego{
        padding: 5px;
    }
}