/* --- Base et Typographie --- */
:root {
    --text-color: #333333;
    --accent-color: #5b7965;
    --ui-font: 'Arial', 'Helvetica', sans-serif;
    --title-font: 'Georgia', serif;
}

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

body {
    background-image: url('../../images/motifFond.png');
    background-size: auto;
    background-repeat: repeat;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* --- Préchargeur --- */
#preloader {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: #f6f5f0;
    display: flex; 
    flex-direction: column; /* Force les éléments à passer l'un sous l'autre */
    justify-content: center; /* Centre verticalement */
    align-items: center;    /* Centre horizontalement */
    text-align: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s ease;
}

.preloader-text { 
    font-family: var(--title-font); 
    font-size: 3rem; 
    font-weight: normal; 
    letter-spacing: 0.5em; 
    text-transform: uppercase; 
    color: #4a4a4a; 
    opacity: 0; 
    animation: pulseText 2s infinite alternate; 
}

/* Style du sous-titre pour l'isoler et l'espacer proprement du h1 */
#preloader h2.subtitle {
    font-size: 1rem;
    letter-spacing: 0.3em;
    margin-top: 1rem; /* Espace vertical entre ANGKOR et LA DÉCOUVERTE */
    animation-delay: 0.3s; /* Léger décalage optionnel pour l'animation */
}

@keyframes pulseText { 
    0% { opacity: 0.4; filter: blur(2px); } 
    100% { opacity: 1; filter: blur(0px); } 
}

.preloader-hidden { 
    opacity: 0 !important; 
    visibility: hidden !important; 
}

/* --- Interface UI Commune --- */
.ui-header, .ui-footer {
    position: fixed;
    left: 0;
    width: 100%;
    padding: 2rem 3rem;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--ui-font);
}

/* Classes utilitaires d'affichage */
.show-mobile { display: none; }
.show-mobile-flex { display: none; }

/* Header */
.ui-header { top: 0; }
.brand { font-size: 0.9rem; display: flex; align-items: center; gap: 10px; font-weight: 500;}
.circle-icon { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--text-color); border-radius: 50%; }
.btn-outline { background: transparent; border: 1px solid rgba(0,0,0,0.3); border-radius: 999px; padding: 0.5rem 1.2rem; font-size: 0.8rem; cursor: pointer; color: var(--text-color); transition: all 0.3s; margin-left: 0.5rem; }
.btn-outline:hover { background: rgba(0,0,0,0.05); }

/* Footer */
.ui-footer { bottom: 0; align-items: flex-end; font-size: 0.75rem; letter-spacing: 0.5px; }
.footer-center { text-align: center; text-transform: uppercase; }
.progress-title { margin-bottom: 4px; font-weight: bold; letter-spacing: 1px; }
.progress-title .percent { margin-left: 10px; font-weight: normal; }
.progress-hint { text-transform: none; color: #666; }
.btn-text { color: var(--text-color); text-decoration: none; border-bottom: 1px solid rgba(0,0,0,0.3); padding-bottom: 2px; text-transform: uppercase; letter-spacing: 1px; font-size: 0.7rem; }

/* Navigation Latérale */
.ui-sidenav { position: fixed; right: 2rem; top: 50%; transform: translateY(-50%); z-index: 100; }
.ui-sidenav ul { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.ui-sidenav li { width: 6px; height: 6px; border: 1px solid #999; border-radius: 50%; cursor: pointer; }
.ui-sidenav li.active { background-color: var(--accent-color); border-color: var(--accent-color); }

/* --- Conteneur Scène (Desktop: Plein écran) --- */
.scene-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1.5s ease 0.5s;
}
.scene-loaded { opacity: 1; }

.art-layer {
    position: relative;
    width: 95%; /* 100% avec espace */
    max-width: 1600px;
    aspect-ratio: 16 / 10;
}

@media (min-aspect-ratio: 16/10) {
    .art-layer {
        width: auto;
        height: 85vh; /* Assure que l'image reste entièrement visible à 100% de la hauteur dispo */
    }
}

/* --- Positionnement des images (Maquette) --- */


.floating-element { position: absolute; height: auto; opacity: 0; }
 
  
 
 

/* --- Bloc Texte (La découverte) --- */

.subtitle { 
    display: block;
    font-family: var(--ui-font); 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 2px; 
    color: #555; 
    opacity: 0; 
}
.title-block h1 { font-family: var(--title-font); font-size: 4.5rem; font-style: italic; color: color: #371f09; margin: 1rem 0; font-weight: normal; opacity: 0; }
.title-block p, .title-block blockquote { font-family: var(--title-font); font-size: 1.1rem; line-height: 1.6; color: #333; opacity: 0; }

/* --- Animations Apparition --- */

/* Animation des textes */
.scene-loaded .subtitle { animation: fadeInText 1s ease forwards; animation-delay: 0.5s; }
.scene-complete .title-block h1,
.scene-complete .title-block p,
.scene-complete .title-block blockquote,
.scene-complete .title-block cite { animation: fadeInText 1.8s ease forwards; animation-delay: 0s; }

.scene-complete .floating-element { animation: fadeInFloat 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards; }
.scene-complete .fin1 { animation-delay: .1s; }
.scene-complete .fin2 { animation-delay: .45s; }
.scene-complete .fin3 { animation-delay: .8s; }
.scene-complete .fin4 { animation-delay: 1.8s; }
.scene-complete .fin5 { animation-delay: 2.2s; }


@keyframes fadeInFloat { 0% { opacity: 0; translate: 0 20px; } 100% { opacity: 1; translate: 0 0; } }
@keyframes fadeInText { 0% { opacity: 0; transform: translateX(-20px); } 100% { opacity: 1; transform: translateX(0); } }

/* Style du bouton son pour l'aligner parfaitement avec les autres boutons outline */
.btn-outline.btn-sound {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;  /* Largeur du cercle */
    height: 38px !important; /* Hauteur identique pour un rond parfait */
    padding: 0 !important;
    border-radius: 50% !important; /* Transforme le bouton en cercle */
    vertical-align: middle;
    margin-right: 0.5rem;    /* Espace entre le bouton son et plein écran */
    background: transparent;
}

.btn-sound svg {
    stroke: var(--text-color);
    display: block;
}


/* Placement commun du texte, repris de la feuille fournie précédemment. */
.title-block { position: absolute; bottom: 20%; left: 48px; width: 30%; z-index: 10; pointer-events: none; }
.title-block cite { display: block; margin-top: .7rem; font: italic .85rem/1.5 var(--title-font); color: #555; opacity: 0; }

/* JAUGE DE REVELATION */ 
.reveal-gauge {
    position: relative;
    width: min(220px, 40vw);
    height: 1px;
    margin: 0 auto 12px;
    background: rgba(51, 51, 51, .15);
    overflow: hidden;
}

.reveal-gauge span {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent-color, #5b7965);
    transition: width .2s linear;
}
@media (prefers-reduced-motion: reduce) {
    .reveal-gauge span {
        transition: none;
    }
}


/* INSTRUCTION CONSIGNE */
.reveal-instruction {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
    width: min(90vw, 420px);
    text-align: center;
    font-family: var(--ui-font, Arial, sans-serif);
    color: #9a9a9a;
    text-shadow: 0 1px 12px #f6f5f0;
    pointer-events: none;
    opacity: 1;
    transition: opacity .4s ease;
}

.reveal-instruction strong {
    display: block;
    margin-bottom: .6rem;
    font-size: 1.1rem;
}

.reveal-instruction span {
    display: block;
    font-size: .8rem;
    line-height: 1.5;
}
.reveal-instruction[hidden] {
    display: none !important;
}

.scene-container.has-started .reveal-instruction {
    opacity: 0;
    visibility: hidden;
}

/* Conserver l’alignement du footer après retrait de la consigne */
@media (min-width: 901px) {
    
    .ui-footer .footer-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .ui-footer .footer-actions {
        margin-left: auto;
    }

}
/* FIN INSTRUCTION CONSIGNE */



/*  ################################################### */
/* --- Mode Responsive (Mobiles et petites tablettes) --- */
@media (max-width: 900px) {
    body { display: block; overflow-y: auto; overflow-x: hidden; }
    
    .ui-sidenav { display: none; }
    .hide-mobile { display: none !important; }
    
    /* Header */
    .ui-header { 
        position: static; 
        padding: 1rem 1.5rem 0; 
    }
    
    .mobile-top-info.show-mobile-flex {
        display: flex !important;
        justify-content: space-between;
        width: 100%;
        font-size: 0.65rem;
        letter-spacing: 1px;
        color: #777;
        text-transform: uppercase;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        padding-bottom: 0.8rem;
    }
    .mobile-top-info .percent { color: #333; font-weight: bold; }

     .controls.hide-mobile {
        display: none !important;
    }
    
    /* Scène centrale remontée */
    .scene-container { position: static; height: auto; width: 100%; display: block; padding-top: 1rem; opacity: 1;}
    .art-layer { aspect-ratio: auto; width: 100%; min-height: 55vh; }


/* Nettoyage radical de tout style natif de bouton pour .btn-text */
button.btn-text {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.3) !important;
    border-radius: 0 !important;
    padding: 0 0 2px 0 !important;
    margin: 0 !important;
    color: var(--text-color);
    font-family: var(--ui-font);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
    transition: opacity 0.3s ease;
}


    /* Le texte passe en premier plan (Z-index 100) */

    .title-block h1 { font-size: 3rem; margin: 0.5rem 0; }
    .title-block { position: relative; z-index: 100; width: 90%; margin: auto; text-align: center; left: 0;}
    /* Footer */
    .ui-footer { 
        position: static; 
        padding: 2rem 1.5rem 2.5rem; 
        width: 100%;
    }
    
    /* Actions alignées (Recommencer & Révéler) */
    .footer-actions {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    
    .show-mobile { display: block !important; }
}



