/* Variables globales */
:root {
    --primary-color: #08041b; /* Ajustado al color del modelo */
    --container-color: #211e33; /* Color de contenedores del modelo */
    --accent-color: #6C63FF; /* No se usa en el modelo, pero se mantiene por si acaso */
    --text-color: #FFFFFF;
    --card-color: #1E1E3F;
    --success-color: #4CAF50; /* No se usa en el título del modal */
    --button-gradient-start: #ff6200; /* Gradiente para botones */
    --button-gradient-end: #ff0000;
}

/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Fondo con blur */
.background-blur {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--primary-color);
    opacity: 0.9;
}

.background-blur::before {
    content: '😊 🐶 🏁 ⚽ 😎 🐱 🎯 🎲';
    position: absolute;
    font-size: 100px;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    filter: blur(5px);
    animation: float 20s linear infinite;
    white-space: wrap;
    line-height: 1.5;
}

/* Pantallas */
.screen {
    max-width: 1200px;
    padding: 2rem;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Asegurarnos de que las pantallas ocultas no se muestren */
.screen.hidden {
    display: none !important;
}

/* Asegúrate de que esta regla tenga prioridad */
.modal.hidden {
    display: none !important;
}

/* Título principal */
h1 {
    font-size: 4rem;
    color: var(--text-color); /* Cambiado a blanco */
    margin-bottom: 2rem;
}

/* Opciones de juego */
.game-options {
    background: var(--container-color); /* Ajustado al color del modelo */
    padding: 2rem;
    border-radius: 15px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.option-section {
    margin-bottom: 2rem;
}

.option-section h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

select {
    width: 80%;
    padding: 0.8rem;
    border-radius: 8px;
    background: #FFFFFF; /* Fondo blanco como en el modelo */
    color: #333; /* Texto oscuro para contraste */
    border: 2px solid #ccc; /* Borde gris claro */
    font-size: 1rem;
    cursor: pointer;
}

/* Botones */
.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    margin: 0.5rem;
    text-transform: uppercase; /* Texto en mayúsculas */
    color: var(--text-color);
}

.btn-primary {
    background: linear-gradient(to right, var(--button-gradient-start), var(--button-gradient-end)); /* Gradiente del modelo */
}

.btn-secondary {
    background: #333; /* Fondo gris oscuro para botones secundarios */
    border: 2px solid var(--text-color); /* Borde blanco */
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 98, 0, 0.3); /* Sombra con tono del gradiente */
}

/* Nuevo botón Abandonar */
.btn-abandon {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    margin: 1rem auto;
    background: linear-gradient(to right, var(--button-gradient-start), var(--button-gradient-end)); /* Gradiente del modelo */
    color: var(--text-color);
    width: 200px;
    text-transform: uppercase;
}

.btn-abandon:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 98, 0, 0.3);
}

/* Contenedor del tablero */
.game-board-container {
    background: var(--container-color); /* Color del modelo */
    padding: 1rem;
    border-radius: 15px;
    max-width: 800px;
    margin: 2rem auto;
}

/* Tablero de juego */
.game-board {
    display: grid;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

/* Estilos para diferentes niveles */
.game-board.easy {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.game-board.medium {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.game-board.hard {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, 1fr);
}

/* Cartas */
.card {
    aspect-ratio: 1;
    background: var(--card-color);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
    min-width: 70px; /* Reducido para nivel fácil */
    min-height: 70px;
}

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

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: 10px;
}

.card-front {
    background: var(--card-color);
    border: 2px solid #ccc; /* Borde gris para contraste */
}

.card-back {
    background: var(--accent-color);
    transform: rotateY(180deg);
}

/* Modal de victoria */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--container-color); /* Color del modelo */
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    color: var(--text-color); /* Cambiado a blanco */
    margin-bottom: 1rem;
}

/* Contador de turnos */
.game-info {
    font-size: 1.2rem;
    margin: 1rem 0;
    color: var(--text-color); /* Asegurar que sea blanco */
}

/* Animaciones */
@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
    100% {
        transform: translateY(0) rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 3rem;
    }
    
    .game-board {
        gap: 5px;
    }
    
    .card-front, .card-back {
        font-size: 1.5rem;
    }
    
    .card {
        min-width: 60px;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .btn-primary, .btn-secondary, .btn-abandon {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .card {
        min-width: 50px;
        min-height: 50px;
    }
}