:root {
    --color-fondo: #3e195e;
    --color-tarjeta: #ffffff;
    --color-titulo: #5c2a8c;
    --color-boton: #4ca64c;
    --color-boton-hover: #3d8c3d;
    --color-texto: #333333;
    --color-borde: #1a0b33;
    --color-destaque: #ffcc00;
    --color-banner-accent: #ff00ff;
}

/* --- AJUSTE GENERAL --- */
body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--color-fondo);
    background-image: url("imagenes/inspiration-geometry.png");
    color: var(--color-texto);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- ENCABEZADO PRINCIPAL (VERSIÓN GRANDE - PC) --- */
.header-principal {
    width: 100%;
    background-color: #1a0b33;
    background-image:
        radial-gradient(at 10% 10%, rgba(56, 189, 248, 0.25) 0px, transparent 50%),
        radial-gradient(at 90% 10%, rgba(255, 0, 255, 0.2) 0px, transparent 50%),
        radial-gradient(at 50% 90%, rgba(255, 204, 0, 0.15) 0px, transparent 50%),
        url('https://www.transparenttextures.com/patterns/az-subtle.png');
    border-bottom: 10px solid var(--color-titulo);
    box-shadow:
        inset 0 10px 20px rgba(0,0,0,0.6),
        inset 0 -10px 20px rgba(0,0,0,0.8),
        0px 10px 15px rgba(0, 0, 0, 0.4);
    padding: 30px 20px;
    box-sizing: border-box;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.header-principal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    opacity: 0.5;
}

.contenedor-titulo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.img-header {
    height: 190px;
    object-fit: contain;
    filter: drop-shadow(0 0 5px #fff) drop-shadow(5px 8px 0px rgba(0,0,0,0.6));
    position: relative;
    z-index: 2;
    transition: height 0.3s ease;
}

.fondo-taaniku {
    background-color: #ffffff;
    background-image: url("imagenes/bright-squares.png");
    border: 8px solid var(--color-borde);
    border-radius: 20px;
    padding: 12px 35px;
    box-shadow:
        inset 0 0 15px rgba(92, 42, 140, 0.2),
        8px 10px 0px rgba(0, 0, 0, 0.6);
    position: relative;
    z-index: 1;
}

/* --- TÍTULO TAANIKÚ (VERSIÓN GRANDE - PC) --- */
.titulo-taaniku {
    font-family: 'Press Start 2P', cursive;
    color: var(--color-titulo);
    font-size: 4rem;
    text-shadow:
        3px 3px 0px #ffffff,
        5px 5px 0px var(--color-destaque),
        8px 8px 0px var(--color-borde);
    margin: 0;
    letter-spacing: 4px;
    position: relative;
    transition: font-size 0.3s ease;
}

.titulo-taaniku::after {
    content: 'Taanikú';
    position: absolute;
    top: 0;
    left: 0;
    color: #fff;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 0 0 15px #fff, 0 0 30px #fff;
    opacity: 0;
    animation: brillo_letras 4s linear infinite;
}

@keyframes brillo_letras {
    0%, 10%, 100% { opacity: 0; transform: scale(1); }
    5% { opacity: 0.8; transform: scale(1.02); }
}

@keyframes flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.animacion-flotar {
    animation: flotar 3s ease-in-out infinite;
}

.header-principal .contenedor-titulo img:last-child {
    animation-duration: 4s;
    animation-delay: 1s;
}

.seccion-elige-aventura {
    width: 100%;
    text-align: center;
    margin-bottom: 40px;
    padding: 0 15px;
    box-sizing: border-box;
}

h2 {
    font-family: 'Press Start 2P', cursive;
    color: #ffffff;
    font-size: 1.8rem;
    text-shadow: 3px 3px 0px var(--color-titulo), 5px 5px 0px var(--color-borde);
    line-height: 1.5;
    margin: 0;
    position: relative;
    z-index: 2;
    transition: font-size 0.3s ease;
}

.decoracion-estrella {
    color: var(--color-destaque);
    font-size: 2.2rem;
    text-shadow: 3px 3px 0px var(--color-borde);
    vertical-align: text-bottom;
}

.contenido-juegos {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px 60px 20px;
    box-sizing: border-box;
}

.contenedor-juegos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 900px;
    width: 100%;
}

.ficha {
    background-color: var(--color-tarjeta);
    border: 6px solid var(--color-borde);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ficha:hover {
    transform: translateY(-5px);
    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.4);
}

.imagen-container {
    width: 100%;
    height: 180px;
    border: 4px solid var(--color-borde);
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    gap: 10px;
}

.img-contacto { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.img-medica { background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%); }
.img-juicio { background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); }
.img-entrevista { background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%); }

.titulo-juego {
    font-family: 'Press Start 2P', cursive;
    color: var(--color-titulo);
    font-size: 1rem;
    margin: 15px 0;
    line-height: 1.4;
}

.descripcion {
    font-size: 1.05rem;
    margin-bottom: 25px;
    font-weight: 600;
    line-height: 1.5;
    color: #555555;
}

.boton-jugar {
    display: block;
    background-color: var(--color-boton);
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.1rem;
    text-decoration: none;
    padding: 14px 20px;
    border: 4px solid var(--color-borde);
    border-radius: 12px;
    box-shadow: inset -4px -4px 0px rgba(0,0,0,0.25);
    cursor: pointer;
    transition: background-color 0.1s ease, transform 0.1s ease;
}

.boton-jugar:hover {
    background-color: var(--color-boton-hover);
}

.boton-jugar:active {
    box-shadow: inset 4px 4px 0px rgba(0,0,0,0.25);
    transform: scale(0.98);
}

.seccion-presentacion {
    width: 100%;
    max-width: 900px;
    margin: 60px auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    box-sizing: border-box;
}

.tarjeta-presentacion {
    background-color: #3e206e;
    background-image: url("imagenes/az-subtle.png");
    border: 6px solid var(--color-destaque);
    border-radius: 25px;
    padding: 35px 40px;
    box-shadow:
        inset 0 0 15px rgba(0, 0, 0, 0.2),
        8px 8px 0px rgba(0, 0, 0, 0.4);
    width: 100%;
    box-sizing: border-box;
}

.tarjeta-presentacion.borde-verde {
    border-color: var(--color-boton);
}

.bloque-personaje {
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
}

.bloque-personaje.itzel {
    justify-content: flex-end;
}

.img-presentacion {
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(4px 6px 0px rgba(0,0,0,0.5));
}

.cuadro-dialogo {
    background-color: #ffffff;
    border: 6px solid var(--color-borde);
    border-radius: 20px;
    padding: 20px 25px;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.4);
    position: relative;
    max-width: 60%;
}

.nombre-personaje {
    font-family: 'Press Start 2P', cursive;
    color: var(--color-titulo);
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 12px;
    line-height: 1.4;
}

.cuadro-dialogo p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0;
    font-weight: 600;
    color: #444;
}

.cuadro-dialogo::after, .cuadro-dialogo::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

.flecha-izquierda::after {
    left: -24px; top: 30px; border-width: 12px 24px 12px 0; border-color: transparent var(--color-borde) transparent transparent;
}
.flecha-derecha::after {
    right: -24px; top: 30px; border-width: 12px 0 12px 24px; border-color: transparent transparent transparent var(--color-borde);
}
.flecha-izquierda::before {
    left: -15px; top: 30px; border-width: 12px 24px 12px 0; border-color: transparent #ffffff transparent transparent; z-index: 1;
}
.flecha-derecha::before {
    right: -15px; top: 30px; border-width: 12px 0 12px 24px; border-color: transparent transparent transparent #ffffff; z-index: 1;
}

.animacion-flotar-suave {
    animation: flotarSuave 4s ease-in-out infinite;
}

.delay-1s {
    animation-delay: 1s;
}

@keyframes flotarSuave {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

.footer-principal {
    width: 100%;
    background-color: #1a0b33;
    border-top: 6px solid var(--color-titulo);
    color: #e0e0e0;
    padding: 40px 20px 20px 20px;
    box-sizing: border-box;
    margin-top: 40px;
    font-family: 'Nunito', sans-serif;
}

.footer-contenido {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 30px;
}

.footer-seccion {
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.footer-titulo {
    font-family: 'Press Start 2P', cursive;
    color: var(--color-destaque);
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.footer-seccion p {
    font-size: 1rem;
    line-height: 1.6;
}

.footer-enlace {
    display: block;
    color: #a8edea;
    text-decoration: none;
    margin-bottom: 10px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-enlace:hover {
    color: var(--color-destaque);
}

.logos-institucionales {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.logo-footer {
    max-height: 60px;
    width: auto;
    transition: transform 0.2s ease;
}

.logo-footer:hover {
    transform: scale(1.05);
}

.footer-creditos {
    text-align: center;
    border-top: 2px solid #3e206e;
    padding-top: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- BOTÓN DE AUDIO FLOTANTE --- */
.boton-audio {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--color-titulo);
    border: 4px solid var(--color-destaque);
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 4px 6px 0px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    padding: 10px;
}

.boton-audio img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.boton-audio:hover {
    transform: translateY(-4px) scale(1.05);
    background-color: var(--color-boton);
    box-shadow: 4px 10px 0px rgba(0, 0, 0, 0.4);
}

.boton-audio:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
}

/* --- TABLETS (Pantallas medianas, hasta 1024px) --- */
@media (max-width: 1024px) {
    .contenedor-titulo {
        gap: 15px;
    }

    .img-header {
        height: 140px;
    }

    .titulo-taaniku {
        font-size: 3.2rem;
    }

    .fondo-taaniku {
        padding: 10px 25px;
    }

    .tarjeta-presentacion {
        padding: 25px 30px;
    }
}

/* --- CELULARES (Pantallas pequeñas, hasta 768px) --- */
@media (max-width: 768px) {
    .header-principal {
        padding: 20px 10px;
    }

    .contenedor-titulo {
        flex-wrap: nowrap !important;
        gap: 12px;
    }

    .img-header {
        height: 75px !important;
        display: block !important;
    }

    .fondo-taaniku {
        padding: 6px 16px;
        border-width: 5px;
        border-radius: 12px;
    }

    .titulo-taaniku {
        font-size: 1.5rem !important;
        letter-spacing: 1px;
        text-shadow:
            2px 2px 0px #ffffff,
            4px 4px 0px var(--color-destaque),
            5px 5px 0px var(--color-borde) !important;
    }

    h2 {
        font-size: 1.2rem;
        line-height: 1.6;
    }

    .decoracion-estrella {
        font-size: 1.5rem;
    }

    .contenedor-juegos {
        grid-template-columns: 1fr;
    }

    .tarjeta-presentacion {
        padding: 20px 15px;
        border-width: 4px;
    }

    .bloque-personaje, .bloque-personaje.itzel {
        flex-direction: column;
        gap: 15px;
        align-items: center;
        text-align: center;
    }

    .img-presentacion {
        height: 130px;
    }

    .cuadro-dialogo {
        max-width: 95%;
    }

    .cuadro-dialogo::after, .cuadro-dialogo::before {
        display: none;
    }

    .footer-contenido {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }

    .boton-audio {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        border-width: 3px;
        padding: 8px;
    }
}

/* --- CELULARES MUY PEQUEÑOS (hasta 480px) --- */
@media (max-width: 480px) {
    .contenedor-titulo {
        gap: 6px;
    }

    .img-header {
        height: 55px !important;
    }

    .fondo-taaniku {
        padding: 5px 10px;
        border-width: 4px;
    }

    .titulo-taaniku {
        font-size: 1.15rem !important;
        letter-spacing: 0px;
        text-shadow:
            1px 1px 0px #ffffff,
            2px 2px 0px var(--color-destaque),
            3px 3px 0px var(--color-borde) !important;
    }
}
