/* Mission 0 – Quête 1
   Styles de la popup d'indice
   Auteur : Phenix Info
*/

#enigme-popup {
    position: fixed;
    inset: 0;
    display: none; /* affichée quand .visible */
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
}

#enigme-popup.visible {
    display: flex;
}

.enigme-popup-inner {
    background: #111;
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    max-width: 320px;
    width: 90%;
    text-align: center;
    font-family: inherit;
    position: relative;
}

.enigme-popup-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.enigme-popup-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 0.4rem;
}

.enigme-popup-indice {
    font-size: 16px;
    opacity: 0.95;
    margin-bottom: 0.6rem;
}

.enigme-popup-letters {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.2rem 0 0.6rem;
}

.enigme-popup-letter {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    opacity: 0.4;
    font-family: "Smythe", Sans-serif;
}

.enigme-popup-letter.found {
    background: #f5c144;
    color: #111;
    border-color: #f5c144;
    opacity: 1;
}

.enigme-popup-hint {
    font-size: 16px;
    opacity: 0.8;
}

.enigme-popup-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding:0;
    width: 40px;
    height: 40px;
}

/* =========================================================
   Game Master – icône flottante + popup d’aide Mission 0
   ========================================================= */

   .gm-helper-button {
       position: fixed;
       bottom: 20px;
       right: 20px;
       z-index: 10000;
       background: #111;
       color: #fff;
       border-radius: 999px;
       border: 1px solid rgba(245, 193, 68, 0.8);
       padding: 8px 10px;
       display: flex;
       align-items: center;
       justify-content: center;
       font-family: inherit;
       cursor: pointer;
       box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
   }

   /* Conteneur interne : picto au-dessus, texte en dessous */
   .gm-helper-inner {
       display: flex;
       flex-direction: column;
       align-items: center;
       gap: 4px;
   }

   /* Rond avec le pictogramme "?" */
   .gm-helper-icon {
       width: 30px;
       height: 30px;
       border-radius: 50%;
       background: #f5c144;
       color: #111;
       display: flex;
       align-items: center;
       justify-content: center;
   }

   .gm-helper-icon-symbol {
       font-weight: 700;
       font-size: 18px;
       line-height: 1;
   }

   /* Texte "Game Master" centré sous l’icône */
   .gm-helper-label {
       font-size: 18px;
       text-transform: uppercase;
       letter-spacing: 0.08em;
       line-height: 1.1;
       text-align: center;
   }

   /* Mobile tweaks */
   @media (max-width: 767px) {
       .gm-helper-button {
           bottom: 14px;
           right: 14px;
           padding: 6px 8px;
       }

       .gm-helper-icon {
           width: 26px;
           height: 26px;
       }

       .gm-helper-icon-symbol {
           font-size: 16px;
       }

       .gm-helper-label {
           font-size: 16px;
       }
   }

/* Popup Game Master */

#gm-helper-popup {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10001;
}

#gm-helper-popup.gm-helper-visible {
    display: flex;
}

.gm-helper-popup-inner {
    background: #111;
    color: #fff;
    border-radius: 14px;
    padding: 1.2rem 1.4rem 1rem;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    position: relative;
    font-family: inherit;
}

.gm-helper-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
}

.gm-helper-header {
    margin-bottom: 0.6rem;
}

.gm-helper-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.gm-helper-subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
}

.gm-helper-content {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.gm-helper-content p {
    margin: 0 0 0.4rem;
}

.gm-helper-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.gm-helper-prev,
.gm-helper-next {
    border: none;
    background: #222;
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.gm-helper-prev:hover,
.gm-helper-next:hover {
    background: #333;
}

.gm-helper-counter {
    flex: 1;
    text-align: center;
    opacity: 0.8;
}

/* Mobile tweaks */
@media (max-width: 767px) {
    .gm-helper-button {
        bottom: 14px;
        right: 14px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .gm-helper-icon {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .gm-helper-popup-inner {
        max-width: 320px;
        padding: 1rem 1.1rem 0.9rem;
    }
}


/* =========================================================
   Game Master – icône flottante + popup d’aide Mission 0
   ========================================================= */

.gm-helper-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    background: #111;
    color: #fff;
    border-radius: 999px;
    border: 1px solid rgba(245, 193, 68, 0.8);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.gm-helper-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f5c144;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
}

.gm-helper-label {
    line-height: 1.2;
}

/* Popup Game Master */

#gm-helper-popup {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    z-index: 10001;
}

#gm-helper-popup.gm-helper-visible {
    display: flex;
}

.gm-helper-popup-inner {
    background: #111;
    color: #fff;
    border-radius: 14px;
    padding: 1.2rem 1.4rem 1rem;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    position: relative;
    font-family: inherit;
}

.gm-helper-close {
    position: absolute;
    top: 6px;
    right: 8px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    padding: 0;
}

.gm-helper-header {
    margin-bottom: 0.6rem;
}

.gm-helper-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.15rem;
}

.gm-helper-subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
}

.gm-helper-content {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.8rem;
}

.gm-helper-content p {
    margin: 0 0 0.4rem;
}

.gm-helper-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.gm-helper-prev,
.gm-helper-next {
    border: none;
    background: #222;
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.gm-helper-prev:hover,
.gm-helper-next:hover {
    background: #333;
}

.gm-helper-counter {
    flex: 1;
    text-align: center;
    opacity: 0.8;
}

/* Mobile tweaks */
@media (max-width: 767px) {
    .gm-helper-button {
        bottom: 14px;
        right: 14px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .gm-helper-icon {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .gm-helper-popup-inner {
        max-width: 320px;
        padding: 1rem 1.1rem 0.9rem;
    }
}



/* =========================================================
   QUEST 2 – Rune texts
   ========================================================= */

.rune {
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* Quand encodé → police Rune sur le conteneur ET sur ses enfants */
.rune-encoded,
.rune-encoded * {
    font-family: "Rune", sans-serif !important;
    letter-spacing: 0.08em;
}

/* Animation longue qui clignote plusieurs fois */
.rune-encoded {
    animation: rune-encode 2s ease;
}

/* Retour à la normale avec un petit flicker */
.rune-decoded {
    animation: rune-decode 1.2s ease;
}

@keyframes rune-encode {
    0%   { opacity: 1;   filter: blur(0); }
    15%  { opacity: 0;   filter: blur(2px); }
    30%  { opacity: 1;   filter: blur(0); }
    45%  { opacity: 0;   filter: blur(2px); }
    60%  { opacity: 1;   filter: blur(0); }
    75%  { opacity: 0;   filter: blur(2px); }
    100% { opacity: 1;   filter: blur(0); }
}

@keyframes rune-decode {
    0%   { opacity: 1;   filter: blur(0); }
    25%  { opacity: 0;   filter: blur(2px); }
    50%  { opacity: 1;   filter: blur(0); }
    75%  { opacity: 0.4; filter: blur(1px); }
    100% { opacity: 1;   filter: blur(0); }
}

/* =========================================================
   QUEST 2 – Conteneur draggable + interrupteur ancien
   ========================================================= */

.conteneur-switch {
    position: relative;
}

/* Flag optionnel si tu veux le styliser une fois déplacé */
.conteneur-switch.quest2-moved {
    /* ex : box-shadow, bordure, etc. */
}

/* Bouton du switch – transparent, centré, positionné par JS "sous" le conteneur */
.quest2-switch-toggle {
    background-color: transparent;
    border: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Contenu interne : switch + label empilés */
.quest2-switch-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Plaque de l’interrupteur */
.quest2-switch-base {
    position: relative;
    width: 76px;
    height: 38px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #444, #181818);
    border: 1px solid #f5c144;
    box-shadow:
        inset 0 0 4px rgba(0, 0, 0, 0.9),
        0 4px 10px rgba(0, 0, 0, 0.7);
    padding: 4px 6px;
    display: flex;
    align-items: center;
}

/* Poignée circulaire */
.quest2-switch-handle {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fdfdfd, #bfbfbf);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(0);
    transition: transform 0.28s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Symbole runique sur la poignée */
.quest2-switch-rune {
    font-family: "Rune", serif;
    font-size: 18px;
    line-height: 1;
    color: #111;
}

/* État ON : poignée à droite + plaque lumineuse */
.quest2-switch-toggle.quest2-on .quest2-switch-handle {
    transform: translateX(32px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.quest2-switch-toggle.quest2-on .quest2-switch-base {
    background: radial-gradient(circle at 30% 30%, #f5c144, #6a4a14);
}

/* Label du switch (tes réglages) */
.quest2-switch-label {
    font-size: 16px;
    text-transform: none;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-align: center;
}

/* Popup Quête 2 */
#quest2-popup {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9999;
}

#quest2-popup.visible {
    display: flex;
}

/* Mobile tweaks */
@media (max-width: 767px) {
    .quest2-switch-base {
        width: 68px;
        height: 34px;
        padding: 3px 5px;
    }

    .quest2-switch-handle {
        width: 22px;
        height: 22px;
    }

    .quest2-switch-toggle.quest2-on .quest2-switch-handle {
        transform: translateX(28px);
    }

    .quest2-switch-label {
        font-size: 14px;
    }
}

.quest3-trigger {
    display: inline-block;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease, transform 0.2s ease;
}

.quest3-trigger strong u {
    text-decoration-thickness: 2px;
}

.quest3-trigger:hover {
    transform: translateY(-1px);
}

.quest3-trigger.quest3-found strong u {
    color: #f5c144;
    text-decoration-color: #f5c144;
}


.quest3-final-form{
    margin-top: 10px;
}

label {
    line-height: 2!important;
}

.quest3-final-validate, .mission0-final-validate{
    margin-top: 10px;
}

.mission0-final-close{
    float: right;
}
