body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

h1 {
    text-align: center;
    padding: 0.8em 2em;
    font-size: 2.1em;
    color: #027333;
}

#game-container {
    display: flex;
    justify-content: center;
    gap: 100px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: 0 0 0.8em 0 rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    padding: 2em;
    background-color: white;
}

#img-container,
#name-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.image-box,
.name-box {
    width: 100px;
    height: 100px;
    padding: 10px;
    margin: 5px;
    border: 1px solid #012340;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #C7D1F7;
}

.image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.name-box {
    font-size: 1em;
    font-weight: bold;
    background-color: #C7D1F7;
    text-transform: uppercase;
}

.image-box:hover,
.name-box:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-box.correct {
    border: 2px solid #04D939;
    background-color: #e6f3e6;
}

.matched-name {
    display: block;
    font-size: 1em;
    color: #027333;
    font-weight: bold;
    text-transform: uppercase;
}

.restart-btn {
    display: block;
    width: 250px;
    margin: 20px auto;
    padding: 15px;
    font-size: 1.2em;
    background-color: #04D939;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.restart-btn:hover {
    background-color: #027333;
}

.congrats-message {
    text-align: center;
    color: #027333;
    font-size: 2em;
    margin-top: 20px;
    font-weight: bold;
}

.image-box.selected,
.name-box.selected {
    border: 2px solid #012340;
    background-color: #e0e8f7;
}

.image-box.correct,
.name-box.correct {
    border: 2px solid #04D939;
    background-color: #e6f3e6;
    pointer-events: none;
    /* Evitar más interacciones con elementos ya emparejados */
}

@media (max-width: 768px) {

    #img-container,
    #name-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {

    #game-container {
        gap: 50px;
    }

    #img-container,
    #name-container {
        grid-template-columns: 1fr;
        justify-content: center;
        align-items: center;
    }

    #name-container {
        gap: 1px;
    }

    .image-box,
    .name-box {
        width: 80px;
        height: 80px;
    }

    .congrats-message {
        width: 100%;
        text-align: center;
    }

    .restart-btn {
        width: 100%;
        align-self: flex-start;
    }
}