/* ==========================================================================
   RESET & CONFIGURATION DE BASE
   ========================================================================== */
:root {
    --main-green: #33ff00; /* Vert Terminal */
    --dim-green: #1a8000;
    --bg-black: #050505;
    --text-glow: 0 0 5px var(--dim-green);
    --font-retro: 'VT323', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Configuration du corps de page (L'arrière-plan sur PC) */
body {
    background-color: #111; /* Fond gris foncé pour le PC */
    /* Petit motif de grille pour le style */
    background-image: radial-gradient(#222 1px, transparent 1px);
    background-size: 20px 20px;
    
    color: var(--main-green);
    font-family: var(--font-retro);
    
    /* CENTRAGE DU TÉLÉPHONE SUR L'ÉCRAN */
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
    font-size: 18px;
}

/* ==========================================================================
   LE CADRE DU TÉLÉPHONE (SIMULATION MOBILE)
   ========================================================================== */
.screen-container {
    position: relative;
    display: flex;
    flex-direction: column;

    /* DIMENSIONS MOBILES FORCÉES SUR PC */
    width: 100%;
    max-width: 400px;  /* Largeur smartphone */
    height: 100%;
    max-height: 850px; /* Hauteur max confortable sur PC */
    
    /* CADRE ESTHÉTIQUE (BEZEL) */
    border: 10px solid #222; /* Bordure coque */
    border-radius: 30px;     /* Coins arrondis */
    box-shadow: 
        0 0 0 2px #333,      /* Contour fin */
        0 0 50px rgba(51, 255, 0, 0.15); /* Lueur verte */
    
    background-color: var(--bg-black);
    overflow: hidden; /* Coupe ce qui dépasse des coins */
}

/* ==========================================================================
   PAGE D'ACCUEIL (MENU)
   ========================================================================== */
#start-screen {
    height: 100%; /* Prend toute la hauteur du téléphone */
    justify-content: center;
    align-items: center;
    text-align: center;
    
    /* IMAGE DE FOND ACCUEIL */
    background: 
        linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9)),
        url('../assets/EXT_01.jpg'); /* Vérifie bien ce nom ! */
    
    background-size: cover;
    background-position: center;
    background-blend-mode: multiply;
}

.menu-content {
    z-index: 10;
    width: 90%;
}

.glitch-text {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 3px 0px 0px rgba(255,0,0,0.7), -3px 0px 0px rgba(0,0,255,0.7);
    animation: glitch 2s infinite;
}

.subtitle {
    font-size: 1.2rem;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--main-green);
    display: inline-block;
    padding-bottom: 5px;
}

.warning-box {
    border: 2px dashed red;
    color: red;
    background: rgba(0,0,0,0.8);
    padding: 15px;
    margin: 20px auto;
    font-weight: bold;
    animation: blink 1.5s infinite;
}

.lang-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 20px;
}

/* ==========================================================================
   INTERFACE DE JEU (GAMEPLAY)
   ========================================================================== */
#game-interface {
    background-color: var(--bg-black);
    height: 100%;
}

/* Notification immersive en haut de l'image */
#game-notification {
    position: absolute;
    top: 60px; /* Sous le HUD */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--main-green);
    color: var(--main-green);
    padding: 8px 15px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    font-size: 0.9rem;
    text-align: center;
    box-shadow: 0 0 10px rgba(51, 255, 0, 0.3);
}

/* Zone Image (Haut) */
/* 1. L'IMAGE (3/4 de l'écran = 75%) */
.scene-container {
    height: 50%;        /* Force la hauteur exacte */
    flex: none;         /* Empêche de grandir ou rétrécir */
    position: relative;
    overflow: hidden;
    border-bottom: 2px solid var(--main-green);
    width: 100%;
}

#scene-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    
    /* LE FILTRE HORREUR */
    filter: grayscale(100%) contrast(130%) brightness(70%) sepia(20%);
}

/* Zone Dialogue (Milieu) */
/* 2. LE TEXTE (0.5/4 de l'écran = 12.5%) */
.dialogue-area {
    height: 25%;      /* Force la hauteur exacte */
    flex: none;         /* Empêche de grandir ou rétrécir */
    
    padding: 10px;      /* Un peu moins de padding pour gagner de la place */
    background: #000;
    overflow-y: auto;   /* Scroll si le texte est long */
    border-bottom: 1px solid var(--dim-green);
    font-size: 1rem;    /* Police légèrement ajustée */
    line-height: 1.3;
    width: 100%;
}

.typewriter p {
    border-right: .15em solid var(--main-green);
    animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

/* Zone Choix (Bas) */
/* ==========================================================================
   CORRECTION DU SCROLL DES CHOIX
   ========================================================================== */
/* 3. LES CHOIX (0.5/4 de l'écran = 12.5%) */
.choices-container {
    height: 25%;      /* Force la hauteur exacte */
    flex: none;         /* Empêche de grandir ou rétrécir */
    
    padding: 10px;
    background: #111;
    display: flex;
    flex-direction: column;
    gap: 8px;
    
    /* Le scroll est vital ici car la zone est petite */
    overflow-y: auto;   
    justify-content: flex-start;
    width: 100%;
}

/* ==========================================================================
   BOUTONS & UI
   ========================================================================== */
.btn-retro {
    background: black;
    border: 2px solid var(--main-green);
    color: var(--main-green);
    font-family: var(--font-retro);
    font-size: 1.2rem;
    padding: 12px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    text-shadow: var(--text-glow);
    width: 100%;
}

.btn-retro:hover {
    background: var(--main-green);
    color: black;
}

.btn-retro:active {
    transform: scale(0.98);
}

/* HUD (Inventaire) */
.hud-top {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
}

.hud-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--main-green);
    color: var(--main-green);
    font-family: var(--font-retro);
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
}

/* Modale Inventaire */
.modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    border: 2px solid var(--main-green);
    padding: 20px;
    width: 80%;
    text-align: center;
}

/* ==========================================================================
   EFFETS SPÉCIAUX (OVERLAYS)
   ========================================================================== */
.scanlines {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.3) 3px,
        rgba(0, 0, 0, 0.3) 4px
    );
    pointer-events: none;
    z-index: 5;
}

.vignette {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, transparent 50%, black 140%);
    pointer-events: none;
    z-index: 6;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes blink {
    50% { opacity: 0; }
}

/* STYLE SPÉCIFIQUE POUR LA MODALE CARTE (CORRIGÉ) */
.map-content {
    width: 95%; 
    max-height: 90%; /* Empêche la fenêtre de sortir du téléphone */
    padding: 10px;
    background: rgba(0,0,0,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.map-image {
    /* MAGIE ICI : */
    max-width: 100%;  /* Ne dépasse pas en largeur */
    max-height: 70vh; /* Ne dépasse jamais 70% de la hauteur de l'écran */
    width: auto;      /* Laisse la largeur s'adapter */
    height: auto;     /* Laisse la hauteur s'adapter */
    
    object-fit: contain; /* Garde les proportions sans déformer */
    
    border: 2px solid var(--main-green);
    filter: sepia(50%) contrast(120%); 
    margin-bottom: 10px;
}

.hint-text {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 5px;
}

/* ==========================================================================
   RESPONSIVE (POUR VRAI MOBILE)
   ========================================================================== */
@media (max-width: 600px) {
    body {
        background: black; /* Pas de fond gris sur mobile */
        align-items: flex-start; /* Caler en haut */
    }

    .screen-container {
        /* On enlève les limites et le cadre */
        max-width: 100%;
        max-height: 100%;
        width: 100vw;
        height: 100vh;
        
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .choices-container {
        padding-bottom: 40px; /* Zone de sécurité pour les boutons sur mobile */
    }
}

/* --- CALQUE DES OBJETS INTERACTIFS --- */
#objects-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; /* Laisse passer les clics si on clique à côté */
    z-index: 4; /* Important : Au-dessus de l'image de fond */
}

/* L'OBJET LUI-MÊME (LE CARNET) */
.interactive-item {
    position: absolute;
    cursor: pointer;
    pointer-events: auto; /* Active le clic sur l'image */
    
    /* EFFET GLOW VERT */
    filter: drop-shadow(0 0 5px #33ff00); 
    transition: transform 0.2s;
    animation: float 3s ease-in-out infinite;
}

.interactive-item:hover {
    transform: scale(1.1); /* Grossit quand on passe la souris */
    filter: drop-shadow(0 0 15px #33ff00);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================================================
   CUSTOM SCROLLBAR (DESIGN TERMINAL)
   ========================================================================== */

/* 1. La largeur de la barre */
::-webkit-scrollbar {
    width: 10px; /* Assez large pour être cliquable, assez fin pour le style */
}

/* 2. Le fond de la barre (le rail) */
::-webkit-scrollbar-track {
    background: #050505; /* Noir très profond */
    border-left: 1px solid var(--dim-green); /* Petite ligne de séparation */
}

/* 3. La partie mobile (le "pouce") */
::-webkit-scrollbar-thumb {
    background: var(--dim-green); /* Vert sombre par défaut */
    border: 2px solid #050505; /* Contour noir pour donner un aspect "bloc" */
    box-shadow: inset 0 0 5px rgba(51, 255, 0, 0.5); /* Lueur interne */
}

/* 4. Quand on passe la souris dessus */
::-webkit-scrollbar-thumb:hover {
    background: var(--main-green); /* S'allume en vert fluo */
    cursor: pointer;
}

/* 5. Le coin (quand il y a scroll horizontal et vertical) */
::-webkit-scrollbar-corner {
    background: #050505;
    }

    /* Style du conteneur de l'input */
.input-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px; /* Espace avant les boutons */
}

/* Le champ de texte lui-même */
.retro-input {
    background-color: #000;
    color: #33ff00;
    border: 2px solid #33ff00;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    width: 80%;
    text-transform: uppercase;
    outline: none;
    margin-bottom: 10px;
}

.retro-input::placeholder {
    color: #1a8000; /* Vert plus foncé */
}

/* Le bouton ENTRER */
.btn-input-submit {
    background-color: #33ff00;
    color: #000;
    border: none;
    padding: 5px 20px;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    cursor: pointer;
}

.btn-input-submit:hover {
    background-color: #fff;
}

