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

:root {
    --top-escondido: -3000px;
    --color-boton: #C36A62;
}

html {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    background-image: url("./imagenes/CastilloDisney.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

/* TÍTULO PRINCIPAL */
header h1 {
    text-align: center;
    margin: 23px 15px;
    color: white;
    font-family: 'Dancing Script', cursive;
    font-size: 38px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* CONTENEDOR GLOBAL */
.global { 
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    min-height: 75vh;
    width: 100%;
    padding: 0 15px;
}

.contenedor {
    width: 100%;
    min-height: 500px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* INICIO DEL JUEGO */
.inicio h1 {
    font-family: 'Dancing Script', cursive;
    text-align: center;
    margin: 20px 0;
    color: var(--color-boton);
    font-size: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* SECCIÓN INICIO */
.inicio {
    position: absolute;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    color: #333;
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.7rem;
    text-align: center;
    padding: 35px;
    width: 900px;
    max-width: 95%;
    min-height: 580px;
    height: auto;
    box-shadow: 5px 12px 12px -6px rgba(0, 0, 0, 0.5);
}

.mensaje-victoria {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 0.85);
    color: black;
    font-family: Arial, sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.7rem;
    text-align: center;
    padding: 35px;
    width: 380px;
    max-width: 90%;
    min-height: 180px;
    height: auto;
    border-radius: 8px;
    box-shadow: 5px 12px 12px -6px rgba(0, 0, 0, 0.5);
}

/* ESCONDEMOS LOS BOTONES INICIALMENTE */
.reiniciar,
.info {
    position: relative;
    top: var(--top-escondido);
    width: 50%;
}

/* DIV DEL BOTÓN */
.boton-div {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 15vh;
}

/* BOTÓN */
.boton {
    font-size: 18px;
    padding: 15px 30px;
    color: white;
    font-weight: bold;
    background-color: var(--color-boton);
    border: 3px solid white; 
    border-radius: 8px; 
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.boton:hover {
    color: #292b2c;
    font-weight: bold;
}

/* DIV PARA EL BOTÓN REINICIO */
.reinicio {
    display: flex;
    align-items: center;
    justify-content: center; 
}

/* BOTÓN REINICIO */
.reinicio i {
    font-size: 3.5em;
    color: white;
    margin: 0 75px;
    transition: margin-top .5s ease;
}

.reinicio i:hover {
    color: var(--color-boton);
}

/* BOTÓN FICHAS */
button {
    display: block;
    cursor: pointer;
    color: #FFF;
    font-weight: bold;
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
    margin: 1rem auto 0 auto;
    text-decoration: none;
    background-color: var(--color-boton);
    border-radius: 6px;
    border: 0;
    text-align: center;
}

button:hover {
    color: #292b2c;
    font-weight: bold;
}

/* SECTION JUEGO */
.juego {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    position: absolute;
    width: 100%;
    gap: 20px;  
    top: var(--top-escondido);
    transition: top 2s ease;
}

/* PANEL IZQUIERDA */
.resultado {
    max-width: 45vw;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.5);
    width: 480px;
    height: 650px; 
    border-radius: 8px; 
    margin-top: 85px;
}

.nombres,
.imagenes,
.opciones {
    max-width: 43vw;
    height: 66vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center; 
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;   
}

.nombres h1 {
    font-size: 2vw; 
}

.imagenes div {
    border: 2px solid white;
    box-shadow: 0 10px 12px -4px rgba(69, 69, 69, 1); 
    border-radius: 8px;  
}

.nombres div {
    height: 150px;
    width: 200px;
    margin: 7px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid white;
    box-shadow: 0 10px 12px -4px rgba(69, 69, 69, 1);
    border-radius: 8px; 
}

/* PANEL DERECHA */
.opciones div {
    height: 150px;
    width: 200px;
    margin: 8px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-boton);
    box-shadow: 0 10px 12px -4px rgba(69, 69, 69, 1);
    border: 2px solid white;
    font-size: 19px;
    font-weight: bold;
    color: white;
    font-family: Arial, sans-serif; 
    border-radius: 8px; 
    text-align: center;
}

.imagen-personaje,
.nombre-personaje {
    height: 150px;
    width: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;    
}

.nombre-opcion:hover {
    font-size: 25px;
}

/* FICHAS DE PERSONAJES */
.info-personajes {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.7);
    padding: 1.2rem;
    display: grid;
    grid-template-columns: repeat(4, 304px);
    grid-auto-rows: 240px;
    justify-content: center;
    row-gap: 80px;
    column-gap: 10px;
    width: 83%;
    margin: -10px auto 30px;
    position: relative;
    top: -3000px;
    transition: top 2s ease;
    transform-style: preserve-3d;
    border-radius: 8px;
}

.rotate-container {
    position: relative;  
}

.rotate-container .ficha-front,
.rotate-container .ficha-back {
    background-color: #FFF;
    border: 1px solid rgba(169, 169, 169, 0.5);
    border-radius: 0.25rem;
    width: 90%;
    height: 125%;
    backface-visibility: hidden;
    box-shadow: 0 8px 6px -6px rgba(0, 0, 0, 0.5);
    position: absolute;
    transition: transform .5s linear 0s;
}

.rotate-container .ficha-front {
    transform: perspective(900px) rotateY(0deg);
    border-radius: 8px;
}

.rotate-container .ficha-back {
    transform: perspective(900px) rotateY(180deg);
}

.rotate-container h4 {
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    padding: 0.75rem 0;
    background-color: var(--color-boton);
    color: white;
    border-bottom: 1px solid rgba(169, 169, 169, 0.5); 
    border-radius: 4px;
}

.rotate-container .ficha-front img {
    width: 100%;   
}

.rotate-container .ficha-back p {
    font-size: 0.9rem;
    letter-spacing: 0.02rem;
    line-height: 1.2;
    color: #292b2c;
    text-align: justify;
    padding: 10px 15px;
}

/* GIRAR TARJETAS */
.rotate-container .rotar-ficha-front {
    transform: perspective(1600px) rotateY(-180deg);
}

.rotate-container .rotar-ficha-back {
    transform: perspective(1600px) rotateY(0deg);
}

.establece-scroll {
    overflow-y: hidden;
}
/* ========================= */
/* RESPONSIVE TABLET */
/* ========================= */

@media (max-width: 1024px) {
    header h1 {
        font-size: 34px;
        margin: 20px 10px;
    }

    .inicio {
        width: 90%;
        padding: 28px;
        font-size: 1.05rem;
        line-height: 1.6rem;
    }

    .juego {
        gap: 15px;
        padding: 0 15px;
    }

    .resultado {
        width: 48%;
        max-width: none;
        height: 620px;
    }

    .opciones {
        width: 48%;
        max-width: none;
    }

    .nombres div,
    .opciones div,
    .imagen-personaje,
    .nombre-personaje {
        width: 170px;
        height: 130px;
    }

    .opciones div {
        font-size: 17px;
    }

    .info-personajes {
        width: 95%;
        grid-template-columns: repeat(2, 304px);
        margin: 40px auto 30px;
    }
}

/* ========================= */
/* RESPONSIVE MÓVIL */
/* ========================= */

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        min-height: 100%;
        overflow-x: hidden;
    }

    body {
        background-size: cover;
        background-position: center top;
        background-attachment: scroll;
    }

    header h1 {
        font-size: 24px;
        line-height: 1.2;
        margin: 16px 10px 10px;
        text-align: center;
    }

    .global {
        width: 100%;
        min-height: auto;
        height: auto;
        padding: 0 10px;
        justify-content: flex-start;
    }

    .contenedor {
        width: 100%;
        min-height: auto;
        height: auto;
        display: block;
        position: relative;
    }

    .inicio {
        position: fixed !important;
        top: 150px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;

        width: 86% !important;
        max-width: 340px !important;
        height: auto !important;
        min-height: auto !important;

        margin: 0 !important;
        padding: 18px 16px !important;

        font-size: 0.85rem;
        line-height: 1.2rem;
        border-radius: 14px;

        z-index: 9998 !important;
        display: block !important;
        transition: none !important;
    }

    .inicio h1 {
        font-size: 24px;
        margin: 5px 0 14px;
    }

    .boton-div {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;
        min-height: auto;
        margin: 12px 0 5px;
    }

    .boton {
        width: auto;
        font-size: 15px;
        padding: 11px 22px;
        border-radius: 10px;
    }

    .juego {
        position: relative;
        width: 100%;
        top: var(--top-escondido);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 18px;
        padding: 0;
        transition: none !important;
    }

    .juego[style*="top: 0"],
    .juego[style*="top:0"] {
        top: 0 !important;
    }

    .resultado {
        width: 100%;
        max-width: 340px;
        height: auto;
        min-height: auto;
        padding: 10px;
        display: flex;
        flex-direction: row;
        gap: 10px;
        margin: 0 auto;
    }

    .imagenes,
    .nombres {
        width: 50%;
        max-width: 50%;
        height: auto;
        padding: 8px 4px;
        gap: 12px;
        justify-content: flex-start;
    }

    .opciones {
        width: 100%;
        max-width: 340px;
        height: auto;
        padding: 10px;
        gap: 10px;
        justify-content: flex-start;
        margin: 0 auto;
    }

    .nombres div,
    .imagen-personaje,
    .nombre-personaje {
        width: 120px;
        height: 95px;
    }

    .opciones div {
        width: 90%;
        height: 45px;
        font-size: 14px;
        margin: 4px auto;
    }

    .reiniciar,
    .info {
         width: auto;
         display: none;
    }

    .reiniciar[style*="top: 0"],
    .reiniciar[style*="top:0"],
    .info[style*="top: 0"],
    .info[style*="top:0"] {
        display: block;
    }
    .reinicio {
        width: 100%;
        max-width: 340px;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 75px;
        margin: 0 auto 15px;
    }
    .reinicio i {
        margin: 0 !important;
        position: static !important;
        font-size: 2.5em;
    }

    .mensaje-victoria {
        width: 90%;
        max-width: 320px;
        height: auto;
        min-height: 150px;
        padding: 22px;
        font-size: 1rem;
        z-index: 9999;
    }

    .info-personajes {
        position: fixed;
        left: 50%;
        top: -3000px;
        transform: translateX(-50%);
        z-index: 9999;

        width: 86%;
        max-width: 315px;
        max-height: 78vh;
        overflow-y: auto;

        padding: 10px;
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: 245px;
        row-gap: 20px;
        column-gap: 0;
        margin: 0;

        border-radius: 14px;
        backdrop-filter: blur(10px);
        background-color: rgba(255, 255, 255, 0.75);
        transition: none !important;
    }

    .info-personajes[style*="top: 0"],
    .info-personajes[style*="top:0"] {
        top: 110px !important;
    }

    .rotate-container {
        width: 100%;
        height: 245px;
        position: relative;
    }

    .rotate-container .ficha-front,
    .rotate-container .ficha-back {
        width: 100%;
        height: 100%;
    }

    .rotate-container h4 {
        font-size: 0.95rem;
        padding: 0.5rem 0;
    }

    .rotate-container .ficha-front img {
        width: 100%;
        height: 140px;
        object-fit: cover;
    }

    .rotate-container .ficha-back p {
        font-size: 0.76rem;
        line-height: 1.15;
        padding: 8px 10px;
    }

    button {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        margin-top: 0.65rem;
    }

    .nombre-opcion:hover {
        font-size: 14px;
    }

    .inicio[style*="top: -"] {
        display: none !important;
    }
}

/* ========================= */
/* RESPONSIVE MÓVIL PEQUEÑO */
/* ========================= */

@media (max-width: 480px) {
    header h1 {
        font-size: 22px;
        margin-top: 14px;
    }

    .inicio {
        top: 140px !important;
        width: 86% !important;
        max-width: 320px !important;
        padding: 18px 14px !important;
        font-size: 0.82rem;
        line-height: 1.15rem;
    }

    .inicio h1 {
        font-size: 23px;
        margin-bottom: 12px;
    }

    .resultado,
    .opciones {
        max-width: 315px;
    }

    .nombres div,
    .imagen-personaje,
    .nombre-personaje {
        width: 112px;
        height: 88px;
    }

    .opciones div {
        height: 42px;
        font-size: 13px;
    }

    .reinicio {
        max-width: 315px;
        gap: 45px;
    }

    .info-personajes {
        width: 84%;
        max-width: 300px;
        grid-auto-rows: 235px;
        max-height: 76vh;
    }

    .rotate-container {
        height: 235px;
    }

    .rotate-container .ficha-front img {
        height: 125px;
    }
}
