/* --- Styles de base et Overlays --- */
body {
    background-image: url('images/fond_mission2.png');
    background-size: cover;
    background-position: center;
    font-family: 'Lora', serif;
    color: #e0dacc;
    margin: 0;
    overflow: hidden;
}
.mission-wrapper {
    width: 100vw; height: 100vh; display: flex;
    justify-content: center; align-items: center; text-align: center;
    background: rgba(26, 18, 11, 0.8);
}
h1, h2 { font-family: 'Cinzel', serif; color: #d4af37; }
.trial-overlay {
    display: none; position: fixed; top: 0; left: 0;
    width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px); justify-content: center; align-items: center;
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.trial-content {
    background: #1a120b; padding: 2rem; border-radius: 10px;
    border: 1px solid #4a3f35; max-width: 90vw; max-height: 90vh; overflow-y: auto;
}
.feedback-message { margin-top: 1rem; font-style: italic; min-height: 24px; }
.feedback-message.error { color: #dc3545; }
.feedback-message.success { color: #28a745; }
form { margin-top: 1rem; display: flex; justify-content: center; gap: 1rem; }
input[type="text"] {
    background: transparent; border: 1px solid #4a3f35; color: #e0dacc;
    padding: 0.5rem; font-family: 'Lora', serif;
}
form button { background: #d4af37; border: none; padding: 0.5rem 1rem; cursor: pointer; }

/* --- Écran de départ --- */
#start-screen { padding: 2rem; }
#start-mission-btn {
    background-color: #d4af37; color: #1a120b; border: none; padding: 15px 30px;
    font-family: 'Cinzel', serif; font-size: 1.2rem; cursor: pointer; transition: all 0.3s;
}
#start-mission-btn:hover { background-color: #e0dacc; }

/* --- Épreuve 1 : Écriture en Miroir --- */
#mirror-image { max-width: 100%; max-height: 300px; margin: 1rem 0; border: 1px solid #4a3f35; }

/* --- Épreuve 2 : Blueprint --- */
.blueprint-puzzle {
    display: flex; flex-direction: column; align-items: center; gap: 2rem; margin-top: 1rem;
}
#puzzle-board {
    width: 450px; height: 450px;
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
    border: 2px dashed #4a3f35;
    position: relative;
}
.drop-slot { border: 1px solid #333; background-color: rgba(0,0,0,0.2); }
#puzzle-pieces {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    width: 450px;
}
.puzzle-piece {
    width: 150px; height: 150px; cursor: grab;
    transition: transform 0.2s, opacity 0.2s;
}
.puzzle-piece.dragging { opacity: 0.5; transform: scale(1.1); cursor: grabbing; }
.drop-slot.correct .puzzle-piece { cursor: default; }
.coordinates-overlay {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7); color: #d4af37;
    padding: 10px 20px; border-radius: 5px;
    font-family: 'Cinzel', serif; font-size: 1.2rem;
    letter-spacing: 1px;
    opacity: 0;
    animation: fadeIn 1s forwards;
    animation-delay: 0.5s;
}
.hidden-riddle {
    max-height: 0;
    overflow: hidden;
    transition: max-height 1s ease-in-out, margin-top 1s ease-in-out;
}
.hidden-riddle.visible {
    max-height: 300px;
    margin-top: 2rem;
}
.riddle-text {
    border-top: 1px solid #4a3f35;
    padding-top: 1.5rem;
    margin-bottom: 1rem;
}

/* --- Modal de Zoom --- */
.zoom-modal-container {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.9);
    justify-content: center; align-items: center;
}
#zoom-content { max-width: 90vw; max-height: 90vh; display: flex; justify-content: center; align-items: center; }
#zoom-content img { width: 100%; height: 100%; object-fit: contain; }
.close-zoom-btn {
    position: absolute; top: 15px; right: 35px; color: #f1f1f1;
    font-size: 40px; font-weight: bold; cursor: pointer; transition: color 0.3s;
}
.close-zoom-btn:hover { color: #bbb; }

/* --- Épreuve 3 : La Cène --- */
.image-container { display: flex; flex-direction: column; align-items: center; }
#cene-image { max-width: 100%; max-height: 250px; border-radius: 5px; }
.inspect-button {
    margin-top: 1rem; background-color: transparent; border: 1px solid #d4af37;
    color: #d4af37; padding: 8px 16px; cursor: pointer; transition: all 0.3s;
}
.inspect-button:hover { background-color: #d4af37; color: #1a120b; }
.apostle-container {
    margin: 1.5rem auto; padding: 1rem; background: rgba(0,0,0,0.3);
    border: 1px solid #4a3f35; border-radius: 5px; max-width: 500px;
}
#apostle-list {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 1rem; margin-top: 1rem;
}
.apostle-name {
    font-family: 'Cinzel', serif; font-size: 1.3rem; color: #d4af37;
    padding: 0.5rem; background-color: #2a1d13; border-radius: 3px;
}
#cene-input { letter-spacing: 2px; text-align: center; }

/* --- Écran de succès --- */
.rewards { display: flex; justify-content: center; gap: 2rem; margin: 2rem 0; }
.rewards img { max-width: 150px; height: auto; }
.proceed-button {
    display: inline-block; text-decoration: none; margin-top: 1rem; background-color: #d4af37;
    color: #1a120b; padding: 10px 25px; font-family: 'Cinzel', serif;
}