html, body { overflow: hidden; width: 100%; height: 100%; margin: 0; padding: 0; font-family: sans-serif; }
#renderCanvas { width: 100%; height: 100%; touch-action: none; }

/* UI : VISEUR */
#reticule {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: white; font-size: 24px; font-weight: bold; pointer-events: none; z-index: 90;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* UI : BOUSSOLE */
#compassContainer {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    width: 400px; height: 40px;
    background: linear-gradient(90deg, transparent 0%, rgba(0,0,0,0.6) 20%, rgba(0,0,0,0.6) 80%, transparent 100%);
    overflow: hidden; 
    border-top: 2px solid white;
    border-bottom: 2px solid white;
    z-index: 100;
    mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 20%, black 80%, transparent);
}

#compassStrip {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; align-items: center;
    color: white; font-weight: bold; font-size: 18px;
    transition: transform 0.1s linear; 
    will-change: transform;
}

.cardinal { position: absolute; transform: translateX(-50%); text-shadow: 0 0 5px black; }
.tick { position: absolute; height: 10px; width: 2px; background: rgba(255,255,255,0.5); transform: translateX(-50%); top: 10px; }

/* UI : BOUTON CARTE */
#mapBtn {
    position: fixed; top: 80px; left: 20px;
    background: rgba(0, 0, 0, 0.6); color: #AAA;
    border: 2px solid #555; border-radius: 50%;
    width: 60px; height: 60px;
    font-size: 30px; line-height: 60px; text-align: center;
    cursor: pointer; z-index: 95;
    transition: all 0.3s;
}
#mapBtn.unlocked {
    border-color: #D4AF37; color: #FFF;
    background: rgba(100, 80, 0, 0.8);
    box-shadow: 0 0 15px #D4AF37;
    animation: pulseMap 2s infinite;
}
@keyframes pulseMap { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* UI : CARTE PANNEAU */
#mapPanel {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: none; flex-direction: column; align-items: center;
    background: rgba(20, 20, 20, 0.95);
    border: 4px solid #D4AF37;
    border-radius: 8px; padding: 10px;
    box-shadow: 0 0 50px black;
    z-index: 150;
}
#mapTitle { color: #D4AF37; font-family: "Courier New", monospace; font-weight: bold; margin-bottom: 5px; }
canvas#theMap { background-color: #000; image-rendering: pixelated; border: 2px solid #555; }
#mapLegend { color: #AAA; font-size: 14px; margin-top: 5px; font-weight: bold; }

/* UI : INFO & HUD */
#interactionInfo { position: fixed; top: 60%; left: 50%; transform: translate(-50%, -50%); color: #FFD700; font-size: 18px; font-weight: bold; text-shadow: 1px 1px 2px black; pointer-events: none; display: none; z-index: 91; }
#pilotHUD { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); text-align: center; display: none; z-index: 95; background: rgba(0, 50, 100, 0.8); color: white; padding: 10px 20px; border-radius: 5px; font-weight: bold; border: 2px solid #00FFFF; }
#actionBar { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); text-align: center; display: none; z-index: 95; }
.action-btn { background: rgba(0, 0, 0, 0.7); color: white; padding: 10px 20px; border-radius: 5px; font-weight: bold; margin: 0 10px; border: 2px solid #FFD700; }
.key { color: #FFD700; font-size: 1.2em; }
#inventoryBar { position: fixed; bottom: 10px; right: 10px; display: flex; gap: 10px; z-index: 95; }
.slot { width: 64px; height: 64px; position: relative; background: rgba(0, 0, 0, 0.5); border: 2px solid #555; border-radius: 5px; display: flex; justify-content: center; align-items: center; color: #888; font-size: 12px; }
.slot-number { position: absolute; top: 2px; left: 5px; color: #AAA; font-size: 10px; font-weight: bold; }
.slot.filled { border-color: #00FFFF; background: rgba(0, 50, 50, 0.8); color: white; font-size: 30px; }

/* MENU SYSTÈME */
#systemMenu { position: fixed; top: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-end; z-index: 200; }
#burgerIcon { background: rgba(0, 0, 0, 0.6); color: white; border: 2px solid #777; border-radius: 5px; width: 40px; height: 40px; font-size: 24px; line-height: 36px; text-align: center; cursor: pointer; user-select: none; transition: all 0.2s; }
#burgerIcon:hover { border-color: #FFD700; color: #FFD700; background: rgba(50, 50, 50, 0.9); }
#menuItems { display: none; flex-direction: column; gap: 5px; margin-top: 10px; }
.sys-btn { background: rgba(0, 0, 0, 0.8); color: #FFF; border: 1px solid #555; padding: 8px 15px; font-family: monospace; font-size: 14px; cursor: pointer; transition: all 0.2s; text-align: right; width: 180px; border-radius: 3px; }
.sys-btn:hover { background: rgba(50, 50, 50, 1); border-color: #00FFFF; color: #FFD700; }
#saveFeedback { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #00FF00; font-size: 36px; font-weight: bold; font-family: sans-serif; text-shadow: 2px 2px 0px black; pointer-events: none; opacity: 0; transition: opacity 1.5s; z-index: 300; }

/* UI : OXYGÈNE */
#oxygenDisplay {
    position: fixed; bottom: 20px; left: 20px;
    font-size: 24px; font-weight: bold; color: #00FFFF;
    text-shadow: 2px 2px 0px #000;
    display: none; z-index: 95;
    background: rgba(0, 0, 50, 0.5);
    padding: 10px; border-radius: 8px; border: 2px solid #00FFFF;
}

/* UI : ÉCRAN GAME OVER */
#gameOverScreen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(50, 0, 0, 0.9); /* Fond rouge sombre */
    z-index: 10000; display: none;
    flex-direction: column; justify-content: center; align-items: center;
    color: white; font-family: sans-serif;
    animation: fadeIn 2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#gameOverTitle {
    font-size: 80px; color: #FF0000; 
    text-shadow: 0 0 20px black; margin-bottom: 20px;
    font-weight: bold; letter-spacing: 5px;
}

#restartBtn {
    padding: 20px 50px; font-size: 24px; cursor: pointer;
    background: transparent; color: white; border: 3px solid white;
    font-weight: bold; transition: all 0.3s;
    margin-top: 30px;
}
#restartBtn:hover { background: white; color: black; }

/* UI : ENDURANCE (STAMINA) */
#staminaContainer {
    position: fixed; bottom: 20px; left: 20px;
    width: 200px; height: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid white; border-radius: 4px;
    display: none; z-index: 95;
    overflow: hidden;
}
#staminaBar {
    width: 100%; height: 100%;
    background: #FFD700; /* Jaune */
    transition: width 0.1s linear;
}

/* --- AMÉLIORATION MOBILE (CORRECTION FINALE) --- */
@media (max-width: 800px) {
    
    /* CIBLE PRÉCISE : Slot 1 (Bateau) et Slot 2 (Bijoux) */
    #slot0 .content, 
    #slot1 .content {
        font-size: 50px !important; /* On force une très grande taille */
        
        /* Centrage parfait */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        height: 100% !important;
        line-height: normal !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* CIBLE PRÉCISE : Slot 3 (Arc & Flèches) */
    /* On le garde plus petit pour que le texte "x999" rentre */
    #slot2 .content {
        font-size: 25px !important; 
        
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        height: 100% !important;
    }
}