/* --- STYLE HYDRONEAL (Version Finale Zoom & Runes) --- */
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;700&family=Uncial+Antiqua&family=Noto+Sans+Runic&display=swap');

:root {
    --blood-red: #8a0b0b;
    --gold: #FFD700;
    --gold-dark: #b8860b;
    --parchment-bg: #d4c5a3;
    --ink-color: #2a1a0a;
    --bg-color: #2b1b17;
}

/* Scrollbar & Sélection */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: var(--blood-red); border-radius: 4px; }
::selection { background: var(--blood-red); color: var(--gold); text-shadow: 0 0 2px #000; }

body {
    margin: 0; padding: 0;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(255,215,0,0.02) 0%, rgba(0,0,0,0.95) 90%),
        url('https://www.transparenttextures.com/patterns/dark-leather.png');
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center;
    font-family: 'MedievalSharp', cursive; 
    overflow-x: hidden; 
    color: #f0e6d2;
}

/* MODAL DE ZOOM */
#zoom-modal {
    display: none; /* Caché par défaut */
    position: fixed; z-index: 99999; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.9); 
    flex-direction: column; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
    cursor: zoom-out;
}
.modal-content {
    margin: auto; display: block; 
    max-width: 90%; max-height: 80%;
    border: 5px solid var(--gold);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
    animation: zoomAnim 0.3s;
}
#caption {
    margin: auto; display: block; width: 80%; text-align: center; 
    color: var(--gold); padding: 10px 0; height: 150px; 
    font-family: 'Cinzel Decorative'; font-size: 1.5em;
}
@keyframes zoomAnim { from {transform:scale(0)} to {transform:scale(1)} }

/* Titres */
.title-wrapper { margin-top: 30px; margin-bottom: 20px; text-align: center; z-index: 10; padding: 0 20px; }

h1.main-title {
    font-family: 'Cinzel Decorative', cursive; 
    font-size: 5em; margin: 0; text-transform: uppercase;
    color: #FFD700;
    background: linear-gradient(to bottom, #fceabb 0%, #fccd4d 50%, #f8b500 51%, #fbdf93 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8)) drop-shadow(0 0 30px rgba(255, 140, 0, 0.4));
    animation: magicPulse 4s infinite alternate;
}

@keyframes magicPulse {
    0% { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)); transform: scale(1); }
    100% { filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1)) drop-shadow(0 0 50px rgba(255, 69, 0, 0.5)); transform: scale(1.02); }
}

h3.sub-title {
    font-family: 'Cinzel', serif; color: #e0c0a0; letter-spacing: 4px;
    margin-top: 10px; font-size: 1.2em; opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0,0,0,1);
}

/* Bougies */
.candle-container { position: fixed; top: 50%; transform: translateY(-50%); z-index: 5; pointer-events: none; }
.candle-left { left: 8%; } 
.candle-right { right: 8%; }
@media (max-width: 1200px) { .candle-container { display: none; } }

.candle-base {
    width: 40px; height: 140px;
    background: linear-gradient(90deg, #3e2723, #5d4037, #281815);
    border-radius: 4px; box-shadow: inset 0 -20px 30px rgba(0,0,0,0.8); margin: 0 auto;
}
.candle-wick { width: 2px; height: 15px; background: #111; margin: 0 auto; position: relative; top: 5px; }
.candle-flame {
    width: 16px; height: 45px;
    background: radial-gradient(ellipse at bottom, #fff 0%, #ffeb3b 40%, #ff9800 80%, transparent 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; margin: -10px auto 0;
    animation: flicker 0.1s infinite alternate;
    box-shadow: 0 -5px 15px rgba(255, 152, 0, 0.8), 0 -10px 30px rgba(255, 87, 34, 0.6);
}
.candle-glow {
    width: 150px; height: 150px;
    background: radial-gradient(circle, rgba(255, 152, 0, 0.15) 0%, transparent 70%);
    position: absolute; top: -50px; left: 50%; transform: translateX(-50%);
    animation: glow-pulse 3s infinite ease-in-out;
}
@keyframes flicker { 0% { transform: scale(1) rotate(-2deg); opacity: 0.9; } 100% { transform: scale(1.1) rotate(2deg); opacity: 1; } }
@keyframes glow-pulse { 0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); } 50% { opacity: 1; transform: translateX(-50%) scale(1.2); } }

/* Livre */
@keyframes bookAura {
    0% { filter: drop-shadow(0 30px 60px rgba(0,0,0,0.8)); }
    50% { filter: drop-shadow(0 30px 60px rgba(0,0,0,0.9)) drop-shadow(0 0 30px rgba(255, 215, 0, 0.1)); }
    100% { filter: drop-shadow(0 30px 60px rgba(0,0,0,0.8)); }
}
.book-wrapper {
    margin: 40px 0 60px 0; width: 95vw; display: flex; justify-content: center; z-index: 10;
    animation: bookAura 6s infinite ease-in-out;
}
.page { background-color: var(--parchment-bg); display: none; }
.page-loaded { display: block; }
.page-content {
    width: 100%; height: 100%; padding: 40px 30px; box-sizing: border-box;
    background-image: url('https://www.transparenttextures.com/patterns/aged-paper.png');
    box-shadow: inset 0 0 80px rgba(60, 40, 20, 0.25);
    border: 1px solid rgba(139, 69, 19, 0.1);
    color: var(--ink-color);
    position: relative; overflow: hidden; display: flex; flex-direction: column;
}

/* --- LOGOS BAS DE PAGE (COULEURS ET TAILLES FIXES) --- */
.page-bottom-mark-left, .page-bottom-mark-right {
    position: absolute !important; bottom: 15px !important; z-index: 5; opacity: 0.9;
}
/* Inversion des côtés */
.page-bottom-mark-left { right: 20px !important; left: auto !important; transform: rotate(5deg); }
.page-bottom-mark-right { left: 20px !important; right: auto !important; transform: rotate(-5deg); }

/* Taille des logos de coin & COULEUR (Pas de sépia) */
.page-bottom-mark-left img, .page-bottom-mark-right img {
    width: 80px !important; max-width: 80px !important; height: auto !important;
    filter: none !important; /* COULEURS RÉTABLIES */
    display: block;
    drop-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* --- LOGOS CENTRAUX GÉANTS --- */
.page-bottom-mark-center {
    position: absolute !important; bottom: 20px !important; left: 50% !important;
    transform: translateX(-50%) !important; z-index: 10 !important; width: 100%; text-align: center;
}
.page-bottom-mark-center img {
    width: 220px !important; /* TRÈS GROS */
    max-width: 220px !important; height: auto !important;
    filter: none !important; /* COULEURS RÉTABLIES */
    display: inline-block;
    drop-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

/* --- CARTE (FOND TRANSPARENT) --- */
.map-image {
    border: none !important;
    mix-blend-mode: multiply !important; 
    filter: contrast(1.2) sepia(0.3) !important;
    display: block; margin: 20px auto !important; width: 100%; opacity: 1 !important;
}

/* --- ETIQUETTES (AGRANDIES DESKTOP & CLIQUABLES) --- */
.label-img {
    height: 320px; /* ENCORE PLUS GRAND */
    width: auto; max-width: 45%; object-fit: contain; border: none; 
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3)); transition: transform 0.3s;
    cursor: zoom-in; /* Curseur loupe */
}
.label-img:hover { transform: scale(1.05) rotate(2deg); filter: drop-shadow(0 10px 15px rgba(0,0,0,0.4)); }

/* Couvertures */
.page--cover-front .page-content {
    padding: 0 !important; border: none !important; background-color: #050505;
    background-image: url('couverturegrimoire.png'); background-size: cover; background-position: center;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
    display: flex; justify-content: flex-end; align-items: center; flex-direction: column;
}
.page--cover-front .hint { color: #ddd; font-family: 'Cinzel'; margin-bottom: 40px; animation: pulse 2s infinite; text-shadow: 0 0 5px black; }
.page--cover-back .page-content {
    padding: 0 !important; border: none !important; background-color: #050505;
    background-image: url('couverturearriere.png'); background-size: cover; background-position: center;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
}
.page--inside-cover .page-content {
    background-color: #2a1a0a;
    background-image: url('https://www.transparenttextures.com/patterns/dark-leather.png');
    box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
    justify-content: center; align-items: center; border: none;
}
.ex-libris {
    border: 3px double #c5a059; padding: 20px 40px; color: #c5a059;
    font-family: 'Cinzel Decorative'; font-size: 2em; text-transform: uppercase;
    transform: rotate(-3deg); text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* --- CONTENU --- */
h2 {
    font-family: 'Cinzel Decorative'; color: var(--blood-red); font-size: 2em;
    text-align: center; border-bottom: 2px solid rgba(138, 11, 11, 0.2);
    padding-bottom: 10px; margin-bottom: 20px; text-shadow: 1px 1px 0 rgba(255,255,255,0.2);
}
h4 {
    font-family: 'Cinzel'; color: #4a0000; font-size: 1.2em; margin: 20px 0 5px 0;
    text-transform: uppercase; font-weight: bold; border-bottom: 1px solid rgba(138,11,11,0.1); display: inline-block;
}
p { font-size: 1.1em; line-height: 1.5; text-align: justify; margin: 0 0 15px 0; }

/* --- LETTRINE STYLE GRAVURE MÉDIÉVALE --- */
.drop-cap::first-letter { 
    float: left;
    font-family: 'Cinzel Decorative', cursive; /* Police ornementale */
    font-size: 3.5em; /* Grande taille */
    line-height: 0.85;
    margin-right: 15px;
    margin-top: 6px;
    padding: 10px 5px 5px 10px;
    
    /* Couleurs Or et Sang */
    color: var(--gold);
    background: linear-gradient(135deg, #2a1a0a 0%, #3e2723 100%);
    
    /* Effet Cadre/Gravure */
    border: 2px double var(--gold-dark);
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3); /* Ombre portée dure pour effet relief */
    border-radius: 4px;
    text-shadow: 1px 1px 0 #000;
}

.divider { text-align: center; color: var(--gold-dark); font-size: 1.5em; margin: 10px 0; }
.deco-icon { width: 100px; display: block; margin: 0 auto 15px auto; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }

/* Bestiaire */
.beast-card { display: flex; align-items: center; gap: 15px; border: 1px solid var(--gold-dark); padding: 10px; margin-top: 15px; background: rgba(0,0,0,0.03); transition: background 0.3s; }
.beast-card:hover { background: rgba(138, 11, 11, 0.08); }
.beast-card.alt { flex-direction: row-reverse; text-align: right; }
.beast-img { width: 90px; height: 90px; object-fit: cover; border-radius: 50%; border: 2px solid var(--blood-red); flex-shrink: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.3); cursor: zoom-in; }
.beast-name { color: var(--blood-red); font-weight: bold; font-family: 'Cinzel'; display: block; }

/* Interactions */
.btn-rune {
    background: linear-gradient(135deg, #2d1b15 0%, #1a0f0c 100%);
    color: var(--gold); padding: 12px 30px; font-family: 'Cinzel'; border: 2px solid var(--gold-dark);
    cursor: pointer; display: block; margin: 20px auto; transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3); text-transform: uppercase; letter-spacing: 1px;
}
.btn-rune:hover { background: linear-gradient(135deg, #3e2723 0%, #2d1b15 100%); border-color: var(--gold); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); transform: translateY(-2px); }
.btn-rune:active { transform: translateY(1px); }

.input-magic {
    background: transparent; border: none; border-bottom: 2px solid var(--blood-red);
    font-family: 'MedievalSharp'; font-size: 1.3em; width: 80%; margin: 20px auto;
    display: block; text-align: center; color: var(--ink-color); outline: none; transition: border-color 0.3s;
}
.input-magic:focus { border-bottom-color: var(--gold); }
.loader { display: none; width: 30px; height: 30px; border: 3px solid var(--gold); border-top-color: transparent; border-radius: 50%; animation: spin 1s linear infinite; margin: 10px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* UI */
#start-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.8s; }
.start-btn { padding: 20px 50px; font-size: 1.5em; background: transparent; color: var(--gold); border: 2px solid var(--gold); cursor: pointer; font-family: 'Cinzel Decorative'; text-transform: uppercase; box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); transition: all 0.5s; }
.start-btn:hover { background: rgba(255, 215, 0, 0.1); box-shadow: 0 0 40px rgba(255, 215, 0, 0.6); text-shadow: 0 0 10px var(--gold); }
.audio-control { position: fixed; bottom: 20px; right: 20px; z-index: 100; background: rgba(62, 39, 35, 0.8); color: var(--gold); width: 45px; height: 45px; border-radius: 50%; display: flex; justify-content: center; align-items: center; cursor: pointer; border: 2px solid var(--gold); font-size: 1.2em; transition: transform 0.3s; }
.audio-control:hover { transform: scale(1.1); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }

/* Footer */
footer { width: 100%; background: #1a0a0a; color: #dcbfa0; padding: 40px 20px; text-align: center; border-top: 2px solid var(--gold-dark); position: relative; z-index: 20; box-shadow: 0 -10px 20px rgba(0,0,0,0.5); }
.footer-content { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-around; flex-wrap: wrap; gap: 20px; }
.footer-col h4 { color: var(--gold); border-bottom: 1px solid #5d4037; padding-bottom: 5px; margin-bottom: 10px; font-family: 'Cinzel Decorative'; }
.footer-col a { color: #dcbfa0; text-decoration: none; display: block; margin: 5px 0; transition: color 0.3s; }
.footer-col a:hover { color: var(--gold); text-shadow: 0 0 5px var(--gold); }
.legal { margin-top: 30px; font-size: 0.8em; opacity: 0.6; }

/* --- RESPONSIVE MOBILE AVANCÉ : FLIP PRESERVÉ --- */
@media (max-width: 1000px) { 
    h1.main-title { font-size: 2.8em; } 
    .candle-container { display: none; } 
    
    .book-wrapper {
        margin: 20px 0;
        width: 100%; 
        height: 85vh; 
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .page-content {
        padding: 25px 20px !important;
        overflow-y: auto !important; 
        display: block !important;
        width: 100% !important;
        height: 100% !important;
    }

    .page h2 { font-size: 1.5em; margin-bottom: 10px; }
    .page p { font-size: 1.05em; line-height: 1.4; text-align: left; }
    
    /* Logos ajustés sur mobile */
    .page-bottom-mark-left img, .page-bottom-mark-right img, .page-bottom-mark-center img {
        width: 60px !important; /* Taille raisonnable sur mobile */
        opacity: 0.5; /* Plus discret */
    }
    
    .page-bottom-mark-center { bottom: 10px !important; }
    .page-bottom-mark-left, .page-bottom-mark-right { bottom: 10px !important; }

    /* Modale sur mobile */
    .modal-content {
        max-width: 95%;
        max-height: 70%;
    }
    #caption {
        font-size: 1.2em;
        width: 90%;
    }
}
