/* =========================================
   1. BASE & UTILITAIRES
   ========================================= */
body {
    margin: 0; 
    padding: 0; 
    background-color: #000000; 
    height: 100vh;
    width: 100vw;
    display: flex; 
    justify-content: center; 
    align-items: center;
    overflow: hidden; 
}

/* Polices */
.font-orbitron { font-family: 'Orbitron', sans-serif; }
.font-vt323 { font-family: 'VT323', monospace; }

/* Classes utilitaires JS */
.hidden { display: none !important; }
.flex { display: flex !important; }

/* Conteneur centré générique */
.centered-container {
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
}

/* =========================================
   2. ÉCRAN DE DÉPART (Start Screen)
   ========================================= */
#start-screen { 
    z-index: 100;
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#start-btn {
    background: rgba(0, 0, 0, 0.8); 
    color: #00f3ff; 
    border: 2px solid #00f3ff;
    padding: 20px 40px; 
    cursor: pointer; 
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    position: relative;
    overflow: hidden;
}

#start-btn:hover { 
    background: #00f3ff; 
    color: black; 
    box-shadow: 0 0 50px rgba(0, 243, 255, 0.8); 
}

.sound-instruction {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00f3ff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.7;
    animation: pulse-sound 2s infinite ease-in-out;
}

.sound-icon {
    width: 24px;
    height: 24px;
    fill: #00f3ff;
    filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.5));
}

@keyframes pulse-sound {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); text-shadow: 0 0 10px #00f3ff; }
}

/* =========================================
   3. FOND TERMINAL HACKER
   ========================================= */
#hacking-bg {
    position: absolute;
    top: 0; left: 0; 
    width: 100%; height: 100%;
    z-index: 1;
    background-image: url("assets/fondv1.png"); /* Vérifie ton chemin */
    padding: 20px;
    box-sizing: border-box;
    font-family: 'VT323', monospace;
    overflow: hidden;
}

#terminal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    color: #33ff33;
    font-size: 1rem;
    line-height: 1.3;
    text-shadow: 0 0 4px rgba(51, 255, 51, 0.6);
}

.log-line {
    margin: 0;
    width: 100%;
    word-wrap: break-word;
    opacity: 0.2;
}

.log-prefix { color: #0088ff; margin-right: 15px; }
.log-warning { color: #ffaa00; }
.log-error { color: #ff3333; text-shadow: 0 0 8px red; font-weight: bold; }
.log-success { color: #00ff00; font-weight: bold; }

.terminal-overlay {
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 2;
}

/* =========================================
   4. SÉQUENCE "WELCOME TO THE FUTURE"
   ========================================= */
.container { 
    position: absolute; 
    width: 100%; height: 100%; 
    display: flex; justify-content: center; align-items: center; 
    font-family: 'Orbitron', sans-serif;
    z-index: 10; 
    pointer-events: none;
}

.word {
    position: absolute; 
    font-size: 6rem;
    font-weight: 900; 
    color: white;
    opacity: 0; 
    transform: scale(0.8);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.active { opacity: 1; transform: scale(1); }
.exit { opacity: 0; transform: scale(1.5); filter: blur(15px); transition: all 0.4s ease; }

#word-4 { font-size: 8rem; color: #ffffff; text-shadow: 0 0 40px #4a979b; }

.evaporate-effect { animation: evaporate 1s forwards ease-in; }
@keyframes evaporate {
    0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0px); }
    100% { opacity: 0; transform: translateY(-200px) scale(1.2) rotate(5deg); filter: blur(30px); }
}

/* =========================================
   5. WINDOWS 98 & GLITCH
   ========================================= */
#win98-screen {
    position: absolute; top:0; left:0; width:100%; height:100%;
    z-index: 50; 
    background-color: #008080;
    font-family: 'VT323', monospace;
    justify-content: center; align-items: center;
    overflow: hidden;
}

.shake-wrapper {
    position: relative; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
}

.crt-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 20;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 90%, rgba(0,0,0,0.1) 100%);
    background-size: 100% 4px;
    animation: flicker 0.1s infinite;
    mix-blend-mode: overlay;
}
@keyframes flicker { 0% { opacity: 0.8; } 50% { opacity: 0.95; } 100% { opacity: 0.85; } }

.win98-box {
    background: #c0c0c0; 
    border: 3px solid;
    border-color: #ffffff #404040 #404040 #ffffff;
    padding: 4px; 
    width: 500px; 
    box-shadow: 15px 15px 0px rgba(0,0,0,0.5);
    position: relative; z-index: 10;
}

.win-header {
    background: linear-gradient(90deg, #000080, #1084d0); 
    color: white;
    padding: 6px 10px; 
    font-weight: bold; 
    font-size: 1.2rem;
    letter-spacing: 1px;
    display: flex; align-items: center;
}

.win-body { padding: 40px; text-align: center; color: black; }

.progress-bar {
    width: 100%; height: 25px; 
    background: white; 
    border: 2px solid #808080; 
    border-color: #404040 #ffffff #ffffff #404040;
    margin-top: 25px; 
    position: relative;
}

.progress-fill {
    width: 0%; height: 100%; 
    background: #000080;
    animation: loading 7s steps(20) forwards; 
}
@keyframes loading { 0% { width: 5%; } 100% { width: 100%; } }

.glitch-block {
    position: absolute; z-index: 55; pointer-events: none;
    mix-blend-mode: exclusion; 
}
.glitch-color-1 { background: #00ff00; }
.glitch-color-2 { background: #ff00ff; }
.glitch-color-3 { background: #00ffff; }
.glitch-color-4 { background: #ffffff; }
.glitch-color-5 { background: #000000; }

.pixelate-filter { filter: contrast(200%) brightness(150%) hue-rotate(90deg) blur(1px); }

/* =========================================
   6. TRANSITIONS & FONDUS
   ========================================= */
#transition-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: black;
    z-index: 200; 
    opacity: 0; pointer-events: none;
    transition: opacity 1.5s ease-in-out;
}
.fade-to-black { opacity: 1 !important; pointer-events: auto !important; }

/* =========================================
   7. MENU FINAL (CORRIGÉ & RONDEUR PARFAITE)
   ========================================= */
#final-menu {
    z-index: 60;
    color: white;
    background: url('assets/Fond.png') no-repeat center center / cover;
}

#menu-title {
    /* 1. POSITIONNEMENT ABSOLU (Détaché du reste) */
    position: absolute; 
    
    /* 2. COORDONNÉES (Haut Gauche) */
    top: 30px;   /* Espace depuis le haut de l'écran */
    left: 40px;  /* Espace depuis la gauche de l'écran */
    
    /* 3. TAILLE ET ALIGNEMENT */
    width: auto;      /* Le titre ne prend que la place nécessaire */
    text-align: left; /* Texte aligné à gauche */
    margin: 0;        /* On supprime les marges qui gênent */
    
    /* 4. STYLE VISUEL (inchangé) */
    color: white; 
    text-shadow: 0 0 10px #00f3ff;
    z-index: 70; /* Pour passer devant tout le reste */
    
    /* Optionnel : Ajuste la taille si c'est trop gros pour le coin */
    font-size: 1.5rem; 
}

.choices-container {
    display: flex;
    justify-content: center;
    align-items: center; 
    position: relative;
    width: 100%;
    height: 600px;
}

/* --- BOUTONS RONDS PARFAITS --- */
.choice-card {
    position: absolute;
    
    /* Dimensions FORCEES pour être carré à la base */
    width: 300px !important;
    height: 300px !important;
    
    /* Transforme le carré en rond */
    border-radius: 50% !important;
    
    /* Alignement interne */
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    padding: 0;
    
    /* Design Vitré */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    cursor: pointer;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    z-index: 10;
}

/* Interaction au survol */
.choice-card:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.4);
    z-index: 20;
}

/* --- POSITIONNEMENT DES 4 BULLES --- */

/* 1. GAUCHE */
.choice-card:nth-child(1) { transform: translate(-380px, 80px); }
.choice-card:nth-child(1):hover { transform: translate(-380px, 80px) scale(1.1); }

/* 2. CENTRE */
.choice-card:nth-child(2) { transform: translate(-65px, -220px); }
.choice-card:nth-child(2):hover { transform: translate(-65px, -220px) scale(1.1); }

/* 3. DROITE HAUTE */
.choice-card:nth-child(3) { transform: translate(335px, -133px); }
.choice-card:nth-child(3):hover { transform: translate(335px, -133px) scale(1.1); }

/* 4. DROITE BASSE (New Horizon) */
.choice-card:nth-child(4) { transform: translate(78px, 102px); }
.choice-card:nth-child(4):hover { transform: translate(78px, 102px) scale(1.1); }


/* --- CONTENU INTERNE --- */
.model-box {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    pointer-events: none; /* Clic traverse */
    margin-bottom: 5px;
}

model-viewer {
    width: 100%; height: 100%;
    background-color: transparent;
}

.choice-card h3 {
    font-size: 1rem;
    color: white;
    text-align: center;
    width: 80%;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    margin: 0;
}

/* Effet Hologramme */
.holo-model {
    opacity: 0.8;
    filter: sepia(80%) hue-rotate(180deg) saturate(200%) drop-shadow(0 0 5px rgba(0, 243, 255, 0.5));
    mix-blend-mode: screen;
    transition: all 0.4s ease;
}

.choice-card:hover .holo-model {
    opacity: 1;
    filter: sepia(0%) hue-rotate(0deg) saturate(100%) drop-shadow(0 0 15px rgba(255,255,255,0.3));
}