/* ==========================================================
   VARIABLES
   ========================================================== */

:root {
    --azul: #123b72;
    --azul-claro: #1f78c8;
    --turquesa: #12b8a6;
    --verde: #39c56b;
    --amarillo: #ffd166;
    --naranja: #ff8a3d;
    --morado: #7657d8;

    --texto: #263b4d;
    --texto-suave: #66788a;
    --blanco: #ffffff;

    --sombra: 0 12px 30px rgba(18, 59, 114, 0.09);
    --sombra-fuerte: 0 20px 50px rgba(18, 59, 114, 0.16);
}

/* ==========================================================
   RESET
   ========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    font-family:
        Georgia,
        "Times New Roman",
        Times,
        serif;

    color: var(--texto);

    overflow-x: hidden;

    background:
        linear-gradient(
            rgba(235, 250, 247, .88),
            rgba(238, 246, 255, .90)
        ),
        url("Evidencias/fondo_biologia.png")
        center center / cover fixed no-repeat;

    background-color: #eaf7f4;
}


/* ==========================================================
   DECORACIÓN DE FONDO
   ========================================================== */

body::before {
    content: "";

    position: fixed;

    width: 360px;
    height: 360px;

    left: -130px;
    top: 24%;

    border-radius: 50%;

    background:
        rgba(18, 184, 166, .10);

    filter: blur(70px);

    pointer-events: none;

    z-index: -1;
}

body::after {
    content: "";

    position: fixed;

    width: 430px;
    height: 430px;

    right: -150px;
    bottom: -130px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle,
            rgba(31, 120, 200, .13),
            transparent 65%
        );

    opacity: .75;

    pointer-events: none;

    z-index: -1;
}


/* ==========================================================
   HEADER
   ========================================================== */

header {
    position: sticky;

    top: 0;

    z-index: 1000;

    width: 100%;

    min-height: 86px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 30px;

    padding:
        10px
        clamp(20px, 5vw, 70px);

    background:
        rgba(255, 255, 255, .95);

    border-bottom:
        2px solid
        rgba(18, 184, 166, .15);

    box-shadow:
        0 8px 25px
        rgba(18, 59, 114, .09);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}


/* ==========================================================
   LOGO
   ========================================================== */

.logo {
    display: flex;

    align-items: center;

    gap: 14px;

    flex-shrink: 0;

    color: var(--azul);

    text-decoration: none;

    font-size: 1.15rem;

    font-weight: 700;

    line-height: 1.2;

    transition:
        transform .25s ease;
}

.logo:hover {
    transform:
        translateY(-2px);
}

.logo img {
    width: 58px;
    height: 58px;

    object-fit: cover;

    border-radius: 50%;

    border:
        3px solid white;

    box-shadow:
        0 0 0 4px
        rgba(18, 184, 166, .12),

        0 7px 18px
        rgba(18, 59, 114, .18);
}


/* ==========================================================
   NAVEGACIÓN SUPERIOR
   ========================================================== */

nav {
    display: flex;

    align-items: center;

    justify-content: flex-end;

    flex-wrap: wrap;

    gap: 6px;
}

nav a {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding:
        10px 15px;

    border-radius: 12px;

    color: var(--azul);

    text-decoration: none;

    font-weight: 700;

    font-size: .95rem;

    white-space: nowrap;

    transition:
        background .25s ease,
        color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}

nav a:hover {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--azul-claro),
            var(--turquesa)
        );

    transform:
        translateY(-2px);

    box-shadow:
        0 8px 18px
        rgba(31, 120, 200, .20);
}


/* ==========================================================
   PORTADA
   ========================================================== */

.portada-proyecto {
    position: relative;

    width:
        min(
            1100px,
            calc(100% - 40px)
        );

    margin:
        45px auto 40px;

    padding:
        clamp(45px, 7vw, 75px)
        clamp(25px, 6vw, 70px);

    overflow: hidden;

    text-align: center;

    color: white;

    background:
        linear-gradient(
            135deg,
            rgba(18, 59, 114, .98),
            rgba(31, 120, 200, .94) 55%,
            rgba(18, 184, 166, .94)
        );

    border-radius: 30px;

    box-shadow:
        0 25px 60px
        rgba(18, 59, 114, .22);

    isolation: isolate;

    animation:
        aparecer .7s ease both;
}

.portada-proyecto::before {
    content: "";

    position: absolute;

    width: 300px;
    height: 300px;

    right: -120px;
    top: -140px;

    border-radius: 50%;

    background:
        rgba(255, 209, 102, .14);

    box-shadow:
        -130px 220px 0 35px
        rgba(57, 197, 107, .10),

        -300px 40px 0 65px
        rgba(255, 255, 255, .05);

    pointer-events: none;
}

.portada-proyecto::after {
    content: "";

    position: absolute;

    width: 12px;
    height: 12px;

    left: 9%;
    bottom: 20%;

    border-radius: 50%;

    background:
        var(--amarillo);

    box-shadow:
        55px 25px 0 4px
        rgba(255,255,255,.65),

        110px -15px 0 7px
        rgba(57,197,107,.65),

        165px 35px 0 3px
        rgba(255,209,102,.7);

    pointer-events: none;

    animation:
        particula 4s ease-in-out infinite alternate;
}

.portada-proyecto .institucion {
    position: relative;

    z-index: 2;

    margin-bottom: 22px;

    color:
        rgba(255,255,255,.82);

    font-size: .88rem;

    font-weight: 600;

    letter-spacing: 2px;

    text-transform: uppercase;
}

.portada-proyecto h1 {
    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 900px;

    margin:
        0 auto;

    color: white;

    font-family:
        Georgia,
        "Times New Roman",
        Times,
        serif;

    font-size:
        clamp(
            1.8rem,
            4vw,
            3rem
        );

    font-weight: 700;

    line-height: 1.25;

    text-align: center;

    text-wrap: balance;

    text-shadow:
        0 4px 18px
        rgba(0,0,0,.20);
}

.portada-proyecto .linea-decorativa {
    position: relative;

    z-index: 2;

    width: 110px;
    height: 5px;

    margin:
        28px auto;

    border-radius: 999px;

    background:
        linear-gradient(
            90deg,
            var(--amarillo),
            white,
            var(--verde)
        );

    box-shadow:
        0 0 20px
        rgba(255,209,102,.45);
}

.portada-proyecto .detalle-proyecto {
    position: relative;

    z-index: 2;

    color:
        rgba(255,255,255,.90);

    font-size: 1rem;

    font-style: italic;
}


/* ==========================================================
   PROYECTO
   ========================================================== */

.proyecto {
    width: 100%;

    max-width: 1500px;

    margin:
        0 auto 60px;

    /*
       El índice ocupa aproximadamente 270px.
       Dejamos espacio para que el contenido quede
       completamente a la derecha.
    */
    padding:
        0 35px 70px 340px;

    position: relative;
}


/* ==========================================================
   CONTENEDOR PRINCIPAL
   ========================================================== */

.contenedor-proyecto {
    display: block;

    width: 100%;

    max-width: none;

    margin: 0;

    padding: 0;
}


/* ==========================================================
   CONTENIDO PRINCIPAL
   ========================================================== */

.contenido-proyecto {
    display: block;

    width: 100%;

    max-width: 1050px;

    min-width: 0;

    margin:
        0 auto;

    padding: 0;
}


/* ==========================================================
   ÍNDICE FIJO
   ========================================================== */

.indice-proyecto {
    position: fixed;

    top: 105px;

    left: 30px;

    width: 270px;

    height:
        calc(100vh - 125px);

    max-height: none;

    overflow-y: auto;

    margin: 0;

    padding:
        22px 18px;

    box-sizing: border-box;

    z-index: 900;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.98),
            rgba(240,252,249,.96)
        );

    border:
        1px solid
        rgba(18,184,166,.20);

    border-left:
        5px solid
        var(--turquesa);

    border-radius: 20px;

    box-shadow:
        0 18px 45px
        rgba(18,59,114,.14),

        0 0 0 4px
        rgba(255,255,255,.35);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    scrollbar-width: thin;

    scrollbar-color:
        var(--turquesa)
        transparent;

    /*
       OCULTO AL INICIO.
       JavaScript añade .menu-visible cuando
       Pregunta Problema entra en la zona indicada.
    */
    opacity: 0;

    visibility: hidden;

    transform:
        translateX(-35px);

    pointer-events: none;

    transition:
        opacity .45s ease,
        transform .45s ease,
        visibility .45s ease;
}


/* ==========================================================
   ÍNDICE VISIBLE
   ========================================================== */

.indice-proyecto.menu-visible {
    opacity: 1;

    visibility: visible;

    transform:
        translateX(0);

    pointer-events: auto;
}


/* ==========================================================
   SÍMBOLO DEL ÍNDICE
   ========================================================== */

.indice-proyecto::before {
    content: "🧬";

    display: grid;

    place-items: center;

    width: 48px;
    height: 48px;

    margin:
        0 auto 12px;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--azul-claro),
            var(--turquesa)
        );

    border:
        4px solid white;

    box-shadow:
        0 7px 18px
        rgba(18,184,166,.22);

    font-size: 1.5rem;
}


/* ==========================================================
   TÍTULO DEL ÍNDICE
   ========================================================== */

.indice-proyecto h3 {
    margin:
        0 0 18px;

    padding-bottom: 12px;

    text-align: center;

    color:
        var(--azul);

    font-size: 1.18rem;

    border-bottom:
        2px solid
        rgba(18,184,166,.15);
}


/* ==========================================================
   LÍNEA DEL ÍNDICE
   ========================================================== */

.linea-tiempo {
    padding-left: 16px;

    margin-left: 5px;

    border-left:
        3px solid
        rgba(18,184,166,.40);
}

.linea-tiempo div {
    position: relative;

    margin: 5px 0;

    padding: 0;
}


/* ==========================================================
   ENLACES DEL ÍNDICE
   ========================================================== */

.enlace-indice {
    display: block;

    padding:
        9px 10px;

    margin:
        3px 0;

    border-radius: 9px;

    color:
        #23445e;

    font-size: .91rem;

    line-height: 1.35;

    text-decoration: none;

    transition:
        transform .22s ease,
        color .22s ease,
        background .22s ease,
        box-shadow .22s ease;
}

.enlace-indice:hover {
    color: white;

    background:
        linear-gradient(
            90deg,
            var(--azul-claro),
            var(--turquesa)
        );

    transform:
        translateX(4px);

    box-shadow:
        0 6px 14px
        rgba(18,184,166,.18);
}

.enlace-indice.activo {
    color:
        var(--azul);

    font-weight: 800;

    background:
        linear-gradient(
            90deg,
            rgba(255,209,102,.38),
            rgba(255,255,255,.65)
        );

    transform:
        translateX(4px);

    box-shadow:
        inset 4px 0 0
        var(--amarillo);
}


/* ==========================================================
   PUNTOS DEL ÍNDICE
   ========================================================== */

.linea-tiempo div::before {
    content: "";

    position: absolute;

    width: 8px;
    height: 8px;

    left: -21px;
    top: 50%;

    transform:
        translateY(-50%);

    background:
        var(--amarillo);

    border:
        2px solid white;

    border-radius: 50%;

    box-shadow:
        0 0 0 2px
        rgba(18,184,166,.18);
}

.linea-tiempo div:has(
    .enlace-indice.activo
)::before {
    width: 11px;
    height: 11px;

    left: -23px;

    background:
        var(--turquesa);

    box-shadow:
        0 0 0 4px
        rgba(18,184,166,.18),

        0 0 14px
        rgba(18,184,166,.35);
}


/* ==========================================================
   SCROLLBAR DEL ÍNDICE
   ========================================================== */

.indice-proyecto::-webkit-scrollbar {
    width: 6px;
}

.indice-proyecto::-webkit-scrollbar-track {
    background: transparent;
}

.indice-proyecto::-webkit-scrollbar-thumb {
    background:
        linear-gradient(
            var(--azul-claro),
            var(--turquesa)
        );

    border-radius: 20px;
}


/* ==========================================================
   SECCIONES DEL PROYECTO
   ========================================================== */

.contenido-proyecto
.seccion-proyecto {
    width: 100%;

    margin:
        0 0 22px;

    padding: 0;

    background:
        rgba(255,255,255,.95);

    border-radius: 20px;

    border:
        1px solid
        rgba(31,120,200,.10);

    border-left:
        6px solid
        var(--turquesa);

    box-shadow:
        0 12px 30px
        rgba(18,59,114,.09);

    overflow: hidden;

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.contenido-proyecto
.seccion-proyecto:hover {
    transform:
        translateY(-2px);

    box-shadow:
        0 17px 38px
        rgba(18,59,114,.12);
}

.contenido-proyecto
.seccion-proyecto:nth-child(3n+1) {
    border-left-color:
        var(--turquesa);
}

.contenido-proyecto
.seccion-proyecto:nth-child(3n+2) {
    border-left-color:
        var(--morado);
}

.contenido-proyecto
.seccion-proyecto:nth-child(3n) {
    border-left-color:
        var(--naranja);
}


/* ==========================================================
   TÍTULOS DE LAS SECCIONES
   ========================================================== */

.contenido-proyecto
.seccion-proyecto
summary {
    position: relative;

    display: flex;

    align-items: center;

    width: 100%;

    min-height: 68px;

    padding:
        18px 65px 18px 27px;

    cursor: pointer;

    color:
        var(--azul);

    font-size: 1.12rem;

    font-weight: 800;

    line-height: 1.35;

    background:
        linear-gradient(
            90deg,
            rgba(31,120,200,.06),
            rgba(18,184,166,.04)
        );

    list-style: none;

    transition:
        background .25s ease,
        color .25s ease;
}

.contenido-proyecto
.seccion-proyecto
summary::-webkit-details-marker {
    display: none;
}

.contenido-proyecto
.seccion-proyecto
summary:hover {
    background:
        linear-gradient(
            90deg,
            rgba(31,120,200,.11),
            rgba(18,184,166,.08)
        );
}


/* ==========================================================
   BOTÓN + / -
   ========================================================== */

.contenido-proyecto
.seccion-proyecto
summary::after {
    content: "+";

    position: absolute;

    right: 20px;

    top: 50%;

    transform:
        translateY(-50%);

    width: 32px;
    height: 32px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    background:
        var(--turquesa);

    color: white;

    font-size: 1.3rem;

    font-weight: 400;

    line-height: 1;

    box-shadow:
        0 5px 12px
        rgba(18,184,166,.22);

    transition:
        transform .25s ease,
        background .25s ease;
}

.contenido-proyecto
.seccion-proyecto[open]
summary::after {
    content: "−";

    background:
        var(--morado);

    transform:
        translateY(-50%);
}


/* ==========================================================
   IMPORTANTE:
   EL TÍTULO NO DESAPARECE AL ABRIR
   ========================================================== */

.contenido-proyecto
.seccion-proyecto[open]
summary {
    color:
        var(--azul) !important;

    background:
        linear-gradient(
            90deg,
            rgba(31,120,200,.08),
            rgba(18,184,166,.06)
        );

    text-shadow: none;
}

.contenido-proyecto
.seccion-proyecto[open]
summary:hover {
    color:
        var(--azul) !important;

    background:
        linear-gradient(
            90deg,
            rgba(31,120,200,.13),
            rgba(18,184,166,.10)
        );
}


/* ==========================================================
   CONTENIDO INTERNO
   ========================================================== */

.contenido-seccion {
    width: 100%;

    padding:
        28px 35px 35px;

    background:
        rgba(255,255,255,.90);

    animation:
        desplegar .3s ease both;
}

.contenido-seccion p {
    margin-bottom: 18px;

    color:
        #30485e;

    font-size: 1rem;

    line-height: 1.8;

    text-align: justify;
}

.contenido-seccion p:last-child {
    margin-bottom: 0;
}

.contenido-seccion ul {
    padding-left: 25px;

    margin-bottom: 18px;
}

.contenido-seccion li {
    margin-bottom: 10px;

    color:
        #30485e;

    line-height: 1.75;
}

.contenido-seccion h3,
.seccion-proyecto h3 {
    display: inline-block;

    margin:
        18px 0 12px;

    padding:
        8px 14px;

    border-radius: 10px;

    background:
        rgba(18,184,166,.10);

    color:
        var(--azul);

    font-size: 1rem;
}


/* ==========================================================
   FIGURAS E IMÁGENES
   ========================================================== */

.contenido-proyecto figure {
    width: 100%;

    max-width: 900px;

    margin:
        30px auto;

    padding: 18px;

    text-align: center;

    background:
        rgba(255,255,255,.85);

    border:
        1px solid
        rgba(31,120,200,.10);

    border-radius: 18px;

    box-shadow:
        0 10px 28px
        rgba(18,59,114,.08);
}

.contenido-proyecto
figure img,
.contenido-proyecto
figure .figura,
.figura {
    display: block;

    width: 100%;

    max-width: 760px;

    max-height: 650px;

    height: auto;

    margin:
        15px auto;

    object-fit: contain;

    border-radius: 14px;

    box-shadow:
        0 8px 22px
        rgba(18,59,114,.12);

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}

.contenido-proyecto
figure img:hover,
.contenido-proyecto
figure .figura:hover,
.figura:hover {
    transform:
        scale(1.02);

    box-shadow:
        0 15px 35px
        rgba(18,59,114,.18);
}

.titulo-figura {
    color:
        var(--azul);

    line-height: 1.5;
}

.nota-figura {
    color:
        var(--texto-suave);

    font-size: .92rem;

    line-height: 1.5;
}


/* ==========================================================
   BOTONES
   ========================================================== */

.boton,
.boton-pdf {
    display: inline-block;

    border: none;

    padding:
        11px 20px;

    border-radius: 12px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--naranja),
            #ff5e62
        );

    text-decoration: none;

    font-weight: 800;

    box-shadow:
        0 8px 18px
        rgba(255,138,61,.20);

    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.boton:hover,
.boton-pdf:hover {
    transform:
        translateY(-3px);

    background:
        linear-gradient(
            135deg,
            var(--turquesa),
            var(--azul-claro)
        );

    box-shadow:
        0 12px 25px
        rgba(18,184,166,.23);
}


/* ==========================================================
   FOOTER
   ========================================================== */

footer {
    margin-top: 60px;

    padding: 25px;

    text-align: center;

    color: white;

    background:
        linear-gradient(
            135deg,
            #123b72,
            #176e9f,
            #12a98f
        );

    border-radius:
        28px 28px 0 0;

    box-shadow:
        0 -12px 30px
        rgba(18,59,114,.10);
}


/* ==========================================================
   ANIMACIONES
   ========================================================== */

@keyframes aparecer {
    from {
        opacity: 0;

        transform:
            translateY(20px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes desplegar {
    from {
        opacity: 0;

        transform:
            translateY(-6px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }
}

@keyframes particula {
    from {
        transform:
            translate(0, 0)
            scale(1);
    }

    to {
        transform:
            translate(30px, -15px)
            scale(1.15);
    }
}


/* ==========================================================
   TABLET
   ========================================================== */

@media (max-width: 1100px) and (min-width: 801px) {

    .proyecto {
        padding-left: 310px;

        padding-right: 25px;
    }

    .indice-proyecto {
        left: 20px;

        width: 260px;
    }

    .contenido-proyecto {
        max-width: 100%;
    }

    .enlace-indice {
        font-size: .87rem;

        padding: 8px;
    }
}


/* ==========================================================
   TABLET / CELULAR
   ========================================================== */

@media (max-width: 800px) {

    header {
        position: relative;

        flex-direction: column;

        justify-content: center;

        gap: 12px;

        padding:
            15px 20px;
    }

    .logo {
        justify-content: center;

        text-align: center;
    }

    nav {
        width: 100%;

        justify-content: center;
    }

    nav a {
        padding:
            9px 11px;

        font-size: .88rem;
    }

    .portada-proyecto {
        width:
            calc(100% - 30px);

        margin:
            30px auto;

        padding:
            45px 25px;
    }

    .proyecto {
        width: 100%;

        padding:
            0 15px 50px;
    }

    .contenedor-proyecto {
        display: flex;

        flex-direction: column;

        gap: 25px;
    }

    .contenido-proyecto {
        width: 100%;

        max-width: none;

        order: 1;
    }

    /*
       En móvil el índice deja de ser fixed.
       También queda visible normalmente.
    */
    .indice-proyecto {
        position: relative;

        top: auto;
        left: auto;

        width: 100%;

        height: auto;

        max-height: 330px;

        margin:
            25px 0 0;

        order: 2;

        opacity: 1;

        visibility: visible;

        transform: none;

        pointer-events: auto;
    }
}


/* ==========================================================
   CELULAR
   ========================================================== */

@media (max-width: 600px) {

    body {
        background-attachment: scroll;
    }

    header {
        min-height: auto;

        padding:
            12px 15px;
    }

    .logo {
        font-size: .95rem;
    }

    .logo img {
        width: 50px;
        height: 50px;
    }

    nav {
        gap: 4px;
    }

    nav a {
        padding:
            8px 9px;

        font-size: .80rem;
    }

    .portada-proyecto {
        width:
            calc(100% - 24px);

        margin:
            25px auto;

        padding:
            38px 18px;

        border-radius: 22px;
    }

    .portada-proyecto .institucion {
        font-size: .72rem;

        letter-spacing: 1px;
    }

    .portada-proyecto h1 {
        font-size: 1.65rem;

        line-height: 1.3;
    }

    .portada-proyecto .detalle-proyecto {
        font-size: .90rem;
    }

    .proyecto {
        width:
            calc(100% - 24px);
    }

    .seccion-proyecto {
        border-radius: 17px;

        margin-bottom: 17px;
    }

    .contenido-proyecto
    .seccion-proyecto
    summary {
        min-height: 62px;

        padding:
            16px 55px 16px 19px;

        font-size: .98rem;
    }

    .contenido-proyecto
    .seccion-proyecto
    summary::after {
        right: 15px;

        width: 29px;
        height: 29px;
    }

    .contenido-seccion {
        padding:
            22px 18px 28px;
    }

    .contenido-seccion p {
        font-size: .95rem;

        line-height: 1.7;

        text-align: left;
    }

    .contenido-proyecto figure {
        padding: 10px;

        margin:
            25px auto;
    }

    .indice-proyecto {
        padding:
            20px 15px;

        border-radius: 18px;

        max-height: 300px;
    }

    .indice-proyecto::before {
        width: 44px;
        height: 44px;

        font-size: 1.3rem;
    }

    .enlace-indice {
        font-size: .85rem;

        padding: 8px;
    }
}


/* ==========================================================
   ACCESIBILIDAD
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;

        animation-iteration-count: 1 !important;

        scroll-behavior: auto !important;

        transition-duration: .01ms !important;
    }
}

/* ==========================================================
   ASISTENTE DE INTELIGENCIA ARTIFICIAL
   ========================================================== */


/* ----------------------------------------------------------
   CONTENEDOR GENERAL
   ---------------------------------------------------------- */

.asistente-ia {
    position: fixed;

    right: 28px;
    bottom: 28px;

    z-index: 2000;

    font-family:
        Georgia,
        "Times New Roman",
        Times,
        serif;
}


/* ----------------------------------------------------------
   BOTÓN FLOTANTE
   ---------------------------------------------------------- */

.boton-abrir-ia {
    width: 62px;
    height: 62px;

    border: 4px solid white;

    border-radius: 50%;

    cursor: pointer;

    display: flex;

    align-items: center;
    justify-content: center;

    font-size: 1.7rem;

    background:
        linear-gradient(
            135deg,
            var(--azul-claro),
            var(--turquesa)
        );

    box-shadow:
        0 10px 28px
        rgba(18, 59, 114, .25),

        0 0 0 5px
        rgba(18, 184, 166, .12);

    transition:
        transform .3s ease,
        box-shadow .3s ease;
}


.boton-abrir-ia:hover {
    transform:
        scale(1.08)
        translateY(-3px);

    box-shadow:
        0 15px 35px
        rgba(18, 59, 114, .30),

        0 0 0 7px
        rgba(18, 184, 166, .14);
}


/* ----------------------------------------------------------
   PEQUEÑA ANIMACIÓN DE ATENCIÓN
   ---------------------------------------------------------- */

.boton-abrir-ia::before {
    content: "";

    position: absolute;

    width: 62px;
    height: 62px;

    border-radius: 50%;

    border:
        2px solid
        rgba(18,184,166,.45);

    animation:
        pulso-ia 2.5s infinite;

    pointer-events: none;
}


@keyframes pulso-ia {

    0% {
        transform: scale(1);

        opacity: .8;
    }

    70% {
        transform: scale(1.35);

        opacity: 0;
    }

    100% {
        transform: scale(1.35);

        opacity: 0;
    }
}


/* ----------------------------------------------------------
   VENTANA
   ---------------------------------------------------------- */

.ventana-ia {
    position: absolute;

    right: 0;

    bottom: 78px;

    width: 390px;

    max-width:
        calc(100vw - 35px);

    height: 570px;

    max-height:
        calc(100vh - 120px);

    display: flex;

    flex-direction: column;

    overflow: hidden;

    background:
        rgba(255,255,255,.97);

    border:
        1px solid
        rgba(18,184,166,.20);

    border-radius: 24px;

    box-shadow:
        0 25px 70px
        rgba(18,59,114,.22),

        0 0 0 5px
        rgba(255,255,255,.55);

    backdrop-filter:
        blur(18px);

    -webkit-backdrop-filter:
        blur(18px);

    opacity: 0;

    visibility: hidden;

    transform:
        translateY(20px)
        scale(.95);

    pointer-events: none;

    transition:
        opacity .3s ease,
        transform .3s ease,
        visibility .3s ease;
}


/* ----------------------------------------------------------
   VENTANA ABIERTA
   ---------------------------------------------------------- */

.asistente-ia.abierto
.ventana-ia {

    opacity: 1;

    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* ----------------------------------------------------------
   CABECERA
   ---------------------------------------------------------- */

.cabecera-ia {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding:
        15px 16px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--azul),
            var(--azul-claro),
            var(--turquesa)
        );

    flex-shrink: 0;
}


.identidad-ia {

    display: flex;

    align-items: center;

    gap: 11px;
}


.identidad-ia strong {

    display: block;

    font-size:
        1rem;

    line-height: 1.2;
}


.identidad-ia span {

    display: block;

    margin-top: 3px;

    color:
        rgba(255,255,255,.78);

    font-size:
        .75rem;
}


/* ----------------------------------------------------------
   ICONO IA
   ---------------------------------------------------------- */

.icono-ia {

    width: 42px;
    height: 42px;

    display: grid;

    place-items: center;

    flex-shrink: 0;

    border-radius: 50%;

    background:
        rgba(255,255,255,.17);

    border:
        2px solid
        rgba(255,255,255,.40);

    font-size:
        1.25rem;
}


/* ----------------------------------------------------------
   CERRAR
   ---------------------------------------------------------- */

.cerrar-ia {

    width: 34px;
    height: 34px;

    display: grid;

    place-items: center;

    border: none;

    border-radius: 50%;

    cursor: pointer;

    color: white;

    background:
        rgba(255,255,255,.14);

    font-size:
        1.5rem;

    line-height: 1;

    transition:
        background .2s ease,
        transform .2s ease;
}


.cerrar-ia:hover {

    background:
        rgba(255,255,255,.25);

    transform:
        rotate(90deg);
}


/* ----------------------------------------------------------
   CUERPO DEL CHAT
   ---------------------------------------------------------- */

.mensajes-ia {

    flex: 1;

    min-height: 0;

    overflow-y: auto;

    padding:
        18px;

    background:
        linear-gradient(
            180deg,
            rgba(240,252,249,.72),
            rgba(246,249,255,.85)
        );

    scrollbar-width: thin;

    scrollbar-color:
        var(--turquesa)
        transparent;
}


.mensajes-ia::-webkit-scrollbar {
    width: 6px;
}


.mensajes-ia::-webkit-scrollbar-thumb {

    background:
        var(--turquesa);

    border-radius:
        20px;
}


/* ----------------------------------------------------------
   MENSAJES
   ---------------------------------------------------------- */

.mensaje {

    display: flex;

    align-items: flex-start;

    gap: 9px;

    margin-bottom: 15px;
}


.avatar-mensaje {

    width: 32px;
    height: 32px;

    display: grid;

    place-items: center;

    flex-shrink: 0;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--azul-claro),
            var(--turquesa)
        );

    color: white;

    font-size:
        .9rem;
}


.burbuja-mensaje {

    max-width: 88%;

    padding:
        12px 14px;

    border-radius:
        5px 17px 17px 17px;

    background:
        white;

    border:
        1px solid
        rgba(18,184,166,.10);

    box-shadow:
        0 5px 15px
        rgba(18,59,114,.07);

    color:
        var(--texto);

    font-size:
        .87rem;

    line-height:
        1.55;
}


.burbuja-mensaje strong {

    color:
        var(--azul);

    font-size:
        .92rem;
}


.burbuja-mensaje p {

    margin:
        5px 0 0;
}


/* ----------------------------------------------------------
   MENSAJE DEL USUARIO
   ---------------------------------------------------------- */

.mensaje-usuario {

    justify-content:
        flex-end;
}


.mensaje-usuario
.burbuja-mensaje {

    border-radius:
        17px 5px 17px 17px;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--azul-claro),
            var(--turquesa)
        );
}


.mensaje-usuario
.burbuja-mensaje strong {

    color: white;
}


/* ----------------------------------------------------------
   PREGUNTAS SUGERIDAS
   ---------------------------------------------------------- */

.preguntas-ia {

    display: flex;

    flex-direction: column;

    gap: 7px;

    margin-top: 15px;
}


.preguntas-ia > span {

    margin-bottom: 3px;

    color:
        var(--texto-suave);

    font-size:
        .76rem;

    font-weight:
        700;

    text-transform:
        uppercase;

    letter-spacing:
        .5px;
}


.pregunta-rapida {

    width: 100%;

    padding:
        9px 12px;

    text-align: left;

    border:
        1px solid
        rgba(18,184,166,.20);

    border-radius:
        11px;

    cursor: pointer;

    color:
        var(--azul);

    background:
        rgba(255,255,255,.85);

    font-family:
        inherit;

    font-size:
        .80rem;

    line-height:
        1.35;

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease,
        border-color .2s ease;
}


.pregunta-rapida:hover {

    color: white;

    background:
        linear-gradient(
            90deg,
            var(--azul-claro),
            var(--turquesa)
        );

    border-color:
        transparent;

    transform:
        translateX(3px);
}


/* ----------------------------------------------------------
   ENTRADA
   ---------------------------------------------------------- */

.entrada-ia {

    display: flex;

    align-items: center;

    gap: 8px;

    padding:
        12px 14px;

    background:
        white;

    border-top:
        1px solid
        rgba(18,184,166,.12);
}


.entrada-ia input {

    flex: 1;

    min-width: 0;

    height: 42px;

    padding:
        0 13px;

    border:
        1px solid
        rgba(18,59,114,.14);

    border-radius:
        12px;

    outline: none;

    color:
        var(--texto);

    background:
        #f7fbfc;

    font-family:
        inherit;

    font-size:
        .87rem;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}


.entrada-ia input:focus {

    border-color:
        var(--turquesa);

    box-shadow:
        0 0 0 3px
        rgba(18,184,166,.10);
}


.entrada-ia button {

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    border: none;

    border-radius:
        12px;

    cursor: pointer;

    color: white;

    background:
        linear-gradient(
            135deg,
            var(--azul-claro),
            var(--turquesa)
        );

    font-size:
        1rem;

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}


.entrada-ia button:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 7px 15px
        rgba(18,184,166,.25);
}


/* ----------------------------------------------------------
   ESTADO / AVISO
   ---------------------------------------------------------- */

.estado-ia {

    padding:
        0 15px 10px;

    text-align:
        center;

    color:
        #8998a5;

    background:
        white;

    font-size:
        .66rem;
}


/* ==========================================================
   CELULAR
   ========================================================== */

@media (max-width: 600px) {

    .asistente-ia {

        right: 16px;

        bottom: 18px;
    }


    .boton-abrir-ia {

        width: 57px;
        height: 57px;

        font-size:
            1.5rem;
    }


    .boton-abrir-ia::before {

        width: 57px;
        height: 57px;
    }


    .ventana-ia {

        right: -2px;

        bottom: 70px;

        width:
            calc(100vw - 32px);

        max-width:
            calc(100vw - 32px);

        height:
            min(590px, calc(100vh - 100px));

        border-radius:
            21px;
    }
}
/* ==========================================================
   FUENTE DEL CHATBOT
   ========================================================== */

.fuente-ia {
    margin-top: 10px;
    padding-top: 8px;

    border-top: 1px solid rgba(18, 184, 166, 0.15);

    color: var(--texto-suave);

    font-size: 0.70rem;
    line-height: 1.4;
}


.fuente-ia strong {
    color: var(--azul);
}


/* Botón que lleva a la sección */

.enlace-fuente-ia {
    display: inline-block;

    margin-top: 4px;

    padding: 5px 8px;

    border: none;
    border-radius: 7px;

    cursor: pointer;

    color: var(--azul);

    background: rgba(18, 184, 166, 0.08);

    font-family: inherit;

    font-size: 0.70rem;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}


.enlace-fuente-ia:hover {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--azul-claro),
            var(--turquesa)
        );

    transform: translateX(3px);
}


/* ==========================================================
   RESALTAR LA SECCIÓN ENCONTRADA
   ========================================================== */

.seccion-resaltada-ia {
    animation:
        resaltarSeccionIA 2.5s ease;
}


@keyframes resaltarSeccionIA {

    0% {
        box-shadow:
            0 0 0 0
            rgba(18, 184, 166, 0.55);
    }

    30% {
        box-shadow:
            0 0 0 8px
            rgba(18, 184, 166, 0.18);
    }

    70% {
        box-shadow:
            0 0 0 8px
            rgba(18, 184, 166, 0.12);
    }

    100% {
        box-shadow:
            0 0 0 0
            rgba(18, 184, 166, 0);
    }

}

/* ==========================================================
   ACTIVIDAD 1: ARMA LA CÉLULA (3 niveles)
   ========================================================== */

[hidden] { display: none !important; }

.cancha-juego, .circ-juego { margin-top: 22px; }

.cancha-niveles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.cancha-tab {
    padding: 9px 16px; border: 2px solid var(--azul-claro); border-radius: 999px;
    background: #fff; color: var(--azul); font-family: inherit; font-size: 14px; cursor: pointer;
}
.cancha-tab.activo { background: var(--azul); color: #fff; border-color: var(--azul); }
.cancha-tab:disabled { opacity: .45; cursor: not-allowed; }

.cancha-marcador {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
    font-size: 15px; color: var(--azul); margin-bottom: 10px;
}

.cancha-mensaje {
    min-height: 52px; padding: 12px 16px; margin: 0 0 14px; border-radius: 14px;
    background: rgba(31, 120, 200, .10); border-left: 5px solid var(--azul-claro);
    color: var(--texto); font-size: 15px; line-height: 1.5;
}
.cancha-mensaje.ok { background: rgba(57, 197, 107, .16); border-left-color: var(--verde); }
.cancha-mensaje.mal { background: rgba(255, 138, 61, .16); border-left-color: var(--naranja); }
.cancha-mensaje.final { background: rgba(255, 209, 102, .30); border-left-color: var(--amarillo); }

.cancha-campo {
    position: relative; display: grid; grid-template-columns: 1fr 1.4fr 1fr;
    border: 4px solid #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--sombra);
    background: repeating-linear-gradient(90deg, #2f9e55 0 70px, #38b063 70px 140px);
}
.cancha-zona {
    position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 12px;
    min-height: 260px; border-right: 3px solid rgba(255, 255, 255, .85); color: #fff;
    transition: background .2s, box-shadow .2s;
}
.cancha-zona:last-child { border-right: none; }
.cancha-zona-centro::before {
    content: ""; position: absolute; top: 50%; left: 50%; width: 150px; height: 150px;
    transform: translate(-50%, -50%); border: 3px solid rgba(255, 255, 255, .7);
    border-radius: 50%; pointer-events: none;
}
.cancha-zona-titulo, .cancha-pista { position: relative; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.cancha-zona-titulo { font-weight: bold; font-size: 15px; }
.cancha-pista { font-size: 13px; line-height: 1.35; }
.cancha-slot {
    position: relative; flex: 1; display: flex; flex-wrap: wrap; align-content: center;
    justify-content: center; gap: 8px; min-height: 90px; margin-top: 6px; padding: 8px;
    border: 2px dashed rgba(255, 255, 255, .75); border-radius: 12px; background: rgba(255, 255, 255, .12);
}
.cancha-zona.resaltada, .circ-puerta.resaltada { box-shadow: inset 0 0 0 4px var(--amarillo); background: rgba(255, 209, 102, .30); }
.cancha-zona.error, .circ-puerta.error { animation: canchaSacudir .4s; }
@keyframes canchaSacudir {
    0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); }
}

.cancha-banca-titulo { margin: 18px 0 8px; font-weight: bold; color: var(--azul); }
.cancha-fichas {
    display: flex; flex-wrap: wrap; gap: 12px; min-height: 70px; padding: 14px;
    border-radius: 14px; background: rgba(255, 255, 255, .75); box-shadow: var(--sombra);
}
.cancha-ficha {
    display: flex; flex-direction: column; align-items: center; padding: 9px 16px; border-radius: 14px;
    background: #fff; border: 2px solid var(--azul-claro); color: var(--azul); font-weight: bold;
    font-size: 15px; line-height: 1.2; box-shadow: 0 4px 10px rgba(18, 59, 114, .15);
    cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
    transition: transform .15s;
}
.cancha-ficha small { font-weight: normal; font-size: 12px; color: var(--texto-suave); }
.cancha-ficha:hover { transform: translateY(-2px); }
.cancha-ficha.seleccionada { background: var(--amarillo); border-color: var(--naranja); transform: scale(1.06); }
.cancha-ficha.colocada { background: #e6f9ee; border-color: var(--verde); cursor: default; touch-action: auto; }
.cancha-ficha.colocada:hover { transform: none; }
.cancha-ficha.arrastrando-origen { opacity: .35; }
.cancha-fantasma {
    position: fixed; z-index: 9999; pointer-events: none;
    transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 14px 30px rgba(18, 59, 114, .35);
}

/* Niveles 2 y 3 */
.cancha-paso {
    padding: 16px 18px; margin-bottom: 14px; border-radius: 14px; background: #fff;
    box-shadow: var(--sombra); color: var(--texto); font-size: 16px; line-height: 1.5;
}
.cancha-paso strong { display: block; color: var(--azul); margin-bottom: 4px; }
.cancha-opciones { display: flex; flex-wrap: wrap; gap: 10px; }
.cancha-opciones-col { flex-direction: column; }
.cancha-op {
    padding: 11px 18px; border: 2px solid var(--azul-claro); border-radius: 12px; background: #fff;
    color: var(--azul); font-family: inherit; font-size: 15px; font-weight: bold; text-align: left; cursor: pointer;
    transition: transform .15s, background .2s;
}
.cancha-op:hover:not(:disabled) { transform: translateY(-2px); background: #eef6ff; }
.cancha-op.ok { background: #e6f9ee; border-color: var(--verde); }
.cancha-op.mal { background: #fff0e6; border-color: var(--naranja); opacity: .6; }
.cancha-op:disabled { cursor: default; }

.cancha-reiniciar {
    margin-top: 16px; padding: 10px 20px; border: none; border-radius: 999px; background: var(--azul);
    color: #fff; font-family: inherit; font-size: 14px; cursor: pointer;
}
.cancha-reiniciar:hover { background: var(--azul-claro); }

/* ==========================================================
   ACTIVIDAD 2: EL CIRCUITO DE LA ENERGÍA
   ========================================================== */

.circ-pista {
    position: relative; height: 78px; margin-bottom: 12px; border-radius: 14px;
    background: linear-gradient(#d9534f 0 0) center/100% 6px no-repeat, #fff; box-shadow: var(--sombra);
}
.circ-marca {
    position: absolute; top: 8px; transform: translateX(-50%); font-size: 12px; font-weight: bold;
    color: var(--azul); white-space: nowrap;
}
.circ-atleta {
    position: absolute; bottom: 12px; left: 6%; font-size: 34px; transform: translateX(-50%) scaleX(-1);
    transition: left .8s ease;
}
.circ-meta { position: absolute; right: 10px; bottom: 12px; font-size: 28px; }

.circ-energia { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: var(--azul); font-weight: bold; }
.circ-barra { flex: 1; height: 20px; border-radius: 999px; background: #dfe8f3; overflow: hidden; }
.circ-relleno { height: 100%; width: 40%; background: var(--verde); border-radius: 999px; transition: width .4s, background .4s; }
.circ-relleno.bajo { background: var(--naranja); }

.circ-escena { padding: 20px; margin-bottom: 14px; border-radius: 18px; background: #fff; box-shadow: var(--sombra); min-height: 240px; transition: background .6s; }
.circ-escena.e3 { background: radial-gradient(ellipse at center, #ffd58a 0%, #f0709a 55%, #7b3fa8 100%); color: #fff; }
.circ-pregunta { font-size: 17px; line-height: 1.5; margin-bottom: 14px; color: var(--texto); }
.circ-escena.e3 .circ-pregunta { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.circ-siguiente { margin-top: 14px; }

.circ-puertas { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.circ-puerta {
    padding: 18px 12px; border-radius: 16px; text-align: center; font-weight: bold; line-height: 1.4;
    border: 3px dashed var(--azul-claro); background: #eef6ff; color: var(--azul); cursor: pointer; min-height: 110px;
}
.circ-puerta small { display: block; font-weight: normal; margin-top: 6px; color: var(--texto-suave); }
.circ-token { display: flex; justify-content: center; }

.circ-rueda { position: relative; width: min(340px, 100%); aspect-ratio: 1; margin: 0 auto; }
.circ-rueda::before {
    content: ""; position: absolute; inset: 12%; border-radius: 50%; border: 4px dashed rgba(255, 255, 255, .6);
    animation: circGirar 14s linear infinite;
}
@keyframes circGirar { to { transform: rotate(360deg); } }
.circ-centro {
    position: absolute; top: 50%; left: 50%; width: 46%; transform: translate(-50%, -50%);
    text-align: center; font-size: 14px; line-height: 1.35; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.circ-nodo {
    position: absolute; width: 94px; padding: 8px 4px; transform: translate(-50%, -50%);
    border: 2px solid #fff; border-radius: 12px; background: rgba(255, 255, 255, .92); color: var(--azul);
    font-family: inherit; font-size: 12px; font-weight: bold; cursor: pointer;
}
.circ-nodo.ok { background: var(--verde); color: #fff; cursor: default; }
.circ-nodo.mal { animation: canchaSacudir .4s; }

@media (max-width: 700px) {
    .cancha-campo { grid-template-columns: 1fr; }
    .cancha-zona { min-height: 190px; border-right: none; border-bottom: 3px solid rgba(255, 255, 255, .85); }
    .cancha-zona:last-child { border-bottom: none; }
    .cancha-zona-centro::before { width: 110px; height: 110px; }
    .circ-puertas { grid-template-columns: 1fr; }
    .circ-marca { font-size: 10px; }
}