
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #f1e2cf;
    background: #100a19;
    font-family: Georgia, "Times New Roman", serif;
}

.laboratoire {
    min-height: 100vh;
    padding-bottom: 50px;

    background:
        linear-gradient(
            rgba(17, 8, 29, 0.45),
            rgba(12, 6, 21, 0.78)
        ),
        url("../images/laboratoire.png")
        center top / cover fixed no-repeat;
}

.entete {
    position: relative;
    max-width: 1100px;
    margin: auto;
    padding: 90px 24px 55px;
    text-align: center;
}

.retour {
    position: absolute;
    top: 25px;
    left: 24px;
    color: #edc88d;
    text-decoration: none;
}

.retour:hover {
    color: white;
    text-shadow: 0 0 12px gold;
}

.sur-titre {
    color: #d7b48a;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

h1 {
    margin: 12px 0;
    color: #f0ca8c;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: normal;
    text-shadow: 0 0 25px rgba(245, 187, 102, 0.35);
}

.introduction {
    max-width: 650px;
    margin: 20px auto;
    font-size: 1.1rem;
    font-style: italic;
}

.collection {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 35px;

    width: min(1100px, calc(100% - 48px));
    margin: 30px auto 80px;
	align-items: start 	;
}

.grimoire {
    min-height: 340px;
    padding: 35px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;

    color: #edcf9a;
    font-family: inherit;
    cursor: pointer;

    border: 2px solid #a87946;
    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            rgba(89, 48, 77, 0.94),
            rgba(29, 15, 42, 0.96)
        );

    box-shadow:
        inset 0 0 30px rgba(225, 166, 90, 0.12),
        0 15px 40px rgba(0, 0, 0, 0.65);

    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
}

.grimoire:hover,
.grimoire:focus-visible {
    transform: translateY(-10px);

    box-shadow:
        0 0 35px rgba(189, 112, 255, 0.45),
        0 20px 45px rgba(0, 0, 0, 0.7);
}

.symbole {
    font-size: 4rem;
    color: #e8bc76;
    text-shadow: 0 0 25px rgba(244, 190, 99, 0.5);
}

.numero {
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.nom {
    font-size: 1.6rem;
    text-align: center;
}

.invitation {
    margin-top: 25px;
    font-size: 0.9rem;
    font-style: italic;
}

footer {
    text-align: center;
    color: #d9b88e;
    font-style: italic;
}

@media (max-width: 800px) {
    .collection {
        grid-template-columns: 1fr;
        max-width: 380px;
    }

    .grimoire {
        min-height: 270px;
    }

    .entete {
        padding-top: 95px;
    }
}

.grimoire {
    display: flex;
	flex-direction: column;
    min-height: 340px;
    padding: 0;
}

.grimoire summary {
    min-height: 340px;
    padding: 35px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
	justify-content: flex-start;
    gap: 18px;

    cursor: pointer;
    list-style: none;
}

.grimoire summary::-webkit-details-marker {
    display: none;
}

.grimoire[open] {
    box-shadow:
        0 0 35px rgba(189, 112, 255, 0.35),
        0 20px 45px rgba(0, 0, 0, 0.7);
}

.grimoire[open] .invitation {
    opacity: 0.6;
}

.contenu-enigme {
    flex: 1;
    display: flex;
    flex-direction: column;

    padding: 25px 24px 32px;
    text-align: center;

    color: #38251a;
    line-height: 1.8;

    background: url("../images/parchemin.jpg")
                center center / cover no-repeat;

    border-top: 1px solid rgba(120, 76, 37, 0.5);
}
.contenu-enigme p {
    margin: 18px 0;
    font-size: 1rem;
    font-style: italic;
}

.repondre {
    margin-top: auto;
    padding: 12px 20px;
    color: #f2d39b;
    font-family: inherit;
	align-self: center;
    font-size: 0.95rem;
    cursor: pointer;

    border: 1px solid #d1a264;
    border-radius: 5px;
    background: rgba(64, 29, 73, 0.9);

    transition: box-shadow 0.3s, transform 0.3s;
}

.repondre:hover {
    box-shadow: 0 0 22px rgba(223, 162, 255, 0.4);
    transform: translateY(-2px);
}
/* Jeu interactif des énigmes */

.jeu-enigme {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-top: auto;
}

.champ-reponse {
    width: 100%;
    max-width: 260px;
    padding: 12px;
    border: 1px solid #a87946;
    border-radius: 5px;
    background: rgba(255, 248, 224, 0.85);
    color: #38251a;
    font-family: Georgia, serif;
    font-size: 1rem;
    text-align: center;
}

.champ-reponse:focus {
    outline: 2px solid #a87946;
}

.jeu-enigme .repondre {
    margin-top: 0;
    align-self: center;
}

.message-reponse {
    margin: 0;
    min-height: 24px;
    font-size: 0.95rem;
    font-style: italic;
    text-align: center;
}

.message-reponse.succes {
    color: #386b35;
    font-weight: bold;
	
}
.message-reponse.erreur {
    color: #b71b47;
text-shadow:
        1px 1px 1px rgba(55, 20, 35, 0.55),
        0 0 3px rgba(255, 245, 220, 0.7);
}

.demande-indice {
    color: #65412f;
    text-decoration: none;
    font-style: italic;
}

.demande-indice:hover {
    color: #9b6335;
    text-decoration: underline;
}
/* Révélation des secrets */

.reveler-secret {
    display: block;
    margin: 5px auto 0;
    padding: 8px 5px;
    border: none;
    background: transparent;
    color: #70412d;
    font-family: Georgia, serif;
    font-size: 0.85rem;
    font-style: italic;
    text-decoration: underline;
    cursor: pointer;
}

.reveler-secret:hover {
    color: #b71b47;
}

.secret-devoile {
    color: #59305c;
    font-weight: bold;
    font-style: italic;
    text-align: center;
    line-height: 1.6;
}

/* Garder les éléments cachés tant que nécessaire */
.reveler-secret[hidden],
.secret-devoile[hidden] {
    display: none;
}
/* Grimoires des prochaines énigmes */

.grimoire-scelle {
    opacity: 0.75;
    cursor: default;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 35px 20px;
    text-align: center;
}

.grimoire-scelle:hover {
    transform: none;
    box-shadow:
        inset 0 0 30px rgba(225, 166, 90, 0.12),
        0 15px 40px rgba(0, 0, 0, 0.65);
}

.grimoire-scelle .symbole {
    color: #d4af70;
}

.illustration-enigme {
    display: block;
    width: 100%;
    max-width: 650px;
    height: auto;
    margin: 20px auto;
    border-radius: 8px;
}

/* Fenêtre d'agrandissement de l'énigme */

.fenetre-image:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 8, 20, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 55px 15px 20px;
    box-sizing: border-box;
}

.fenetre-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.fermer-image {
    position: absolute;
    top: 12px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 42px;
    cursor: pointer;
}