/* ---------------------------------------------------------
   MODULE SPATIAL — BASE (FERMÉ À GAUCHE)
--------------------------------------------------------- */
#space-module {
    position: fixed;
    top: 0;
    left: 0; /* ouverture à gauche */
    width: 380px;
    height: 100vh;
    background: rgba(10, 20, 40, 0.95);
    border-right: 2px solid #4db8ff;
    box-shadow: 5px 0 20px rgba(0,150,255,0.4);
    z-index: 5000;

    /* fermé par défaut : glissé vers la gauche */
    transform: translateX(-100%);
    transition: transform 0.3s ease, opacity 0.2s ease;
    opacity: 1;
    display: block;
    pointer-events: auto;
}

/* ---------------------------------------------------------
   ÉTAT : CACHÉ
--------------------------------------------------------- */
#space-module.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%); /* cohérent avec ouverture à gauche */
}

/* ---------------------------------------------------------
   MODE : PANNEAU LATÉRAL (OUVERT)
--------------------------------------------------------- */
#space-module.sidepanel.open {
    transform: translateX(0); /* visible */
}

/* Canvas adapté au panneau latéral */
#space-module.sidepanel #space-canvas {
    width: 100%;
    height: calc(100vh - 60px);
}

/* ---------------------------------------------------------
   MODE : FENÊTRE FLOTTANTE
--------------------------------------------------------- */
#space-module.floating {
    top: 60px;
    left: 50%;
    width: 600px;
    height: 420px;
    transform: translateX(-50%);
    border-radius: 10px;
    box-shadow: 0 0 25px rgba(0,150,255,0.4);
}

/* ---------------------------------------------------------
   MODE : PLEIN ÉCRAN
--------------------------------------------------------- */
#space-module.fullscreen {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    transform: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: rgba(5, 10, 20, 0.95);
}

/* Canvas fullscreen */
#space-module.fullscreen #space-canvas {
    width: 100%;
    height: calc(100vh - 60px);
}

/* ---------------------------------------------------------
   BOUTON D’OUVERTURE
--------------------------------------------------------- */
#open-space-panel {
    width: 180px;
    padding: 8px 14px;
    background: rgba(0, 20, 40, 0.75);
    border: 2px solid #4db8ff;
    border-radius: 6px;
    color: #4db8ff;
    font-size: 14px;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px #4db8ff;
    cursor: pointer;
    transition: 0.25s ease;
    box-shadow: 0 0 12px rgba(0,150,255,0.25);
    backdrop-filter: blur(3px);
}

/* Effet hover cockpit */
#open-space-panel:hover {
    background: rgba(0, 40, 80, 0.85);
    box-shadow: 0 0 18px #4db8ff;
    transform: translateY(-2px);
}

/* Effet clic */
#open-space-panel:active {
    transform: translateY(0);
    box-shadow: 0 0 8px #4db8ff inset;
}
