/* ===== CreaZ.fr – Création de votre Zoo ===== */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: "Trebuchet MS", Arial, sans-serif; color: #f2f8ff;
  background: radial-gradient(circle at 30% 20%, #2f8fe8, #0b3a7a) fixed;
}
main { flex: 1; }
a { color: #bfe3ff; }
h1, h2, h3 { color: #ffffff; }

/* ----- En-tête ----- */
.entete {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 8px 20px; background: #ffffff; border-bottom: 4px solid #29a3ff; color: #1a2b4c;
}
.entete .logo img { display: block; height: 64px; width: auto; }
.entete .centre {
  justify-self: center; font-size: 1.1rem; font-weight: bold; color: #0b4fa0; text-decoration: none;
  padding: 7px 18px; border-radius: 20px; background: #e3f2ff;
}
.entete .centre:hover { background: #cbe7ff; }
.entete .droite { justify-self: end; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; justify-content: flex-end; }
.entete .joueur a { color: #0b72d6; }
@media (max-width: 760px) {
  .entete { grid-template-columns: 1fr; text-align: center; }
  .entete .droite, .entete .centre, .entete .logo { justify-self: center; justify-content: center; }
}

/* ----- Menu des langues ----- */
.langue { position: relative; }
.langue summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px; background: #e3f2ff; color: #1a2b4c; font-weight: bold; user-select: none;
}
.langue summary::-webkit-details-marker { display: none; }
.menu-langue {
  position: absolute; right: 0; top: calc(100% + 5px); z-index: 100; min-width: 150px;
  background: #ffffff; border-radius: 10px; padding: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.menu-langue a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: #1a2b4c; text-decoration: none; font-weight: bold; }
.menu-langue a:hover { background: #e3f2ff; }
.drapeau { width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.25); flex-shrink: 0; }

/* ----- Pied de page ----- */
.pied { text-align: center; padding: 15px; font-size: .9rem; background: rgba(0,0,0,.25); line-height: 1.6; }

/* ----- Publicités ----- */
.bandeau-pub { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; max-width: 728px; margin: 0 auto; }
.etiquette-pub { font-size: .7rem; opacity: .75; text-transform: uppercase; letter-spacing: 1px; }
.bandeau-pub img { display: block; max-width: 100%; height: auto; border-radius: 8px; }

/* ----- Éléments communs ----- */
.carte { background: rgba(4,25,60,.35); border-radius: 18px; padding: 25px 30px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.bouton {
  display: inline-block; font-size: 1.05rem; padding: 10px 18px; border: none; border-radius: 10px; cursor: pointer;
  background: #ffffff; color: #0b4fa0; font-weight: bold; text-decoration: none; font-family: inherit; text-align: center;
}
.bouton:hover { background: #dff0ff; }
.bouton:disabled { opacity: .6; cursor: wait; }
.bouton.secondaire { background: transparent; color: #ffffff; box-shadow: inset 0 0 0 2px #ffffff; }
.bouton.secondaire:hover { background: rgba(255,255,255,.12); }
.erreur { color: #ffd0d0; font-weight: bold; background: rgba(229,57,53,.25); padding: 8px 12px; border-radius: 8px; }
.centre-texte { text-align: center; }
.a-completer { background: #ffe082; color: #222; padding: 0 4px; border-radius: 3px; }
.note { font-size: .85rem; opacity: .8; }

/* Formulaires */
input[type=email], input[type=text], input[type=tel], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: none; font-size: 1rem; font-family: inherit; color: #1a2b4c;
}
.case-a-cocher { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: .95rem; line-height: 1.45; cursor: pointer; }
.case-a-cocher input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.centre-case { justify-content: center; margin: 15px 0; }

/* ----- Chargement (cgv = 0) : les 3 points apparaissent puis disparaissent ----- */
.chargement { font-size: 1.1rem; }
.points span { opacity: 0; animation: point 1.8s infinite; }
.points span:nth-child(2) { animation-delay: .3s; }
.points span:nth-child(3) { animation-delay: .6s; }
@keyframes point { 0%, 10% { opacity: 0; } 25%, 65% { opacity: 1; } 80%, 100% { opacity: 0; } }

/* ----- Têtes d'animaux ----- */
.tete { display: block; }

/* ===== Accueil ===== */
.page-accueil { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 20px; }
.page-accueil .barre-haut { width: 100%; max-width: 728px; display: flex; justify-content: flex-end; }
.lien-18 {
  font-size: .9rem; font-weight: bold; color: #ffffff; text-decoration: none;
  padding: 6px 14px; border-radius: 20px; background: rgba(0,0,0,.3);
}
.lien-18:hover { background: rgba(0,0,0,.45); }
.page-accueil .carte { max-width: 460px; width: 100%; text-align: center; }
.logo-grand { width: 100%; max-width: 360px; height: auto; background: #fff; border-radius: 14px; padding: 8px; }
.page-accueil p { line-height: 1.5; }
.formulaire-entree { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.formulaire-entree label { font-weight: bold; margin-top: 6px; }
.formulaire-entree .case-a-cocher { font-weight: normal; }
.formulaire-entree .bouton { margin-top: 12px; font-size: 1.15rem; }
.top { text-align: left; padding-left: 25px; }
.top li { margin: 4px 0; }

/* ===== Jeu ===== */
.page-jeu { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
.compteurs { display: flex; gap: 25px; font-size: 1.1rem; flex-wrap: wrap; align-items: center; }
.adversaire { display: inline-flex; align-items: center; gap: 6px; }
.mini-tete { display: inline-block; width: 34px; height: 34px; background: #fff; border-radius: 50%; padding: 2px; }
.mini-tete .tete { width: 100%; height: 100%; }
.ligne-statut { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 3em; }
#statut { font-size: 1.15rem; font-weight: bold; }

.plateau { display: flex; align-items: flex-start; gap: 38px; }
.colonne-grille { display: flex; flex-direction: column; gap: 12px; width: min(92vw, 450px); }

#grille {
  display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px;
  width: 100%; padding: 10px; background: rgba(0,0,0,.25); border-radius: 14px;
}
.case {
  position: relative; overflow: hidden; aspect-ratio: 1; padding: 0; cursor: pointer;
  border: 2px solid #bfe3ff; border-radius: 9px;
  background: linear-gradient(160deg, #5ab4ff, #1e88e5);
  font-size: clamp(14px, 4vw, 22px); font-weight: bold; color: #1a2b4c;
  display: flex; align-items: center; justify-content: center; transition: transform .1s;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.case:hover:not(.revelee) { transform: scale(1.08); }
.case.revelee { background: #eaf5ff; border-color: #cfe8ff; cursor: default; }
.case.par-adv { background: #fff1cc; border-color: #ffe08a; }
.case.croco { background: #ffb4b4; border-color: #e57373; }
.case.mordu { animation: clac .5s; }
.case .pouce { width: 62%; height: 62%; }

/* Animal + numéro : il le tient, le porte sur la tête ou s'assoit dessus */
.animal { position: absolute; inset: 0; }
.animal .tete { position: absolute; width: 72%; height: 72%; }
.badge {
  position: absolute; min-width: 40%; height: 36%; padding: 0 2px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(10px, 2.6vw, 15px); font-weight: bold; color: #fff; border: 1.5px solid #fff; line-height: 1;
}
.pose-tient .tete { left: 0; top: 0; }
.pose-tient .badge { right: 2%; bottom: 2%; }
.pose-tete .tete { left: 14%; bottom: 0; }
.pose-tete .badge { left: 50%; top: 1%; transform: translateX(-50%); }
.pose-assis .tete { left: 14%; top: 0; }
.pose-assis .badge { left: 50%; bottom: 1%; transform: translateX(-50%); border-radius: 5px; min-width: 52%; height: 30%; }
.n1 { background: #1e88e5; } .n2 { background: #43a047; } .n3 { background: #e53935; } .n4 { background: #5e35b1; }
.n5 { background: #ef6c00; } .n6 { background: #00897b; } .n7 { background: #212121; } .n8 { background: #757575; }

.boutons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.action {
  font-size: 1rem; padding: 10px 16px; border: none; border-radius: 10px; cursor: pointer;
  background: #ffffff; color: #0b4fa0; font-weight: bold; font-family: inherit;
}
.choix-mode { display: inline-flex; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 2px #ffffff; }
.choix-mode .mode {
  font-size: 1rem; padding: 10px 14px; border: none; cursor: pointer; font-weight: bold; font-family: inherit;
  background: rgba(0,0,0,.25); color: #ffffff; display: flex; align-items: center; gap: 6px;
}
.choix-mode .mode .pouce { width: 1.25em; height: 1.25em; }
.choix-mode .mode::before { content: '☐'; font-size: 1.1em; }
.choix-mode .mode.actif::before { content: '☑'; }
.choix-mode .mode.actif { background: #e3d4fb; color: #3b2a63; }
.choix-mode .mode#mode-suspecter.actif { background: #e3d4fb; color: #3b2a63; }
.legende { font-size: .9rem; opacity: .9; }
.legende span { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; }

#regles { position: relative; width: 300px; background: rgba(0,0,0,.25); border-radius: 14px; padding: 15px 22px; transform-origin: center; }
#regles h2 { margin-top: 0; padding-right: 35px; }
#regles ol { padding-left: 22px; }
#regles li { margin: 4px 0; }
#regles p { line-height: 1.45; font-size: .95rem; }
.fermer {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.15); color: #ffffff; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.fermer:hover { background: rgba(255,255,255,.3); }
#regles.fermeture { animation: retrecir .4s ease forwards; }
#regles.ouverture { animation: agrandir .4s ease; }
#btn-regles.apparait { animation: pop .35s ease; }

.largeur-jeu { width: min(92vw, 788px); }
.bouton-infos {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 22px;
  border-radius: 16px; background: #ffffff; color: #0b4fa0; font-weight: bold; text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: transform .15s;
}
.bouton-infos:hover { transform: scale(1.04) rotate(-1deg); }
.rangee-tetes { display: flex; gap: 8px; }
.rangee-tetes .tete { width: 54px; height: 54px; }

.secoue { animation: secoue .5s; }
@keyframes clac { 0%,100% { transform: scale(1); } 30% { transform: scale(1.5); } 60% { transform: scale(.9); } }
@keyframes secoue {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}
@keyframes retrecir { to { transform: scale(0); opacity: 0; } }
@keyframes agrandir { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }

@media (max-width: 860px) {
  .page-jeu { align-items: center; padding: 12px; }
  .plateau { flex-direction: column; gap: 20px; }
  #regles { width: min(92vw, 450px); }
  .largeur-jeu, .bouton-infos { width: min(92vw, 450px); }
}

/* ===== Pages d'infos (animaux, Espace 18+, mentions) ===== */
.page-infos { max-width: 900px; width: 100%; margin: 0 auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.page-infos h1 { text-align: center; font-size: 2rem; margin: 10px 0 0; }
.page-infos .intro { text-align: center; font-size: 1.1rem; margin: 0; }
.page-infos p, .page-infos li { line-height: 1.65; }
.page-infos h3 { margin-bottom: 4px; color: #cfe8ff; }
.page-infos section { scroll-margin-top: 20px; }
.retour { align-self: center; font-size: 1.2rem; padding: 14px 28px; border-radius: 16px; }

.grille-animaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.fiche { background: #ffffff; color: #1a2b4c; border-radius: 16px; padding: 16px; text-align: center; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.fiche .tete { width: 84px; height: 84px; margin: 0 auto; }
.fiche h2 { color: #0b4fa0; margin: 8px 0 6px; font-size: 1.2rem; }
.fiche p { margin: 0; font-size: .95rem; line-height: 1.5; }

.porte-18 { max-width: 520px; width: 100%; align-self: center; }
.boutons-porte { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Contact */
.formulaire { display: flex; flex-direction: column; gap: 12px; }
.formulaire label { font-weight: bold; display: block; margin-bottom: 4px; }
.formulaire .case-a-cocher { font-weight: normal; }
.formulaire textarea { min-height: 120px; resize: vertical; }
.captcha-ligne { display: flex; align-items: center; gap: 10px; }
.captcha-ligne input { max-width: 130px; }
#captcha-question { font-size: 1.2rem; }
.rafraichir {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  background: #ffffff; color: #0b4fa0; display: flex; align-items: center; justify-content: center;
}
.rafraichir:hover { background: #dff0ff; }
.rafraichir svg { width: 24px; height: 24px; }
.rafraichir.tourne svg { animation: tour .6s ease-in-out; }
@keyframes tour { to { transform: rotate(360deg); } }
.confirmation { text-align: center; font-size: 1.15rem; line-height: 1.6; }
.champ-cache { position: absolute; left: -9999px; }

/* Formulaire de contact désactivé ($cgv = 0) : tout est grisé */
.champs-contact { border: none; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.champs-contact:disabled .bouton { background: #b8c4d4; color: #5a6675; cursor: not-allowed; opacity: 1; }
.champs-contact:disabled input, .champs-contact:disabled textarea { background: #e9eef4; cursor: not-allowed; }
.champs-contact:disabled .rafraichir { opacity: .5; cursor: not-allowed; }
.champs-contact:disabled .case-a-cocher { opacity: .6; cursor: not-allowed; }

/* ----- Sablier du bonus de rapidité ----- */
.chrono {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; background: rgba(0,0,0,.25); border-radius: 12px; transition: opacity .3s;
}
.chrono.pause { opacity: .45; }
.sablier { width: 24px; height: 32px; flex-shrink: 0; }
.chrono:not(.pause) .sablier { animation: sablier 2s ease-in-out infinite; }
@keyframes sablier { 0%, 80% { transform: rotate(0); } 100% { transform: rotate(180deg); } }
.chrono-bonus { font-weight: bold; font-size: 1.1rem; }
.chrono-texte { font-size: .85rem; font-style: italic; animation: clignote 2s ease-in-out infinite; }
.chrono.pause .chrono-texte { animation: none; }
@keyframes clignote { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ----- Fenêtre du classement ----- */
.voir-plus { margin-top: 4px; }
.modale {
  border: none; border-radius: 16px; padding: 22px 26px; width: min(94vw, 640px); max-height: 85vh; overflow: auto;
  background: #0e3f86; color: #f2f8ff; box-shadow: 0 20px 50px rgba(0,0,0,.5);
}
.modale::backdrop { background: rgba(4,20,50,.6); }
.modale h2 { margin-top: 0; padding-right: 35px; }
.modale h3 { margin: 18px 0 8px; color: #bfe3ff; }
.tableau-scores { width: 100%; border-collapse: collapse; }
.tableau-scores th, .tableau-scores td { padding: 6px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.15); }
.tableau-scores th { color: #bfe3ff; font-size: .9rem; }
