/* Accueil */
.accueil-logo { width: 200px; height: auto; }
@media (max-width: 767.98px) { .accueil-logo { width: 120px; } }

.accueil-etape {
    position: relative;
    margin-top: 1rem;
    padding: 1.75rem 1.25rem 1.25rem;
    border-radius: .75rem;
    background: #f4f2fb;
}
.accueil-numero {
    position: absolute;
    top: -1rem;
    left: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ffd700;
    color: #764ba2;
    font-weight: 700;
}

.accueil-theme { transition: transform .15s ease, box-shadow .15s ease; }
.accueil-theme:hover, .accueil-theme:focus-visible { transform: translateY(-3px); box-shadow: 0 .5rem 1rem rgba(118, 75, 162, .15); }
@media (prefers-reduced-motion: reduce) { .accueil-theme { transition: none; } .accueil-theme:hover { transform: none; } }

/* Identité visuelle : couleurs du logo (violet #764ba2, jaune #ffd700) */
:root {
    --bs-primary: #764ba2;
    --bs-primary-rgb: 118, 75, 162;
    --bs-link-color: #764ba2;
    --bs-link-color-rgb: 118, 75, 162;
    --bs-link-hover-color: #5a3880;
    --bs-link-hover-color-rgb: 90, 56, 128;
    --bs-focus-ring-color: rgba(118, 75, 162, .25);
}
.btn-primary {
    --bs-btn-bg: #764ba2;
    --bs-btn-border-color: #764ba2;
    --bs-btn-hover-bg: #653f8d;
    --bs-btn-hover-border-color: #5f3b86;
    --bs-btn-focus-shadow-rgb: 139, 102, 176;
    --bs-btn-active-bg: #5f3b86;
    --bs-btn-active-border-color: #59387e;
    --bs-btn-disabled-bg: #764ba2;
    --bs-btn-disabled-border-color: #764ba2;
}
.btn-outline-primary {
    --bs-btn-color: #764ba2;
    --bs-btn-border-color: #764ba2;
    --bs-btn-hover-bg: #764ba2;
    --bs-btn-hover-border-color: #764ba2;
    --bs-btn-focus-shadow-rgb: 118, 75, 162;
    --bs-btn-active-bg: #764ba2;
    --bs-btn-active-border-color: #764ba2;
    --bs-btn-disabled-color: #764ba2;
    --bs-btn-disabled-border-color: #764ba2;
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #bba5d1;
    box-shadow: 0 0 0 .25rem rgba(118, 75, 162, .25);
}
.form-check-input:checked { background-color: #764ba2; border-color: #764ba2; }
.dropdown-menu { --bs-dropdown-link-active-bg: #764ba2; }
.nav-tabs { --bs-nav-link-color: #764ba2; --bs-nav-link-hover-color: #5a3880; }

/* Barre de navigation : dégradé du logo, assombri pour la lisibilité du texte blanc */
.site-navbar { background: linear-gradient(90deg, #4b4fb8, #5e3a8a); }
.site-navbar .navbar-nav .nav-link { color: rgba(255, 255, 255, .85); }
.site-navbar .navbar-nav .nav-link:hover,
.site-navbar .navbar-nav .nav-link:focus-visible { color: #fff; }
.site-navbar .navbar-nav .nav-link.active { color: #fff; box-shadow: inset 0 -2px 0 #ffd700; }
.site-navbar .btn-light { color: #5e3a8a; font-weight: 600; }

/* Énigme : image et calque SVG à la largeur de l'écran, sans dépasser la taille d'origine */
.zone-jeu { position: relative; width: 100%; }
.zone-jeu-image { display: block; width: 100%; height: auto; }
.zone-jeu-calque { position: absolute; inset: 0; z-index: 1; }
.zone-jeu-calque .cibleSVG { display: block; width: 100%; height: 100%; }

/* Popup de résultat (zone trouvée, combinaison trouvée) */
.popup-resultat .modal-content { border: 0; border-radius: 1rem; box-shadow: 0 1rem 2.5rem rgba(60, 30, 100, .35); cursor: pointer; }
.popup-resultat .modal-body { padding: 2rem 1.5rem 1.25rem; }
.resultat-icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto 1rem;
    border: 3px solid #fff;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 700;
    box-shadow: 0 .25rem .75rem rgba(118, 75, 162, .3);
    animation: resultat-apparition .35s ease-out;
}
.resultat-zone { background: #ffd700; color: #764ba2; }
.resultat-gagne { background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; }
.resultat-titre { margin-bottom: .25rem; color: #764ba2; font-size: 1.5rem; font-weight: 700; }
.resultat-continuer { margin: 1.25rem 0 0; color: var(--bs-secondary-color); font-size: .8rem; }
@keyframes resultat-apparition { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.1); } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .resultat-icone { animation: none; } }

/* Compteur des zones trouvées (page d'énigme) */
.compteur-zones { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem .75rem; margin-top: .75rem; }
.compteur-pastilles { display: inline-flex; gap: .35rem; }
.pastille {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem; border: 2px solid #d9cfe8; border-radius: 50%;
    color: #b3a3cc; font-size: .8rem; font-weight: 700;
    transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.pastille.trouvee { background: #ffd700; border-color: #fff; color: #764ba2; box-shadow: 0 0 0 1px #e6c200; transform: scale(1.1); }
.compteur-texte { color: var(--bs-secondary-color); font-size: .9rem; }

/* Progression du joueur (accueil, page de thème) */
.progression { max-width: 24rem; }
.progress { --bs-progress-bar-bg: #764ba2; }

/* Cartes d'énigmes : état pour le joueur */
.card { position: relative; }
.carte-etat { position: absolute; top: .6rem; left: .6rem; z-index: 1; font-weight: 600; }
.carte-etat-resolue { background: #ffd700; color: #4a2d6b; }
.carte-etat-commencee { background: rgba(255, 255, 255, .9); color: #5e3a8a; }
.carte-resolue { border-color: #e6c200; }

/* Victoire : score et confettis */
.resultat-score { margin: .75rem 0 0; color: #5e3a8a; }
.popup-resultat .modal-content { overflow: hidden; }
.confettis { position: absolute; inset: 0; pointer-events: none; }
.confettis span {
    position: absolute; top: -10%; width: .5rem; height: .9rem; border-radius: 2px; opacity: 0;
    animation: confetti-chute 1.8s ease-in forwards;
}
.confettis span:nth-child(3n)   { background: #ffd700; }
.confettis span:nth-child(3n+1) { background: #764ba2; }
.confettis span:nth-child(3n+2) { background: #f5576c; }
.confettis span:nth-child(1)  { left: 5%;  animation-delay: 0s; }
.confettis span:nth-child(2)  { left: 12%; animation-delay: .15s; }
.confettis span:nth-child(3)  { left: 20%; animation-delay: .05s; }
.confettis span:nth-child(4)  { left: 27%; animation-delay: .3s; }
.confettis span:nth-child(5)  { left: 34%; animation-delay: .1s; }
.confettis span:nth-child(6)  { left: 41%; animation-delay: .25s; }
.confettis span:nth-child(7)  { left: 48%; animation-delay: 0s; }
.confettis span:nth-child(8)  { left: 55%; animation-delay: .2s; }
.confettis span:nth-child(9)  { left: 62%; animation-delay: .35s; }
.confettis span:nth-child(10) { left: 69%; animation-delay: .05s; }
.confettis span:nth-child(11) { left: 76%; animation-delay: .3s; }
.confettis span:nth-child(12) { left: 83%; animation-delay: .15s; }
.confettis span:nth-child(13) { left: 90%; animation-delay: .25s; }
.confettis span:nth-child(14) { left: 96%; animation-delay: .1s; }
@keyframes confetti-chute {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(26rem) rotate(540deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .confettis { display: none; } .pastille { transition: none; } }

/* Classement */
.classement td, .classement th { padding-top: .6rem; padding-bottom: .6rem; }
.classement-moi > td { background: #fff8d6; }

/* Difficulté des énigmes */
.difficulte { font-weight: 600; letter-spacing: .02em; }
.difficulte-facile { background: #d6f2df; color: #146c43; }
.difficulte-moyenne { background: #fff1c2; color: #8a5a00; }
.difficulte-difficile { background: #f8d7da; color: #a52834; }
