@charset "utf-8";

/* CSS Document */
@font-face {
    font-family: 'a_mano';
    src: url('../fonts/CaveatBrush-Regular.ttf');
    font-style: normal;
    font-weight: normal;
}

:root {
    --velocidad: 3s;
    --ancho_ficha: 5vmin;
    --alto_ficha: 10vmin;
    --color_j1: rgb(207 255 184);
    --color_j2: rgb(251 193 41);
    --color_j3: rgb(154 208 255);
    --color_j4: rgb(221 159 159);
}

html {
    font-size: 2vmin;
    overflow: hidden;
}

body {
    background: #a5a6a5;
    margin: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.modal,
.modal_espere {
    height: 100%;
    width: 100%;
    display: none;
    position: fixed;
    z-index: 5;
}

.modal_ayuda {
    display: none;
}

.modal_espere {
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

/* Pista de la barra de progreso */
.modal_espere::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vmin;
    height: 1vmin;
    min-height: 5px;
    background: #00040b;
    border: 2px solid #ffffff;
    border-radius: 1.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    z-index: 1001;
}

/* Relleno animado de la barra de progreso */
.modal_espere::after {
    content: '';
    position: absolute;
    top: 10%;
    left: calc(50% - 20vmin);
    transform: translateY(-50%);
    height: 1vmin;
    min-height: 5px;
    border-radius: 1.2rem;
    background: linear-gradient(90deg, #fabe3c, #e80404, #f7df95);
    background-size: 200% 100%;
    z-index: 1002;
    animation: animarBarraProgreso 1.6s ease-in-out infinite;
}

@keyframes animarBarraProgreso {
    0% {
        width: 0%;
        left: calc(50% - 40vmin);
        background-position: 0% 50%;
    }

    50% {
        width: 80vmin;
        left: calc(50% - 40vmin);
        background-position: 100% 50%;
    }

    100% {
        width: 0%;
        left: calc(50% + 40vmin);
        background-position: 0% 50%;
    }
}


.div_mensaje {
    position: fixed;
    background: #690612;
    z-index: 12;
    min-width: 70vw;
    max-height: 75vh;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    padding: 0.5rem;
    border-radius: 1rem;
    overflow: hidden;
}

/* Clase para lanzar la animación de rebote */
.div_mensaje.animar-entrada {
    display: flex;
    flex-direction: column;
    animation: reboteEntrada 1.2s ease-out forwards;
}

/* Clase para lanzar la animación de salida (deslizado continuo sin rebote) */
.div_mensaje.animar-salida {
    display: flex;
    flex-direction: column;
    animation: salidaDeslizar 0.5s ease-in forwards;
}

@keyframes reboteEntrada {
    0% {
        top: -200px;
        /* Sale desde arriba fuera de pantalla */
    }

    40% {
        top: 70%;
        /* Cae un poquito por debajo del centro */
    }

    70% {
        top: 40%;
        /* Rebota hacia arriba */
    }

    100% {
        top: 50%;
        /* Queda perfectamente centrado */
    }
}

@keyframes salidaDeslizar {
    0% {
        top: 50%;
        opacity: 1;
    }

    100% {
        top: -200px;
        opacity: 0;
    }
}

.div_into_mensaje {
    background: #00040b;
    border: solid 0.2rem white;
    color: white;
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    font-size: 2rem;
    flex: 1;
    min-height: 0;
    width: stretch;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.div_into_mensaje table {
    text-align: right;
    font-size: 1.5rem;
}

.div_into_mensaje tr td:first-child {
    text-align: left;
}

.div_into_mensaje td:first-child {
    text-decoration: none;
    font-weight: bold;
}

.div_into_mensaje tr:first-child {
    color: #FABE3C;
    text-decoration: none;
    text-align: center;
}

.div_into_mensaje td {
    padding: 0rem 1rem 0rem 1rem;
    border-bottom: solid #FABE3C 1px;
}

.div_into_mensaje .puntos_mensaje {
    font-size: 1.5rem;

}

.div_into_mensaje .puntos_mensaje img {
    height: 5vmin;
}

.div_titulo_mensaje {
    color: #ffb300;
    text-decoration: underline;
    font-weight: bold;
    margin: 2vmin 0;
}

#txt_mensaje {
    margin-bottom: 1.5rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#txt_mensaje::-webkit-scrollbar {
    width: 0.6rem;
}

#txt_mensaje::-webkit-scrollbar-track {
    background: #203763;
    border-radius: 1rem;
}

#txt_mensaje::-webkit-scrollbar-thumb {
    background: #628BBB;
    border-radius: 1rem;
}

#txt_mensaje::-webkit-scrollbar-thumb:hover {
    background: #f7df95;
}

#txt_mensaje:hover {
    scrollbar-color: #f7df95 #203763;
    /* thumb | track al hover */
}

.div_estadisticas table {
    display: flex;
    justify-content: center;
}

.ganador_juego_mensaje {
    color: yellow;
    text-shadow: 2px 2px red;
    font-style: italic;
}

.ganador_juego_mensaje img {
    height: 10vmin;
}

.registrando_resultado {
    font-size: 1rem;
    color: aqua;
    font-style: italic;
}

.modal_ayuda_contenido {
    text-align: left;
    margin: 2vmin 2vmin;
}

.modal_ayuda_contenido img {
    border: 1px solid #c10e0e;
    max-width: 80dvmin;
}

.btn {
    font-size: 2rem;
    color: white;
    background-color: #740303;
    border-radius: 2rem;
    cursor: pointer;
    border: solid 0.2rem rgb(241, 238, 238);
}

.botones_mensaje {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

#btn_mensaje_otro {
    display: none;
}

.btn:hover {
    background-color: #3c5d04;
}

.header {
    text-align: center;
    color: #fff;
    font-size: 2.5em;
    padding: 1vh 0;
    letter-spacing: 2px;
    /* height: 6vh; */
    max-height: 10vh;
    border: 1px solid rgb(151, 6, 6);
    background: black;
    display: grid;
    grid-template-columns: 35% 30% 35%;
    box-shadow: 0.2rem 0.2rem 0.2rem 0.2rem rgb(141, 141, 141);
    border-radius: 3rem;
    margin: 0 2vmin 0 2vmin;
    z-index: 3;
}

.columna_cabecera {
    display: flex;
    align-items: center;
}

#cab_2 {
    justify-content: center;
    margin: auto;
    color: rgb(255, 255, 255);
    font-size: 1.5rem;
    text-shadow: 0.2rem 0.1rem gray;
    font-weight: bold;

}

#cab_3 {
    display: flex;
    justify-content: end;
    font-size: 3vmin;
    margin-right: 1vw;
}

.contenedor_marcador {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    cursor: pointer;
    display: none;
}

.papel {
    background: #ffffff;
    position: absolute;
    display: block;
    min-width: 25vw;
    min-height: 10vh;
    max-height: 40vh;
    overflow-y: auto;
    right: 2vmin;
    z-index: 2;
    margin: 0 2vmin;
    box-shadow: 2px 2px 4px 3px black;
    font-family: 'a_mano', sans-serif;
    text-align: center;
    font-size: 4vmin;
    top: 4vmin;
    transform: translateY(-150%);
    transition: all 1s ease;
}

.papel_marcador {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.papel.visible {
    transform: translateY(8vmin);
}

.papel_marcador div {
    text-decoration: none;
    padding: 0 1vmin;
}

.cab_info,
.cab_ell,
.apunte_info,
.apunte_ell {
    border-right: 2px solid gray;
}

.cab_info,
.cab_ell,
.cab_nos {
    border-bottom: 2px solid gray;

}

.img_btn {
    cursor: pointer;
    height: 7vmin;
    margin-top: auto;
    margin-bottom: auto;
    transition: transform 0.3s ease;
    margin-right: 0.5rem;
}

.div_config {
    margin-left: 0.5rem;
}

#id_menu {
    padding: 0;
    margin-left: 2vmin;
    width: 50vw;
    background-color: #000000;
    position: absolute;
    left: 0;
    top: 0;
    list-style: none;
    box-shadow: 0.3rem 0.2rem 0.3rem 0.1rem #353535;
    z-index: 12;
    display: none;

}

#id_menu li {
    border-bottom: 0.1rem solid rgb(0, 0, 0);
    line-height: 3rem;
    padding-left: 2rem;
    text-decoration: none;
    font-size: 2rem;
    color: rgb(195, 196, 196);
    font-weight: bold;
    -webkit-transition: all 200ms linear;
    -ms-transition: all 200ms linear;
    transition: all 200ms linear;
}

#id_menu li img {
    vertical-align: middle;
    height: 3rem;
}

#id_menu li:hover {
    width: 41rem;
    background-color: #595959;
    color: white;
    box-shadow: 0.1rem 0.1rem 1rem 1rem #353535;
    transition: all 300ms linear;
    padding-left: 2rem;
    cursor: pointer;
    font-size: 2.5rem;
}

#img_nueva_mano,
#img_nuevo_juego {
    display: none;
}

/* 
.div_info_menu {
    width: fit-content;
    font-family: sans-serif;
    font-style: italic;
    font-size: 1.5rem;
    line-height: 1.5rem;
    text-wrap: nowrap;
    padding-right: 1rem;
    background: #b7b7b782;
} */


.resultado_simulacion {
    display: none;
    position: absolute;
    height: calc(100% - 20vmin);
    width: 90vw;
    background: #b2bae5;
    left: 5%;
    top: 10vmin;
    overflow-y: auto;
    border: 5px double white
}


/************************************/

.main-container {
    transform: translateZ(0);   
        will-change: transform;
    flex: 1;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    min-height: 0;
    height: calc(100vh - 80px);
    position: relative;
}

.mesa_completa {
    position: relative;
    width: 98vw;
    height: 85vh;
    display: flex;
    border: 2px solid #fff;
    background-image: url('../img/fondo_pral.png');
    background-size: cover;
    border-radius: 1vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    margin: 1vmin auto 0;
}

.mesa {
    position: relative;
    flex: 1;
    overflow: hidden;
    /*background: #dd9626;*/

}

.jugador {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* .jugador1 {
    margin-top: 2vmin;
}

.jugador3 {
    margin-bottom: 2vmin;
}
.jugador2 {
    margin-left: 2vmin;
}
.jugador4 {
    margin-right: 2vmin;
}
 */

/* Jugadores superior e inferior */
.jugador2,
.jugador4 {
    width: calc(var(--alto_ficha) + 5vmin);
    /* border: 1px solid #0d0d0d; */
    display: flex;
    flex-direction: column;
    gap: 2vmin;
}

.zona_libre_jugador,
.zona_nombre_jugador {
    flex: 1;
}

/* Jugadores laterales */
.jugador1,
.jugador3 {
    height: calc(var(--alto_ficha) + 5vmin);
    width: 100%;
    /* border: 1px solid #181818; */
    display: flex;
    gap: 2vmin;

}

.jugador .img_jugador {
    width: 10vmin;
    height: 10vmin;
    background-size: cover;
}

.jugador1 .zona_nombre_jugador,
.jugador3 .zona_nombre_jugador {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jugador2 .zona_nombre_jugador,
.jugador4 .zona_nombre_jugador {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

}


.jugador2 .zona_fichas_jugador,
.jugador4 .zona_fichas_jugador {
    height: calc(7 * var(--ancho_ficha));
    width: calc(var(--alto_ficha));

}

.jugador1 .zona_fichas_jugador,
.jugador3 .zona_fichas_jugador {
    width: calc(7 * var(--ancho_ficha));
    height: var(--alto_ficha);
}

.nombre_jugador {
    color: white;
    background: #210857;
    border-radius: 3vmin;
    border: solid 0.5vmin white;
    padding: 1vmin 0.5vmin;
    max-width: 14vmin;
    font-size: 2.5vmin;
    font-weight: bold;
    transition: all 2s;
    text-align: center;
    text-overflow: clip;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
    box-sizing: border-box;
}

.nombre_jugador1 {
    color: var(--color_j1);
}

.nombre_jugador2 {
    color: var(--color_j2);
}

.nombre_jugador3 {
    color: var(--color_j3);
}

.nombre_jugador4 {
    color: var(--color_j4);
}

.nombre_jugador_animado {
    /*Le metemos una animación de scala y borde*/
    animation: pulse 2s infinite;
}

.nombre_jugador_animado.mano {
    animation: pulse_mano 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        border-color: #c7ee02;
        background: #e80404;
    }

    50% {
        transform: scale(0.9);
        border-color: #fafafa;
        background: #210857;
    }

    100% {
        transform: scale(1);
        border-color: #c7ee02;
        background: #e80404;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        border-color: #c7ee02;
        background: #e80404;
    }

    50% {
        transform: scale(0.9);
        border-color: #fafafa;
        background: #210857;
    }

    100% {
        transform: scale(1);
        border-color: #c7ee02;
        background: #e80404;
    }
}

@keyframes pulse_mano {
    0% {
        transform: scale(1);
        border-color: #c7ee02;
        background: #e80404;
    }

    50% {
        transform: scale(0.9);
        border-color: #fafafa;
        background: #048d04;
    }

    100% {
        transform: scale(1);
        border-color: #c7ee02;
        background: #e80404;
    }
}

.mano {
    background: #048d04;
}

.zona-central {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/***FIHAS*****/

.ficha {
    position: absolute;
    width: var(--ancho_ficha);
    height: var(--alto_ficha);
    perspective: 15rem;
    transform-origin: center center;
    /* ¡ESTO ES CRUCIAL! */
    transition: transform var(--velocidad) ease;
}

.ficha_seleccion {
    cursor: pointer !important;
    box-shadow: 0px 0px 16px 6px #f58305, 0px 0px 1px 1px blue;
    z-index: 5;
}

.ficha_seleccion_jugador {
    box-shadow: 0px 0px 16px 6px #05f545, 0px 0px 1px 1px rgb(11, 93, 2);
    cursor: pointer !important;
    z-index: 5;
}

.ficha_ayuda {
    box-shadow: 0 0 0.2vmin 0.2vmin #3737d7,
        0 0 0.2vmin 0.3vmin red;
    z-index: 5;

}

.escala_1_5 {
    transform: scale(1.5) !important;
    z-index: 10 !important;
}

.bloque_ficha {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform var(--velocidad);
}

.blanco_ficha,
.negro_ficha {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    background-size: cover;
}

.blanco_ficha {
    box-shadow: 0 0 0.3vmin 0px rgb(8 8 8);
    font-size: calc(var(--ancho_ficha)/2);
    color: #f50909;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    font-weight: bold;
}

/*:::::::::::::FICHA EN MANO EN MODO APRENDIZAJE*****************/
.blanco_ficha_jugador1 {
    box-shadow: inset 0 0 13px 0px var(--color_j1);
}

.blanco_ficha_jugador2 {
    box-shadow: inset 0 0 13px 0px var(--color_j2);
}

.blanco_ficha_jugador3 {
    box-shadow: inset 0 0 13px 0px var(--color_j3);
}

.blanco_ficha_jugador4 {
    box-shadow: inset 0 0 13px 0px var(--color_j4);
}

.negro_ficha {
    background-color: black;
    border: solid 1px #ffffff;
}

.bloque_ficha.flip,
.blanco_ficha {
    transform: rotateY(180deg);
}

.ficha_movible {
    cursor: grab !important;
}

/**********************************************************/
/*::::::::::::BOCADILLOOS*****************/
.bocadillo {
    position: absolute;
    display: flex;
    z-index: -1;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    padding: 2vmin 2vmin;
    opacity: 0;
    transition: opacity var(--velocidad) cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 25vw;
    font-size: 3vmin;

}

.bocadillo1 {

    background-image: url(../img/bocadillo_1.webp);
    transform: translate(-50%);

}

.bocadillo2 {

    background-image: url(../img/bocadillo_2.webp);
}

.bocadillo3 {

    background-image: url(../img/bocadillo_3.webp);
    transform: translate(-50%, -100%);
}

.bocadillo4 {

    background-image: url(../img/bocadillo_4.webp);
}



.ayuda {
    background-image: url(../img/ayuda.webp);
}

.paso {
    background-image: url(../img/paso.webp);
}

.ayuda,
.paso {
    display: none;
    background-size: cover;
    background-repeat: no-repeat;
    width: 10vmin;
    height: 10vmin;
    cursor: pointer;
    transition: transform 1s ease;
    z-index: 10;
}

.ayuda:hover,
.paso:hover {
    transform: scale(1.2);
}

/*********************FORMULARIO DE CONFIGURACION***************/
#configuracion-domino {
    width: 90vw;
    height: 85vh;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    color: white;
    overflow-y: auto;
    font-size: 3vmin;
    margin: auto;
}

#configuracion-domino h2 {
    font-size: 3vmin;
}

select,
input {
    font-size: 3vmin;
}

/* Tarjetas de jugadores */
.conf-jugador {
    background: rgb(3, 3, 3);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.conf-jugador h2 {
    text-align: center;
    color: #9d9d9d;
}

.conf-jugador img {
    width: 6vmin;
    max-width: 180px;
    aspect-ratio: 1;
    object-fit: cover;
    align-self: center;
    background: rgb(192, 192, 192);
    border-radius: 10px;
    border: 2px solid #4d0505;
}

.grupo_campos {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.sonido_activado {
    background-image: url(../img/sonido_activado.webp);
}

.sonido_desactivado {
    background-image: url(../img/sonido_desactivado.webp);
}

.conf_sonido {
    background-repeat: no-repeat;
    background-size: contain;
    width: 5vmin;
    height: 5vmin;
    cursor: pointer;
}

.conf_sonido:hover {
    transform: scale(1.1);
}

.nombre_nivel {
    flex-direction: column;
    gap: 2vmin;
}

.titulo_avatar {
    justify-content: space-between !important;
    flex-direction: row !important;
}

.titulo_conf {
    color: #b7989b;
    text-decoration: underline;
}

.conjunto_avatar {
    display: flex;

    align-items: center;
    gap: 1vmin;
}

.avatar_btn {
    display: inline;
    cursor: pointer;
    user-select: none;
}

.avatar_btn:hover {
    background-color: #3737d7;
}

.campo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

.campo label {
    display: flex;
    align-items: center;
    font-weight: bold;
}

.conf-jugador .campo label {
    width: 20vmin;
}

.configuracion label {
    width: 40vmin;
}

/* Panel de configuración */
.configuracion {
    grid-column: 1 / -1;
    text-align: center;

    background: rgb(0, 0, 0);
    border-radius: 12px;
    padding: 20px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);

    display: grid;

    gap: 15px;
}

.botones_configuracion {
    grid-column: 1 / -1;
    text-align: center;
}

.configuracion h2 {
    grid-column: 1 / -1;
    color: #9d9d9d;
}

select,
input[type="number"],
input[type="text"] {
    border: 1px solid #ec0d0d;
    border-radius: 1vmin;
}

.img_info {
    display: inline-flex;
    width: 3vmin;
    cursor: pointer;
}

.img_info:hover {
    scale: 1.1;
}

div#popup {
    display: block;
    position: fixed;
    background: #deff32;
    width: 20vmin;
    /* max-width: 10vmin; */
    padding: 1vmin;
    transform: translate(-100%, -100%);
    box-shadow: 0 4px 8px 0px rgb(0 0 0 / 96%);
}


/* Móviles */
@media (orientation: portrait) and (max-width: 1300px) {
    #configuracion-domino {
        grid-template-columns: 1fr;
        height: calc(100dvh - 8vh);
    }

    .configuracion {
        grid-column: auto;
    }
}

@media (max-width: 1500px) {
    #configuracion-domino {
        grid-template-columns: 1fr;
        height: calc(100dvh - 15vh);
    }

    .configuracion {
        grid-column: auto;
    }

    .grupo_campos {
        display: flex;
        flex-direction: column;
        gap: 4vmin;
        align-items: left;
    }

    .campo {
        width: 80vmin;
    }
}

/*boton SIMULAR */
#btn_simular,
#btn_simular2 {
    display: none;
}