#canvas-container {
    width: 100vw;
    height: 100vh;
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    background-color: #0b0c10;
}

body.space-mode header, 
body.space-mode nav, 
body.space-mode footer, 
body.space-mode .navbar {
    display: none !important;
}
#side-drawer {
    position: fixed;
    top: 80px;
    right: 0;
    transform: translateX(320px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    display: flex;
    align-items: flex-start;
}
#side-drawer.drawer-open {
    transform: translateX(0);
}
#drawer-toggle {
    background: rgba(29, 51, 96, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    padding: 15px 18px;
    border-radius: 12px 0 0 12px;
    color: #ffaa00;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: -4px 4px 15px rgba(0,0,0,0.5);
    font-size: 22px;
    margin-top: 10px;
}
#drawer-content {
    background: rgba(29, 51, 96, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-radius: 0 0 0 12px;
    padding: 25px;
    width: 320px;
    color: white;
    backdrop-filter: blur(8px);
    box-shadow: -4px 4px 15px rgba(0,0,0,0.5);
}
#drawer-content h2 {
    font-size: 16px;
    color: #ffaa00;
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
#drawer-content p {
    font-size: 13px;
    line-height: 1.5;
    color: #ccc;
    margin-bottom: 0;
}

/* Jauge de Vitesse */
.speed-gauge-container {
    text-align: center;
}
#speed-gauge {
    width: 140px;
    height: 70px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: #111;
    border-radius: 70px 70px 0 0;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 0 5px rgba(255, 170, 0, 0.2);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
}
#speed-gauge-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffaa00;
    transform-origin: bottom center;
    transform: rotate(-180deg); 
    transition: transform 0.1s ease-out;
    pointer-events: none;
}
#speed-gauge-mask {
    position: absolute;
    bottom: 0;
    left: 20px;
    width: 100px;
    height: 50px;
    background: #1d3360;
    border-radius: 50px 50px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.8);
    pointer-events: none;
}
#speed-value-center {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: white;
    pointer-events: none;
    z-index: 5;
}

#info-dialog {
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(15, 20, 30, 0.95);
    padding: 18px 22px;
    border-radius: 14px;
    color: white;
    border: 1px solid rgba(0, 208, 255, 0.5);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    display: none;
    min-width: 220px;
    z-index: 20;
    pointer-events: auto;
    transform: translate(0, -50%);
    transition: left 0.12s ease-out, top 0.12s ease-out;
}
#info-dialog::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -14px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px 14px 14px 0;
    border-color: transparent rgba(15, 20, 30, 0.95) transparent transparent;
}
#info-dialog h2 {
    margin: 0 0 12px 0;
    color: #ffaa00;
    font-size: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 5px;
    padding-right: 20px;
}
#info-dialog p {
    margin: 5px 0;
    font-size: 13px;
    line-height: 1.4;
}
.info-label {
    color: #aaa;
    font-weight: bold;
}
#info-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 28px;
    height: 28px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    cursor: pointer;
    background: #ffaa00;
    color: #111;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid rgba(15, 20, 30, 0.95);
    box-shadow: 0 4px 8px rgba(0,0,0,0.6);
    z-index: 30;
}
#info-close:hover {
    background: #ffffff;
    color: #111;
}
#info-open-btn {
    display: inline-block;
    margin-top: 15px;
    background: #ffaa00;
    color: #111;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    width: 100%;
}
#info-open-btn:hover {
    background: #e69900;
}

.space-back-btn-container {
    position: fixed;
    top: 0;
    left: 0;
    margin: 1.5rem;
    z-index: 100;
}

.space-back-btn {
    background: rgba(29, 51, 96, 0.8) !important;
    backdrop-filter: blur(8px);
}

.space-label {
    letter-spacing: 1px;
    font-size: 13px;
}

.space-list-container {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.space-project-btn {
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: transform 0.2s;
}

.space-project-btn:hover {
    transform: scale(1.05);
}

.fs-10px {
    font-size: 10px;
}

#info-dialog {
    text-align: center;
    max-width: 280px;
    min-width: 250px;
}

#info-image {
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    display: none;
    border: 1px solid rgba(255,255,255,0.2);
}

#info-title {
    border-bottom: none;
    text-align: center;
    padding-right: 0;
    margin-bottom: 5px;
}

#info-desc {
    font-size: 12px;
    color: #ddd;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* ECRAN DE CHARGEMENT SPACE */
#space-loader {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #0b0f19;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
}
.space-loader-content {
    text-align: center;
    width: 300px;
}
.rocket-track {
    position: relative;
    width: 100%;
    height: 30px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}
.loading-bar-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}
.loading-bar-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ff5722);
    animation: fillBar 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.rocket-icon {
    position: absolute;
    top: 50%;
    left: 0;
    font-size: 1.5rem;
    color: #ecf0f1;
    transform: translate(-50%, -50%) rotate(45deg);
    animation: moveRocket 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    z-index: 2;
}
.loading-text {
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: pulseText 1s infinite alternate;
}

@keyframes fillBar {
    0% { width: 0%; }
    100% { width: 100%; }
}
@keyframes moveRocket {
    0% { left: 0%; transform: translate(-50%, -50%) rotate(45deg); }
    100% { left: 100%; transform: translate(-50%, -50%) rotate(45deg); }
}
@keyframes pulseText {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}
}

/* =========================================
   Mobile Responsiveness (Space View)
   ========================================= */
@media (max-width: 768px) {
    /* Reduce drawer width to leave room for canvas clicks */
    #side-drawer {
        transform: translateX(280px);
    }
    #side-drawer.open {
        transform: translateX(0);
    }
    #drawer-content {
        width: 280px;
        padding: 15px;
    }
    
    /* Position info dialog at the bottom center instead of next to planet */
    #info-dialog {
        top: auto !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translate(-50%, 0) !important;
        width: 90%;
        max-width: 350px;
        padding: 15px;
    }
    
    /* Hide the dialog arrow since it's now a bottom sheet */
    #info-dialog::after {
        display: none !important;
    }
    
    /* Adjust back button spacing */
    .space-back-btn-container {
        margin: 1rem;
    }
    
    .space-back-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
}
