/* Estilos Base (Mobile First) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-claro: #fff7e7;
    --color-oscuro: #001f54;
    --color-yellow: #ffc224;
    --color-primary: #01bbbe;
    --color-secundary: #ffa188;
}
/* Estilos por defecto (Modo Claro) */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 100%;
    font-family: "VAG Rounded Next Regular", sans-serif;
    padding: 5px 10px;
    background-color: var(--color-claro);
}


/* Estilos cuando se activa el Modo Oscuro */
body.dark-mode {
    background-color: var(--color-oscuro);
    color: #e0e0e0;
}

/* Puedes adaptar las tarjetas o contenedores si es necesario */
body.dark-mode .tablero {
    background-color: #1e1e1e;
}


.header {
    width: 100%;
}

.contenedor {
    width: 90%;
    margin: 0 auto;
    overflow:;
    max-width: 1200px;
    padding: 20px 0 50px 0;
}

.valores {
    color: var(--color-oscuro);
    font-size: 1em;
    font-weight: 900;
}

/* Forzar a que los iconos de icofont tengan espacio y no se oculten */
.vidas-flotantes i, #vidas i {
    display: inline-block !important;
    font-style: normal !important;
}

.vidas-flotantes {
    position: absolute;
    top: 70px;
    right: 15px;
    background-color: #ffffff;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1.1rem;
    font-weight: bold;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Estilo por defecto para Móviles: 3 columnas y 2 filas (3 arriba, 3 abajo) */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

/* En pantallas de PC (mayores a 768px): Todo en una sola fila de 6 columnas */
@media (min-width: 768px) {
    .grid-stats {
        grid-template-columns: repeat(6, 1fr);
    }
}

.img {
    display: block;
    width: 70%;
    margin: 0 auto;
filter: drop-shadow( 0 4px 6px var(--color-claro));

    @media (width >= 760px) {
        width: 300px;
    }
}

.flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin: 0 0 10px;
}

.btn,
.btn__menu {
    display:;
    color: #fff7e7;
    background-color: #25b7b6;
    border: 4px double #fff;
    border-radius: 8px;
    padding: 10px 20px;
    text-aline: center;
    font-size: 0.7em;
    font-weight: 900;
    cursor: pointer;
    width: 100px;
}

.cont__btn {
    display: flex;
    flex-direction: column;
    gap-bottom: 20px;
    justify-content: center;
    align-items: center;
}

.btn__menu {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: block;
    height: 50px;
    font-size: 1em;
    margin-bottom: 15px;
    place-content: center;
    width: 250px;
}

.btn:hover,
.btn__menu:hover {
    transition: 0.5s ease;
    background-color: #fb8370;
}

.btn__secundario {
    border: none;
    color: #fff;
    text-shadow: 5px 2px 6px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 60px;
    left: 5px;
    font-size: 2.5em;
    background: transparent;
}


/* El tablero se adapta al ancho disponible */

.tablero {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Fuerza exactamente 4 columnas */
    gap: 5px;
    /* Espacio entre las cartas */
    width: 100%;

    background: transparent;
    @media (width >= 760px) {
        width: 500px;

        /* Tamaño máximo en escritorio */
        justify-content: center;
        align-items: centet;
    }
}


.card {
    aspect-ratio: 3/4;
    /* Mantiene la proporción de la carta */
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 90%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    color: var(--color-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px double #fff;
    background: #25b7b6;
    border-radius: 8px;
    /* Bordes redondeados modernos */
    font-size: 2em;
    font-weight: 900;
}

.card-back {
    transform: rotateY(180deg);
    background: #fff;
    border: 4px double var(--color-oscuro);
    color: var(--color-oscuro);
    font-weight: 500;
}

.card-back i {
    color: var(--color-oscuro);
    font-size: 1.7em;
    font-weight: 500;
}

/* Animación para simular que se revuelven las cartas */

@keyframes revolverEfecto {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: scale(0.95) rotate(-3deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.revolviendo {
    animation: revolverEfecto 0.4s ease-in-out;
}

/* Si las animaciones están desactivadas, anulamos las transiciones */
body.sin-animaciones .card-inner {
    transition: transform 0s !important;
}

body.sin-animaciones .tablero.revolviendo {
    animation: none !important;
}

body.sin-animaciones .modal-content,
body.sin-animaciones .modal-overlay {
    transition: none !important;
}

.btn-apoyo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: transparent;
    color: var(--color-primary); /* Steel Blue clásico */
    border: none;
    padding: 6px 12px;
    
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-apoyo:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(70, 130, 180, 0.25);
    transform: translateY(-1px);
}

.icono-cafe {
    font-size: 2.5em;
}

  .texto-apoyo {
        display: block;
    }
  

/* Ocultar el texto en pantallas muy pequeñas de móviles para que solo quede el ícono y ocupe menos espacio */
@media (max-width: 480px) {
  /*  .btn-apoyo {
        padding: 8px;
        border-radius: 50%;
    }
*/
}

.pie {
text-align: center;
}

/* Estilos generales para los modales */

.game-container {
    padding: 20px 0 0;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-card {
    background: white;
    color: var(--color-oscuro);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.modal-card button {
    margin-top: 15px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    font-size: 1em;
    font-weight: 900;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    font-size: 16px;
}

.btn-toggle {
    background-color: #ccc;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

/* --- ESTILOS GENERALES PARA LOS MODALES Y SISTEMA --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Fondo oscuro semitransparente unificado */
    display: none; /* Oculto por defecto para que no aparezcan solos */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Asegura que esté por encima de todo */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Esta clase 'activo' es la que inyecta JavaScript para mostrarlos */
.modal-overlay.activo {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: white;
    color: var(--color-oscuro);
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.modal-card button {
    margin-top: 15px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    font-size: 1em;
    font-weight: 900;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    font-size: 16px;
}

.btn-toggle {
    background-color: #ccc;
    color: #333;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

/* Contenedor interno del modal del sistema */
.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 400px;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.activo .modal-content {
    transform: scale(1); /* Pequeña animación de zoom al abrir */
}

.modal-titulo {
    color: #0a2a45;
    margin-top: 0;
    font-size: 22px;
    margin-bottom: 15px;
}

.modal-mensaje {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
}

/* Botones dentro del modal del sistema */
.modal-boton-accion, .modal-boton-secundario {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    margin: 5px;
}

.modal-boton-accion {
    background-color: #4682b4; /* Steel Blue clásico de tu app */
    color: white;
}

.modal-boton-accion:hover {
    background-color: #3a6b91;
}

.modal-boton-secundario {
    background-color: #edf2f7;
    color: #4a5568;
}

.modal-boton-secundario:hover {
    background-color: #e2e8f0;
}
