/* Main layout */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    display: flex;
    gap: 1em;
    flex-direction: column;
    font-family: "Ubuntu", sans-serif;
    font-weight: 400;
    font-style: normal;
    background: #f5f7f8;
    justify-content: center;
}

header {
    background: #8bc927;
    color: #45474b;
    flex: 0 1 auto;
    text-align: center;
}

main {
    display: flex;
    flex: auto;
    align-self: center;
    justify-content: center;
    align-items: center;
}

footer {
    flex: 0 1 auto;
    text-align: center;
    background: #333;
    color: #aaa;
    justify-items: center;
    align-items: center;
}

/* Game menu */
.menu {
    display: flex;
    padding: 0.5em 2em;
    justify-content: center;
    align-items: center;
    gap: 1em;
    background: #495e57;
    color: #f5f7f8;
}

.menu img {
    cursor: pointer;
    opacity: 0.4;
}

.menu img:hover {
    opacity: 0.7;
}

.menu img.enabled {
    opacity: 1;
}

.menu a {
    color: #f5f7f8;
    text-decoration: none;
}

.score {
    display: flex;
    justify-content: center;
    padding: 0.5em;
}

.score-item {
    font-family: monospace;
    font-size: 1.3em;
    font-weight: bold;
    color: #ddd;
    margin: 0.25em 1em;
    padding: 0.3em 0.6em;
    display: inline-block;
    border-radius: 5px;
    border: 1px solid #aaa;
}

/* Card Grid */

.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    justify-content: center;
    grid-gap: 20px;
    width: 100%;
    height: 100%;
}

.card {
    perspective: 1000px;
    min-width: 50px;
    min-height: calc(50px * 1.5);
    aspect-ratio: 100 / 150;
    transition: transform 0.3s;
    user-select: none;
}

.card--closed .card-back:hover {
    border-color: #c29f05;
    box-shadow: 0 4px 8px #fff2ba;
    transform: translateY(-5px);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform .6s;
}

.card--open .card-inner,
.card--found .card-inner {
    transform: rotateY(180deg);
}

.card .card-front,
.card .card-back {
    position: absolute;

    background: #aaa;
    border-radius: 13px;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px,
        rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
    border: 2px solid black;
    overflow: hidden;
    transition: transform 0.6s;

    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    justify-content: center;
    align-items: center;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.card-back img {
    width: 300%;
    height: 300%;
}

.card .card-front {
    transform: rotateY(180deg);
    /* Asegúrate de que la parte frontal esté rotada a 0 grados */
}

.card .card-back {
    transform: rotateY(0deg);
    /* La parte trasera debe estar rotada a 180 grados */
}

.card--open .card-front,
.card--found .card-front {
    transform: rotateY(180deg);
}

.start-game {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
    margin: 1em;
}

.styled-button {
    background-color: #4CAF50;
    /* Green */
    border: none;
    color: white;
    padding: 1em;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 32px;
    align-self: center;
    cursor: pointer;
    border-radius: 5px;
    /* Rounded corners */
    transition: background-color 0.3s ease;
    /* Smooth transition for hover effect */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    /* Add a subtle shadow */
}

.styled-button:hover {
    background-color: #45a049;
    /* Darker green on hover */
    box-shadow: 3px 3px 8px rgba(0, 0, 0, 0.3);
    /* Slightly larger shadow on hover */
}

.styled-button:active {
    background-color: #3e8e41;
    /* Even darker green when clicked */
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
    /* Smaller shadow when clicked */
    transform: translateY(1px);
    /* Move slightly down when clicked */
}


/* won screen */
.pantalla-felicitaciones {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    user-select: none;
}

.contenedor-mensaje {
    background-color: #f8f8f8;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    user-select: none;
}

.mensaje-principal {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
}

.imagen-animal {
    width: 200px;
    height: 200px;
    margin-bottom: 20px;
}

.mensaje-secundario {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.boton-volver-a-jugar {
    background-color: #4CAF50;
    /* Color verde para el botón */
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease;
    /* Transición suave para el color */
}

.boton-volver-a-jugar:hover {
    background-color: #45A049;
    /* Color verde más oscuro al pasar el mouse */
}


/* Utility classes */

.hidden {
    display: none;
}