/* ===== CSS DEL JUEGO DE MEMORIA ===== */

body {
    background-image: url('imagenes/kimetsu_inicio.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-color: #667eea;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

.contenedor-juego {
    max-width: 1200px;
    margin: 0 auto;
}

.encabezado {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.titulo-juego {
    color: #ff0000;
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

.controles {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-dificultad {
    margin: 5px;
}

.estadisticas {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.stat-card {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    margin: 5px;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

#tablero {
    display: grid;
    gap: 15px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

#tablero.facil {
    grid-template-columns: repeat(4, 1fr);
}

#tablero.medio {
    grid-template-columns: repeat(4, 1fr);
}

#tablero.dificil {
    grid-template-columns: repeat(6, 1fr);
}

.carta {
    aspect-ratio: 3/4;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.carta.volteada {
    transform: rotateY(180deg);
}

.carta.encontrada {
    opacity: 0.6;
    cursor: default;
}

.cara {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cara-atras {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    font-size: 48px;
    color: white;
}

.cara-adelante {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: rotateY(180deg);
}

.cara-adelante img {
    width: 90%;
    height: 90%;
    object-fit: cover;
    border-radius: 8px;
}

#cargando {
    text-align: center;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

.btn-menu {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    border: none;
}

.btn-menu:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.btn-menu i {
    font-size: 28px;
    color: #667eea;
}

/* ===== CSS DEL FORMULARIO ===== */

.contenedor-juego.formulario {
    max-width: 800px;
}

.subtitulo {
    color: #667eea;
    font-size: 1.1rem;
    margin-top: 10px;
    font-weight: 500;
}

.titulo-juego.formulario {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.encabezado.formulario {
    padding: 30px;
    text-align: center;
}

.card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    animation: fadeInUp 0.6s ease;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 25px;
    border: none;
}

.card-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.5rem;
}

.card-body {
    padding: 35px;
}

.form-label {
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    color: #667eea;
    font-size: 1.2rem;
}

.form-control,
.form-select {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 14px 18px;
    transition: all 0.3s;
    font-size: 1.05rem;
    background-color: white;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
    animation: pulse 0.5s ease;
    background-color: #f8f9fa;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
    }
}

textarea.form-control {
    resize: none;
}

.form-text {
    font-size: 0.9rem;
    color: #6c757d;
    display: block;
    margin-top: 6px;
    padding-left: 5px;
}

.text-danger {
    color: #ff0000;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 16px 30px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #7689f1 0%, #8558b3 100%);
}

.btn-outline-secondary {
    border: 3px solid #6c757d;
    color: #6c757d;
    background-color: white;
    padding: 14px 30px;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s;
    font-size: 1.1rem;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.alert-success {
    background-color: #d1e7dd;
    border: 3px solid #badbcc;
    border-radius: 15px;
    padding: 20px;
    font-weight: 600;
    animation: slideIn 0.5s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 1.1rem;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.invalid-feedback {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 6px;
    font-weight: 600;
}

.form-select option {
    padding: 12px;
    font-size: 1.05rem;
    background: white;
}

.form-select option:hover {
    background: #f8f9fa;
}

.mb-4 {
    margin-bottom: 1.8rem !important;
}

.titulo-juego {
    animation: fadeInDown 0.6s ease;
}


@media screen and (max-width: 768px) {

    #tablero.facil,
    #tablero.medio {
        grid-template-columns: repeat(3, 1fr);
    }

    #tablero.dificil {
        grid-template-columns: repeat(4, 1fr);
    }

    .titulo-juego {
        font-size: 24px;
    }

    .stat-value {
        font-size: 20px;
    }

    /* Formulario responsive */
    .titulo-juego.formulario {
        font-size: 1.8rem;
    }

    .card-body {
        padding: 25px;
    }

    .btn-menu {
        width: 50px;
        height: 50px;
    }

    .btn-menu i {
        font-size: 24px;
    }

    .form-label {
        font-size: 1rem;
    }

    .form-control,
    .form-select {
        font-size: 1rem;
        padding: 12px 15px;
    }
}

@media screen and (max-width: 576px) {

    #tablero.facil,
    #tablero.medio,
    #tablero.dificil {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .cara-atras {
        font-size: 32px;
    }

    /* Formulario móvil */
    .contenedor-juego {
        padding: 10px;
    }

    .encabezado.formulario {
        padding: 20px;
    }

    .titulo-juego.formulario {
        font-size: 1.5rem;
        gap: 10px;
    }

    .card-body {
        padding: 20px;
    }
}