
/* Estilos del Navbar cuando el juego está activo */
body.game-active .navbar {
    z-index: 10005 !important; /* Asegurar que esté sobre el juego */
    position: fixed !important;
    top: 0;
    width: 100%;
    background: transparent !important; /* Fondo transparente */
}

/* Ocultar elementos de navbar desktop/mobile no deseados en modo juego */
body.game-active .navbar-toggler,
body.game-active .navbar-collapse {
    display: none !important;
}

/* Centrar logo en móvil cuando el juego está activo */
@media (max-width: 991px) {
    body.game-active .navbar-brand {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 15px !important; /* Ajustar según altura navbar */
        z-index: 10006 !important;
        display: flex !important;
        justify-content: center !important;
        width: auto !important;
    }
    
    body.game-active .navbar-brand img {
        display: block !important;
        filter: brightness(0) !important; /* Logo negro */
        height: 30px !important; /* Asegurar tamaño visible */
        width: auto !important;
    }
}

/* Estilos de la Barra de Navegación Flotante (Mobile)
   Copiados de index.css y adaptados para el modo juego (Fondo Claro) */

body.game-active .floating-mobile-nav {
    display: block !important;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002 !important;
    width: 95%;
    max-width: 380px;
    /* Resetear estilos del wrapper */
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    pointer-events: none; /* Permitir clicks fuera del contenedor */
}

body.game-active .floating-mobile-nav .nav-container {
    /* Estilo "Frosted Glass" (Vidrio Esmerilado) para fondo claro */
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 25px !important;
    padding: 6px 2px; /* Reducir padding contenedor */
    display: flex;
    justify-content: space-between; /* Distribuir uniformemente */
    align-items: center;
    /* Sombra suave y borde sutil */
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    position: relative;
    overflow: hidden;
    pointer-events: auto; /* Habilitar clicks en la barra */
}

/* Ocultar pseudo-elementos originales si existen */
body.game-active .floating-mobile-nav .nav-container::before {
    display: none !important;
}

body.game-active .floating-mobile-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px; /* Reducir padding items */
    border-radius: 14px;
    text-decoration: none !important;
    color: #444 !important; /* Gris oscuro para contraste */
    transition: all 0.3s ease;
    position: relative;
    min-width: 0; /* Permitir encogerse */
    flex: 1; /* Ocupar espacio disponible equitativamente */
    cursor: pointer;
    z-index: 2;
}

body.game-active .floating-mobile-nav .nav-icon {
    color: #555 !important;
    font-size: 18px; /* Icono ligeramente más pequeño */
    margin-bottom: 4px;
    display: block;
    line-height: 1;
}

body.game-active .floating-mobile-nav .nav-label {
    color: #555 !important;
    font-size: 10px; /* Texto más pequeño para que quepa */
    font-weight: 600;
    text-align: center;
    text-shadow: none !important;
    display: block;
    line-height: 1.1;
    white-space: nowrap; /* Evitar saltos de línea indeseados */
    overflow: hidden;
    text-overflow: ellipsis; /* Puntos suspensivos si no cabe */
    max-width: 100%;
}

/* Estado Activo en modo juego */
body.game-active .floating-mobile-nav .nav-item.active {
    background: rgba(0, 0, 0, 0.05); /* Fondo sutil al activo */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

body.game-active .floating-mobile-nav .nav-item.active .nav-icon {
    color: #000 !important;
    transform: scale(1.1);
}

body.game-active .floating-mobile-nav .nav-item.active .nav-label {
    color: #000 !important;
    font-weight: 800;
}

/* Efecto Hover (solo si hay mouse, en mobile es menos relevante pero útil) */
body.game-active .floating-mobile-nav .nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

/* Media Queries para ajuste mobile en modo juego */
@media (max-width: 480px) {
    body.game-active .floating-mobile-nav {
        width: 96%;
        max-width: 360px;
        bottom: 18px;
    }
    body.game-active .floating-mobile-nav .nav-container {
        padding: 8px 10px;
    }
    body.game-active .floating-mobile-nav .nav-item {
        padding: 8px 10px;
        min-width: 50px;
    }
}

/* Contenedor Principal (Wrapper) del Juego */
#chrome-dino-wrapper {
    position: relative;
    width: 100%;
    height: 30vh; /* Altura dinámica para mobile */
    min-height: 200px;
    margin: 20px 0;
    padding: 0;
    overflow: hidden;
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    background-color: #f7f7f7;
    border-radius: 8px;
}

body.game-active {
    overflow: hidden !important;
}

/* Estado activo (controlado por JS/CSS global) */
body.game-active #chrome-dino-wrapper {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    margin: 0;
    border-radius: 0;
    background-color: #f7f7f7;
}

/* Ocultar en escritorio */
@media (min-width: 992px) {
    #chrome-dino-wrapper {
        display: none !important;
    }
}

/* Estilos del Juego (Scopeados) */
#chrome-dino-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: fill; /* Forzar llenado */
    border: none;
    /* Pixel Art Rendering */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Background seamless */
body.game-active #chrome-dino-wrapper {
    background-color: #70c5ce !important; /* Mismo color que el cielo del juego */
}

#chrome-dino-wrapper .cactus {
    --left: 100; /* Start off screen */
    position: absolute;
    left: 0;
    /* Use transform for movement */
    transform: translateX(calc(var(--left) * var(--world-width) * 1px / 100));
    height: 25%; /* Coincidir con altura dino */
    bottom: 0;
    max-width: none;
    /* Optimización GPU */
    will-change: transform;
}

/* Ajustes Mobile */
@media (max-width: 768px) {
    #chrome-dino-wrapper {
        height: 250px;
    }
    
    #chrome-dino-wrapper .dino {
        height: 20%;
        left: 15%;
    }
    
    #chrome-dino-wrapper .cactus {
        height: 20%;
    }
}
