/*
 * Bestioles en Cavale — identité visuelle de l'accueil.
 *
 * Ne contient QUE ce que le CSS partagé (css/accueil.css, servi par
 * proxies/css-accueil.php) ne fournit pas : le hero du jeu, sa déco de
 * bestioles en fuite, la grille des mécanismes et le bloc FAQ. Tout le reste
 * (.hero-flex, .hero-visual, .modes, .mode-card, .rules, .blog-section, les
 * badges...) vient du partagé - ne rien redéfinir ici (surtout pas .hero-flex).
 *
 * Perf : pas de backdrop-filter permanent, pas de box-shadow animé en boucle,
 * pas de position: fixed décoratif. Animations en transform/opacity seulement.
 */

/* ================= HERO ================= */

.hero-bestioles {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 32px 28px;
  margin-bottom: 30px;
  /* Sous-bois la nuit : vert profond, lueur ambrée au ras du sol. */
  background:
    radial-gradient(120% 90% at 50% 100%, rgba(251, 191, 36, 0.18) 0%, rgba(251, 191, 36, 0) 60%),
    linear-gradient(160deg, #14532d 0%, #052e16 55%, #0f172a 100%);
  border: 1px solid rgba(74, 222, 128, 0.4);
}

/* Ourlet ambré en bas : la sortie du labyrinthe, éclairée. */
.hero-bestioles::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0) 0%, rgba(251, 191, 36, 0.75) 50%, rgba(251, 191, 36, 0) 100%);
  pointer-events: none;
}

.hero-bestioles > * { position: relative; z-index: 1; }

/* ================= BESTIOLES EN FUITE ================= */

.hero-fuite {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-bestiole {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 44% 44%;
  opacity: 0;
  will-change: transform, opacity;
}

.hero-bestiole::before,
.hero-bestiole::after {
  content: '';
  position: absolute;
  top: 28%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
}
.hero-bestiole::before { left: 22%; }
.hero-bestiole::after  { right: 22%; }

.hero-bestiole-1 { top: 14%; left: 5%;   background: #f87171; animation: bec-fuite 10s ease-in-out infinite; }
.hero-bestiole-2 { top: 62%; left: 15%;  background: #60a5fa; animation: bec-fuite 10s ease-in-out infinite 2.4s; }
.hero-bestiole-3 { top: 22%; right: 8%;  background: #4ade80; animation: bec-fuite 10s ease-in-out infinite 5s; }
.hero-bestiole-4 { top: 70%; right: 15%; background: #fbbf24; animation: bec-fuite 10s ease-in-out infinite 7.2s; }

@keyframes bec-fuite {
  0%   { opacity: 0;   transform: translate(-20px, 8px) scale(0.85); }
  16%  { opacity: 0.5; }
  40%  { transform: translate(6px, -6px) scale(1.05); }
  60%  { opacity: 0.5; transform: translate(20px, 4px) scale(1); }
  85%  { opacity: 0.32; }
  100% { opacity: 0;   transform: translate(42px, -10px) scale(0.88); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-bestiole { animation: none; opacity: 0.3; }
}

@media (max-width: 640px) {
  /* Quatre bestioles sur un hero étroit, ça sature : on n'en garde qu'une. */
  .hero-bestiole-2, .hero-bestiole-3, .hero-bestiole-4 { display: none; }
  .hero-bestioles { padding: 24px 18px; }
}

/* ================= CARTES DE MODES ================= */

/*
 * Les cartes de mode sont des <a> : sans ça, le navigateur les souligne en
 * bleu. (Le partagé style .mode-card mais suppose un conteneur non-lien.)
 */
a.mode-card { text-decoration: none; color: inherit; display: block; }
a.mode-card:hover { text-decoration: none; }

.modes-header {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent);
  margin: 26px 0 14px;
}

/* ================= LES MÉCANISMES DU LABYRINTHE ================= */

/*
 * « Qu'est-ce qu'il y a dans ces niveaux ? » est la première question de
 * quelqu'un qui découvre le jeu : chaque mécanisme est montré, pas décrit.
 */
.meca-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 18px 0 8px;
}

.meca-carte {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

/* Vignette de la case, dessinée en CSS : pas d'image à charger pour six
   pictogrammes de 34 pixels. */
.meca-vignette {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  position: relative;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.meca-herbe   { background: repeating-linear-gradient(135deg, #166534 0 4px, #15803d 4px 8px); }
.meca-fleche::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 11px solid var(--color-accent);
}
.meca-tp {
  background: radial-gradient(circle at 50% 50%, #a78bfa 0 24%, #4c1d95 26% 52%, #1e293b 54%);
}
.meca-trou  { background: radial-gradient(circle at 50% 45%, #020617 0 55%, #1e293b 70%); }
.meca-fragile {
  background: #334155;
  background-image: linear-gradient(115deg, transparent 46%, rgba(15, 23, 42, 0.9) 46% 54%, transparent 54%),
                    linear-gradient(58deg, transparent 47%, rgba(15, 23, 42, 0.9) 47% 53%, transparent 53%);
}
.meca-pont {
  background: repeating-linear-gradient(90deg, #92400e 0 5px, #b45309 5px 10px);
}

.meca-nom {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 4px;
}
.meca-detail { display: block; font-size: 0.8rem; color: #94a3b8; line-height: 1.55; }

/* ================= FAQ ================= */

.faq-section { margin: 34px 0 10px; }

.faq-item {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  background: none;
  border: 0;
  color: #f1f5f9;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  /* Cible tactile confortable. */
  min-height: 54px;
}

.faq-question:hover { background: color-mix(in srgb, var(--color-mid) 12%, transparent); }
.faq-question:focus-visible { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* Chevron piloté par aria-expanded : l'état est dans l'ARIA, pas dans une
   classe à part - le script partagé ne gère que l'attribut. */
.faq-question::after {
  content: '';
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--color-light);
  border-bottom: 2px solid var(--color-light);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s ease;
}

.faq-question[aria-expanded="true"]::after { transform: rotate(-135deg) translate(-2px, -2px); }

.faq-answer { padding: 0 18px 16px; color: #94a3b8; line-height: 1.7; }
.faq-answer[hidden] { display: none; }
.faq-answer p { margin: 0 0 10px; }
.faq-answer p:last-child { margin-bottom: 0; }
