/* ====================================================
   /* --- CONFIGURACIÓN BASE DEL LABORATORIO --- */

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; /* Fondo blanco limpio como en tu Figma y la web de Bic Camera */
    font-family: 'Poppins', sans-serif;
    overflow: hidden; /* Evita barras de scroll molestas */
}

/* Control de pantallas (Oculta las que no están activas) */
.experimental-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Por defecto oculto */
    background-color: #ffffff;
    box-sizing: border-box;
    padding: 40px;
}

/* Pantalla que se está mostrando actualmente */
.experimental-screen.active {
    display: flex;
    flex-direction: column;
}

/* --- BOTONES DE NAVEGACIÓN --- */
.back-to-landing, .back-to-menu {
    position: absolute;
    top: 30px;
    left: 40px;
    background: none;
    border: none;
    color: #333333;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.back-to-landing:hover, .back-to-menu:hover {
    opacity: 1;
}

/* ====================================================
   /* --- ESTILOS DEL MENÚ PRINCIPAL (OPACIDAD CRUZADA) --- */

#screen-menu {
    justify-content: center;
    align-items: center;
}

.menu-experimental-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
}

/* Estilo base para las 3 opciones */
.menu-btn {
    background: none;
    border: none;
    font-family: 'Bauhaus 93', 'Arial Black', sans-serif;
    font-size: 3.5rem;
    color: #cccccc; /* Gris apagado por defecto */
    cursor: pointer;
    padding: 10px;
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

/* EFECTO INTERACTIVO DE OPACIDAD CRUZADA (Efecto Figma) */
/* Cuando el mouse entra al contenedor, TODOS bajan su opacidad... */
.menu-experimental-container:hover .menu-btn {
    opacity: 0.15; /* Lo bajé un poquito más para que resalte mucho más el activo */
}

/* ...EXCEPTO al que se le está haciendo hovering directo, que recupera fuerza y se transforma */
.menu-experimental-container .menu-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ====================================================
   /* --- SISTEMA ARCOÍRIS UNIFICADO PARA TODO EL MENÚ --- */


/* Apaga el color gris base de todas las letras cuando el botón entra en hover */
.menu-btn:hover {
    color: transparent !important;
}

/* Al hacer hover sobre cualquier botón, las letras se activan en bucle con los 4 colores */
.menu-btn span {
    display: inline-block;
    transition: color 0.2s ease, transform 0.2s ease;
}

/* Letras 1, 5, 9, 13... -> ROJO */
.menu-btn:hover span:nth-child(4n+1) {
    color: #EC2828;
}

/* Letras 2, 6, 10, 14... -> AMARILLO */
.menu-btn:hover span:nth-child(4n+2) {
    color: #EDC217;
}

/* Letras 3, 7, 11, 15... -> AZUL */
.menu-btn:hover span:nth-child(4n+3) {
    color: #3329ED;
}

/* Letras 4, 8, 12, 16... -> VERDE */
.menu-btn:hover span:nth-child(4n+4) {
    color: #0DB500;
}

/* --- CONTENEDOR DE LOS LIENZOS EXPERIMENTALES (PANTALLA COMPLETA ABSOLUTA) --- */
.canvas-fullscreen-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    z-index: 1; /* Queda detrás del botón de volver */
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- BOTÓN DE SONIDO GLOBAL --- */
.sound-toggle-btn {
    position: fixed;
    top: 30px;
    right: 40px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px 18px;
    border-radius: 30px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    z-index: 100;
    display: none; /* Oculto por defecto en el menú principal */
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.sound-toggle-btn:hover {
    background: #1A1A1A;
    color: #fff;
    border-color: #1A1A1A;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.sound-toggle-btn.muted {
    opacity: 0.65;
}
.sound-toggle-btn.muted:hover {
    opacity: 1;
}

/* --- INSTRUCCIONES FLOTANTES (ANCLA) --- */
.instructions-overlay {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px 24px;
    border-radius: 40px;
    z-index: 5;
    font-size: 0.9rem;
    color: #444;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    pointer-events: none;
    max-width: 90%;
}

/* --- PANEL DE CONTROL ROTACIÓN --- */
.control-panel-rota {
    position: absolute;
    top: 100px;
    left: 40px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 25px;
    border-radius: 20px;
    z-index: 10;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
.control-panel-rota h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    font-family: 'Bauhaus 93', 'Arial Black', sans-serif;
    color: #1A1A1A;
}
.control-panel-rota p {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.slider-container label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}
.slider-container input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
}
.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3329ED;
    cursor: pointer;
    transition: transform 0.1s ease;
}
.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- CONTADOR DE ARCOS (CIMA) --- */
.arch-counter-container {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.counter-title {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: #999;
}
.counter-slots {
    display: flex;
    gap: 12px;
}
.counter-slot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}
.counter-slot.active {
    border-color: #1A1A1A;
    background: #1A1A1A;
    transform: scale(1.1);
}
/* Invertido en Cima */
.inverted-theme .counter-slot {
    border-color: #444;
}
.inverted-theme .counter-slot.active {
    border-color: #fff;
    background: #fff;
}
.inverted-theme .counter-title {
    color: #666;
}

/* Forzar círculos de arcos en blanco al final (secuencia de victoria) */
.victory-active .counter-slot.active {
    border-color: #ffffff !important;
    background: #ffffff !important;
}
.victory-active .counter-slot {
    border-color: rgba(255, 255, 255, 0.3) !important;
    background: transparent !important;
}
.victory-active .counter-title {
    color: rgba(255, 255, 255, 0.5) !important;
}
.victory-active .back-to-menu {
    display: none !important;
}

/* --- OVERLAY DE CIMA (VICTORIA) --- */
.summit-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent; /* Fondo completamente transparente para ver el canvas */
    backdrop-filter: none; /* Sin difuminado de fondo */
    -webkit-backdrop-filter: none;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.2s ease;
}
.summit-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.summit-modal-clean {
    text-align: center;
    display: flex;
    flex-direction: row; /* Botones uno al lado del otro */
    gap: 25px;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 80px; /* Posicionado al fondo sobre el canvas negro */
    width: 100%;
    max-width: 600px;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease;
}
.summit-overlay.active .summit-modal-clean {
    transform: translateY(0);
    opacity: 1;
}
.victory-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.20);
    padding: 14px 32px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}
.victory-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.2);
}
.victory-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
}
.victory-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 15px 30px rgba(255, 255, 255, 0.08);
}

/* Soporte para tema invertido del Canvas */
.inverted-theme .back-to-menu {
    color: #ffffff;
}