/* =========================================
   CONFIGURACIÓN GENERAL
========================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {

    min-height: 100vh;

    font-family: Arial, Helvetica, sans-serif;

    background:
        radial-gradient(
            circle at top left,
            rgba(126, 87, 194, 0.20),
            transparent 35%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(63, 81, 181, 0.18),
            transparent 35%
        ),
        #f4f2f7;

    color: #272331;
}


/* =========================================
   PANTALLA INICIAL
========================================= */

.pantalla-inicio {

    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 25px;
}


.inicio-contenido {

    width: min(650px, 95%);

    text-align: center;

    background: rgba(255, 255, 255, 0.94);

    border: 2px solid #ded8e8;

    border-radius: 30px;

    padding: 55px 40px;

    box-shadow:
        0 20px 50px rgba(54, 43, 74, 0.15);

    animation: aparecerInicio 0.6s ease;
}


@keyframes aparecerInicio {

    from {

        opacity: 0;

        transform: translateY(25px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }
}


.inicio-icono {

    font-size: 70px;

    margin-bottom: 15px;
}


.inicio-contenido h1 {

    color: #5d3f83;

    font-size: 45px;

    margin-bottom: 15px;
}


.inicio-contenido p {

    color: #625c69;

    font-size: 18px;

    line-height: 1.6;

    max-width: 500px;

    margin: 0 auto 30px;
}


/* =========================================
   BOTÓN EMPEZAR
========================================= */

.btn-empezar {

    border: none;

    background:
        linear-gradient(
            135deg,
            #9c4dac,
            #7045a5
        );

    color: white;

    font-size: 20px;

    font-weight: bold;

    padding: 16px 38px;

    border-radius: 15px;

    cursor: pointer;

    min-width: 200px;

    box-shadow:
        0 8px 18px rgba(112, 69, 165, 0.30);

    transition: 0.2s ease;
}


.btn-empezar:hover {

    transform: translateY(-3px);

    box-shadow:
        0 12px 23px rgba(112, 69, 165, 0.35);
}


.btn-empezar:active {

    transform: scale(0.97);
}


.btn-empezar span {

    margin-left: 10px;
}


/* =========================================
   OCULTAR
========================================= */

.oculto {

    display: none !important;
}


/* =========================================
   CONTENEDOR DEL JUEGO
========================================= */

.juego-container {

    width: 100%;

    max-width: 1050px;

    margin: 35px auto;

    text-align: center;

    background: rgba(255, 255, 255, 0.92);

    border: 2px solid #ded8e8;

    border-radius: 25px;

    padding: 30px 35px 40px;

    box-shadow:
        0 15px 40px rgba(54, 43, 74, 0.12);
}


.juego-container h1 {

    font-size: 42px;

    color: #5d3f83;

    margin-bottom: 10px;
}


.instrucciones {

    color: #65606d;

    font-size: 17px;

    margin-bottom: 25px;
}


/* =========================================
   BARRA
========================================= */

.barra-juego {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;

    margin-bottom: 30px;

    padding: 15px 20px;

    background: #eeebf4;

    border-radius: 18px;

    border: 1px solid #ddd5e8;
}


.contador {

    font-size: 18px;

    font-weight: bold;

    color: #41394b;
}


#parejasEncontradas {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width: 34px;

    height: 34px;

    margin-left: 5px;

    border-radius: 50%;

    background: #f2c94c;

    color: #332c1d;

    font-weight: 800;
}


/* =========================================
   BOTÓN REINICIAR
========================================= */

.btn-reiniciar {

    border: none;

    background: #4f63a7;

    color: white;

    font-size: 15px;

    font-weight: bold;

    padding: 12px 22px;

    border-radius: 12px;

    cursor: pointer;

    transition: 0.2s ease;
}


.btn-reiniciar:hover {

    transform: translateY(-2px);

    background: #43558f;
}


/* =========================================
   TABLERO
========================================= */

.tablero {

    width: 100%;

    display: grid;

    grid-template-columns: repeat(5, 1fr);

    gap: 20px;
}


/* =========================================
   TARJETAS
========================================= */

.tarjeta {

    height: 210px;

    perspective: 1000px;

    cursor: pointer;

    user-select: none;
}


.tarjeta.bloqueada {

    cursor: default;
}


.tarjeta-inner {

    width: 100%;

    height: 100%;

    position: relative;

    transform-style: preserve-3d;

    transition:
        transform 0.55s ease;
}


.tarjeta.volteada .tarjeta-inner {

    transform:
        rotateY(180deg);
}


.tarjeta-frente,
.tarjeta-atras {

    position: absolute;

    width: 100%;

    height: 100%;

    border-radius: 15px;

    backface-visibility: hidden;

    -webkit-backface-visibility: hidden;

    overflow: hidden;
}


/* =========================================
   PARTE TRASERA
========================================= */

.tarjeta-atras {

    background:
        linear-gradient(
            135deg,
            #b5e0eb,
            #8ccddd
        );

    border: 4px solid #272331;

    display: flex;

    align-items: center;

    justify-content: center;

    box-shadow:
        0 7px 12px rgba(38, 32, 47, 0.16);
}


.tarjeta-atras::before {

    content: "☆";

    font-size: 65px;

    color: rgba(255, 255, 255, 0.60);
}


.tarjeta-atras::after {

    content: "OVSICORI";

    position: absolute;

    bottom: 15px;

    font-size: 12px;

    letter-spacing: 2px;

    font-weight: bold;

    color: rgba(45, 54, 67, 0.45);
}


/* =========================================
   PARTE DELANTERA
========================================= */

.tarjeta-frente {

    background: #ffffff;

    border: 4px solid #272331;

    transform: rotateY(180deg);

    padding: 10px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    align-items: center;
}


.tarjeta-frente img {

    width: 100%;

    height: 145px;

    object-fit: contain;

    border-radius: 10px;

    background: #f5f3f7;

    display: block;
}


.nombre-tarjeta {

    width: 100%;

    min-height: 35px;

    display: flex;

    align-items: center;

    justify-content: center;

    text-align: center;

    font-size: 14px;

    font-weight: 800;

    color: #3d3150;

    line-height: 1.2;
}


/* =========================================
   PAREJA ENCONTRADA
========================================= */

.tarjeta.encontrada {

    cursor: default;
}


.tarjeta.encontrada .tarjeta-frente {

    border-color: #e4b72e;

    box-shadow:
        0 0 0 3px rgba(242, 201, 76, 0.25),
        0 8px 18px rgba(70, 55, 20, 0.15);
}


/* =========================================
   MODAL
========================================= */

.modal {

    position: fixed;

    inset: 0;

    background: rgba(33, 28, 42, 0.65);

    display: none;

    align-items: center;

    justify-content: center;

    padding: 20px;

    z-index: 1000;

    backdrop-filter: blur(4px);
}


.modal.activo {

    display: flex;
}


.modal-contenido {

    width: min(550px, 95vw);

    max-height: 90vh;

    overflow-y: auto;

    background: white;

    border-radius: 25px;

    padding: 30px;

    text-align: center;

    position: relative;

    border: 4px solid #9c4dac;

    box-shadow:
        0 20px 50px rgba(24, 19, 32, 0.35);

    animation: aparecerModal 0.3s ease;
}


@keyframes aparecerModal {

    from {

        opacity: 0;

        transform: scale(0.88);

    }

    to {

        opacity: 1;

        transform: scale(1);

    }
}


/* =========================================
   CERRAR MODAL
========================================= */

.cerrar-modal {

    position: absolute;

    top: 12px;

    right: 15px;

    width: 38px;

    height: 38px;

    border: none;

    border-radius: 50%;

    background: #ece8f1;

    color: #4b4055;

    font-size: 25px;

    cursor: pointer;
}


/* =========================================
   MODAL
========================================= */

.modal-icono {

    font-size: 42px;

    margin-bottom: 5px;
}


.modal-contenido h2 {

    color: #7045a5;

    font-size: 29px;

    margin-bottom: 15px;
}


.modal-contenido img {

    width: 180px;

    height: 130px;

    object-fit: contain;

    background: #f4f2f7;

    border-radius: 15px;

    border: 2px solid #d8d0e3;

    margin-bottom: 12px;
}


.modal-contenido h3 {

    color: #3f4f88;

    font-size: 21px;

    margin-bottom: 12px;
}


.modal-contenido p {

    color: #4d4854;

    font-size: 16px;

    line-height: 1.55;

    margin-bottom: 20px;
}


/* =========================================
   BOTÓN CONTINUAR
========================================= */

.btn-continuar {

    border: none;

    background:
        linear-gradient(
            135deg,
            #4f63a7,
            #67439b
        );

    color: white;

    font-size: 16px;

    font-weight: bold;

    padding: 13px 30px;

    border-radius: 13px;

    cursor: pointer;

    transition: 0.2s ease;
}


.btn-continuar:hover {

    transform: translateY(-2px);
}


/* =========================================
   FINAL
========================================= */

.modal-contenido.final {

    padding: 45px 30px;
}


.final-emoji {

    font-size: 70px;

    margin-bottom: 10px;
}


.final h2 {

    font-size: 35px;
}


.final p {

    font-size: 20px;
}


.final .final-pequeno {

    font-size: 15px;

    color: #77717e;

    margin-bottom: 25px;
}


/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 900px) {

    .tablero {

        grid-template-columns:
            repeat(4, 1fr);
    }

    .tarjeta {

        height: 190px;
    }
}


@media (max-width: 700px) {

    .juego-container {

        padding: 25px 15px 30px;
    }

    .juego-container h1 {

        font-size: 32px;
    }

    .barra-juego {

        flex-direction: column;
    }

    .tablero {

        grid-template-columns:
            repeat(3, 1fr);

        gap: 12px;
    }

    .tarjeta {

        height: 170px;
    }

    .tarjeta-frente img {

        height: 105px;
    }

    .nombre-tarjeta {

        font-size: 11px;
    }
}


@media (max-width: 450px) {

    .tablero {

        grid-template-columns:
            repeat(2, 1fr);
    }

    .tarjeta {

        height: 175px;
    }
}
.ovsi-return { position:fixed; z-index:9999; top:12px; left:12px; padding:10px 14px; color:#fff; background:#071d2d; border:1px solid rgba(255,255,255,.35); border-radius:4px; font:700 13px/1.2 Arial,sans-serif; text-decoration:none; box-shadow:0 4px 18px rgba(0,0,0,.22); }
