@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,700;1,900&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #4a9c1c;
}

body {
    display: flex;
    flex-direction: column; 
}

.fondo-app {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('../imagenes/desktop juego.svg');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.game-viewport {
    position: relative;
    z-index: 2; 
    width: 100vw;
    flex: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* HEADER DESKTOP */
.header-desktop {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    width: 100%;
    background-color: #292E33;
    padding: 16px 40px;
    position: relative; 
    z-index: 10;
}

.header-logo img {
    height: 38px; 
    width: auto;
    object-fit: contain;
    display: block;
}

.header-nav {
    display: flex;
    gap: 32px; 
    align-items: center; 
}

.nav-link {
    display: inline-block; 
    padding: 8px 18px;
    color: #FFEDD5;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover { color: #FADBB3; }

.nav-link.activo {
    background-color: #7B7EBC; 
    color: #ffffff;
    border-radius: 8px;
    font-weight: 600;
}

.header-perfil {
    cursor: pointer;
    transition: transform 0.2s ease;
    outline: none; 
}

.header-perfil:hover { transform: scale(1.08); }

.header-perfil img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #7B7EBC;
    object-fit: cover;
    display: block;
}

.btn-hamburguesa {
    display: none;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 34px;
    cursor: pointer;
}

/* BARRAS DE JUEGO */
.level-section { padding: 0 30px; margin-top: 10px; z-index: 5; }
.level-label {
    color: white; font-weight: 900; font-style: italic; font-size: 1.1rem;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); display: block; margin-bottom: 4px;
}
.progress-track { width: 100%; height: 18px; background-color: rgba(220,220,220,0.85); border-radius: 10px; padding: 2px; }
.progress-fill { height: 100%; background-color: #125808; border-radius: 8px; }

/* CONTADOR DE ENERGÍA */
.energy-counter {
    background: #ffffff; padding: 6px 16px; border-radius: 50px;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15); width: fit-content;       
    align-self: flex-start; margin: 15px 0 10px 30px; 
}
.bolt-container { display: flex; align-items: center; filter: drop-shadow(0 0 3px rgba(0,210,255,0.6)); }
.energy-text { font-size: 1.4rem; font-weight: 900; color: #222; }


/* ========================================================
   DISEÑO BASE DE NODOS
   ======================================================== */
.map-area { flex-grow: 1; position: relative; width: 100%; }

.path-node {
    position: absolute; width: 42px; height: 42px; background-color: #ff6b3d;
    border: 4px solid #ffffff; border-radius: 50%; box-shadow: 0 6px 10px rgba(0,0,0,0.3);
    cursor: pointer; transition: transform 0.2s, background-color 0.4s ease; display: block;
    z-index: 5; 
}

.path-node:hover { transform: scale(1.25); background-color: #ff855e; }

/* GANCHO PARA JAVASCRIPT: Al ponerle esta clase, pasa a verde oscuro */
.path-node.nodo-resuelto {
    background-color: #0c4a11 !important;
    border-color: #ffffff;
    box-shadow: 0 0 14px rgba(12, 74, 17, 0.85);
}

/* --------------------------------------------------------
   1. UBICACIONES NODOS - DESKTOP (PC) 
   [Modificá exclusivamente estas líneas para acomodar en PC]
   -------------------------------------------------------- */
.node-1 { top:43%; left: 17%; }
.node-2 { top: 54%; left: 29%; }
.node-3 { top: 61%; left: 43%; }
.node-4 { top: 8%; left: 46%; }
.node-5 { top: 22%; left: 58%; }
.node-6 { top: 78%; left: 67%; }
.node-7 { top: 58%; left: 73%; }
.node-8 { top: 1%; left: 78%; }


/* ========================================================
   ANIMACIÓN ÁRBOLES
   ======================================================== */
@keyframes pvzRespiracion {
    0%   { transform: rotate(0deg) scaleY(1) scaleX(1); }
    35%  { transform: rotate(4.8deg) scaleY(1.08) scaleX(0.92); }
    70%  { transform: rotate(-3.8deg) scaleY(0.92) scaleX(1.08); }
    100% { transform: rotate(0deg) scaleY(1) scaleX(1); }
}

.arbol {
    position: absolute; height: auto; transform-origin: bottom center; 
    animation: pvzRespiracion 3.2s ease-in-out infinite; pointer-events: none; z-index: 2; 
}

/* Árboles Desktop */
.arbol-1 { top: 69%; left: 7%;  width: 76px; animation-duration: 2.8s; animation-delay: 0s; }
.arbol-2 { top: 50%; left: 26%; width: 56px; animation-duration: 3.4s; animation-delay: 0.7s; }
.arbol-3 { top: 72%; left: 44%; width: 66px; animation-duration: 3.1s; animation-delay: 1.4s; }
.arbol-4 { top: 36%; left: 47%; width: 80px; animation-duration: 3.7s; animation-delay: 0.2s; }
.arbol-5 { top: 43%; left: 68%; width: 58px; animation-duration: 2.9s; animation-delay: 1.9s; }
.arbol-6 { top: 18%; left: 84%; width: 72px; animation-duration: 3.3s; animation-delay: 0.9s; }
.arbol-7 { top: 22%; left: 12%; width: 64px; animation-duration: 3.5s; animation-delay: 0.4s; }

.bottom-nav { display: none; }


/* ========================================================
   MENÚ LATERAL DESPLEGABLE
   ======================================================== */
.menu-desplegable {
    position: fixed; top: 0; right: 0; width: 270px; height: 100vh;  
    background-color: #EF4F4F; background-image: url("../imagenes/fondoondeado9.png");
    background-size: cover; background-position: center;
    animation: moverFondoOndeado 20s ease-in-out infinite;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4); transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); z-index: 100;
    display: flex; flex-direction: column;
}

.menu-desplegable.activo { transform: translateX(0); }
.menu-header { display: flex; justify-content: flex-end; padding: 15px 20px 0 0; }
.btn-cerrar { background: transparent; border: none; color: #ffffff; font-size: 34px; cursor: pointer; line-height: 1; }

.contenedor-botones-menu { display: flex; flex-direction: column; height: 100%; padding: 0 24px 25px 24px; }
.menu-avatar { display: flex; justify-content: center; margin: 5px auto 12px auto; }
.menu-avatar img { width: 76px; height: 76px; border-radius: 50%; border: 3px solid #FADBB3; object-fit: cover; }

.btn-menu-usuario {
    display: block; width: 90%; margin: 0 auto 25px auto; padding: 8px 10px;
    border: 1.5px solid #FADBB3; color: #FADBB3; text-align: center;
    font-size: 15px; font-weight: 700; letter-spacing: 0.5px;
}

.grupo-principal { width: 100%; display: flex; flex-direction: column; gap: 12px;}
.item-ajustes-contenedor { width: 100%; }
.solo-movil { display: none !important; }

.btn-menu-blanco {
    display: flex; align-items: center; justify-content: center; width: 90%; margin: 0 auto; padding: 13px 0;
    background-color: #FADBB3; color: #ED6C3A; font-size: 14.5px; font-weight: 800; text-decoration: none;
    border-radius: 50px; border: none; box-shadow: 0 4px 10px rgba(0,0,0,0.15); cursor: pointer;
}

.submenu-ajustes {
    max-height: 0; overflow: hidden; display: flex; flex-direction: column;
    gap: 8px; width: 90%; margin: 0 auto; transition: max-height 0.35s ease;
}
.submenu-ajustes.abierto { max-height: 180px; padding-top: 12px; }

.btn-subopcion {
    padding: 8px 0; background-color: #7B7EBC; color: #fdf0dd; font-size: 12px; 
    font-weight: 700; border-radius: 50px; border: none; cursor: pointer; width: 100%;
}
.btn-subopcion.desactivado { background-color: #292E33; color: #f57134; }

.footer-menu { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 20px;}

.btn-cerrar-sesion {
    display: block; width: 90%; margin: 0 auto; padding: 14px 0; background-color: #23272b; 
    color: #ffffff; text-align: center; text-decoration: none; font-size: 13.5px; font-weight: 700;  
    border-radius: 50px; box-shadow: 0 4px 10px rgba(0,0,0,0.25);       
}

.img-logo-menu { width: 50px; height: auto; object-fit: contain; }

.menu-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5); display: none; z-index: 99;
}
.menu-overlay.activo { display: block; }

@keyframes moverFondoOndeado {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}


/* ========================================================
   RESPONSIVE MÓVIL (768px hacia abajo)
   ======================================================== */
@media (max-width: 768px) {
    
    .fondo-app {
        background-image: url('../imagenes/mobile juego.svg');
    }

    .solo-movil { display: flex !important; }

    .header-desktop { background-color: transparent; padding: 12px 20px; }
    .header-nav, .header-perfil { display: none; }
    .btn-hamburguesa { display: block; }

    .bottom-nav {
        display: flex; height: 65px; background-color: #24262b;
        justify-content: space-around; align-items: center; width: 100%; z-index: 10; padding: 0 5px;
    }

    .bottom-nav a { display: flex; align-items: center; justify-content: center; height: 100%; flex: 1; }
    .bottom-nav a img { width: 28px; height: 28px; object-fit: contain; }
    .bottom-nav a:active img { transform: scale(0.82); }

    .level-section { padding: 0 20px; }
    .energy-counter { margin: 8px 0 10px 20px; }

    /* ----------------------------------------------------
       2. UBICACIONES NODOS - MÓVIL (Tus datos intactos)
       ---------------------------------------------------- */
    .node-1 { top: 85%; left: 38%; }
    .node-2 { top: 72%; left: 35%; }
    .node-3 { top: 60%; left: 29%; }
    .node-4 { top: 48%; left: 33%; }
    .node-5 { top: 47%; left: 60%; }
    .node-6 { top: 32%; left: 52%; }
    .node-7 { top: 20%; left: 20%; }
    .node-8 { top: 6%;  left: 58%; }

    /* Árboles Móvil */
    .arbol-1 { top: 84%; left: 14%; width: 48px; }
    .arbol-2 { top: 66%; left: 80%; width: 40px; }
    .arbol-3 { top: 56%; left: 20%; width: 52px; }
    .arbol-4 { top: 38%; left: 84%; width: 36px; }
    .arbol-5 { top: 24%; left: 15%; width: 44px; }
    .arbol-6 { top: 10%; left: 50%; width: 48px; }
    .arbol-7 { top: 25%; left: 80%; width: 48px; }
}

/* ==========================================================================
   ESTILOS EXCLUSIVOS DE LA TRIVIA (Aislados por body.page-trivia)
   ========================================================================== */

body.page-trivia {
    background-color: #619d78;
    height: 100vh; width: 100vw; overflow: hidden; position: relative;
    font-family: 'Montserrat', sans-serif; user-select: none;
}

/* ARREGLADO: Caída fluida y rotación suave de los signos (?) */
.bg-preguntas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.bg-preguntas img { 
    position: absolute; 
    opacity: 0.12; 
    top: -60px;
    animation-name: caerPreguntitas; 
    animation-timing-function: linear; 
    animation-iteration-count: infinite; 
}

@keyframes caerPreguntitas {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(112vh) rotate(360deg); }
}

.trivia-viewport {
    position: relative; z-index: 2; display: flex; flex-direction: column;
    height: 100%; max-width: 480px; margin: 0 auto; padding: 15px 20px;
}

.header-trivia { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }

.btn-back {
    background: #e2f1b3; border: none; color: #355848; font-size: 20px; font-weight: 900;
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 0px #b1c880; flex-shrink: 0;
}
.btn-back:active { transform: translateY(3px); box-shadow: none; }

.logo-trivia { height: 36px; width: auto; }

.trivia-progress-container { flex-grow: 1; height: 16px; background: rgba(0,0,0,0.18); border-radius: 20px; padding: 3px; }
.trivia-progress-bar { height: 100%; background: #084E00; border-radius: 20px; transition: width 0.45s cubic-bezier(0.25, 1, 0.5, 1); }

.main-content-trivia { flex: 1; display: flex; align-items: center; justify-content: center; padding-bottom: 20px; position: relative; }

.card-trivia {
    background: #e3f0b3; width: 100%; border-radius: 28px; padding: 45px 24px 30px 24px;
    position: relative; box-shadow: 0 12px 25px rgba(0,0,0,0.15); text-align: center;
    transition: opacity 0.25s ease; z-index: 5;
}

.icon-notch {
    position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
    width: 68px; height: 68px; background: #e3f0b3; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
}
.icon-notch img { width: 42px; height: 42px; object-fit: contain; }

.step-indicator { font-size: 13px; font-weight: 800; color: #4b7a64; letter-spacing: 0.5px; display: block; margin-bottom: 12px;}
.question-title { font-size: 1.15rem; color: #234234; font-weight: 900; line-height: 1.35; margin-bottom: 25px; min-height: 3.8rem; display: flex; align-items: center; justify-content: center;}

.options-container { display: flex; flex-direction: column; gap: 12px; }

.btn-option {
    width: 100%; padding: 16px 14px; background-color: #518b76; color: #ffffff;
    border: none; border-radius: 50px; font-size: 14.5px; font-weight: 700;
    box-shadow: 0 5px 0px #386453; cursor: pointer; transition: all 0.15s;
}
.btn-option:hover { background-color: #5c9b84; }
.btn-option:active { transform: translateY(4px); box-shadow: 0 1px 0px #386453; }

@keyframes vibrarError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); background-color: #d94343; box-shadow: 0 5px 0 #9c2424;}
    40%, 80% { transform: translateX(8px); background-color: #d94343; box-shadow: 0 5px 0 #9c2424;}
}
.shake-anim { animation: vibrarError 0.4s ease; }

/* VICTORIA */
.card-victory { width: 100%; text-align: center; color: #ffffff; position: relative; z-index: 5; }
.victory-title { font-size: 2.4rem; font-weight: 900; letter-spacing: 1px; text-shadow: 0 3px 6px rgba(0,0,0,0.2); margin-bottom: 15px;}
.trophy-img { width: 180px; height: auto; filter: drop-shadow(0 10px 15px rgba(0,0,0,0.3)); margin: 10px auto; animation: flotarTrofeo 3s ease-in-out infinite;}
.victory-subtitle { color: #e2f1b3; font-size: 1.6rem; font-weight: 900; margin-top: 10px; line-height: 1.1;}
.victory-desc { font-size: 0.95rem; font-weight: 700; opacity: 0.9; margin: 12px 0 20px 0; }

.score-pill {
    display: inline-block; background: #e2f1b3; color: #355848; font-size: 1.4rem;
    font-weight: 900; padding: 6px 35px; border-radius: 50px; margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.btn-action-verde {
    display: block; width: 100%; padding: 18px; background: #2f5845; color: #e2f1b3;
    border: none; border-radius: 50px; font-size: 16px; font-weight: 900; cursor: pointer;
    box-shadow: 0 6px 0px #1c362a; transition: all 0.2s;
}
.btn-action-verde:active { transform: translateY(5px); box-shadow: none; }

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

/* MODALES */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.65); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
    background: #EF4F4F; background-image: url("imagenes/fondoondeado9.png"); background-size: cover;
    width: 100%; max-width: 340px; padding: 30px 22px; border-radius: 25px; text-align: center; color: white;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4); border: 3px solid #FADBB3;
}
.modal-box h3 { font-size: 1.6rem; font-weight: 900; margin-bottom: 10px; color: #FADBB3;}
.modal-box p { font-size: 1rem; font-weight: 700; margin-bottom: 25px; }

.modal-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-modal-si { padding: 12px; border-radius: 50px; border: none; background: #292E33; color: white; font-weight: 800; cursor: pointer;}
.btn-modal-piola { padding: 14px; border-radius: 50px; border: none; background: #FADBB3; color: #ED6C3A; font-weight: 900; cursor: pointer; box-shadow: 0 4px 0 #c9ad8a;}

.oculta { display: none !important; }

/* PIEZAS DE CONFETI */
.confetti-piece { 
    position: fixed; 
    width: 10px; 
    height: 14px; 
    border-radius: 2px;
    z-index: 3; 
    pointer-events: none;
}