* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #87CEEB 0%, #90EE90 70%, #228B22 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #222;
  overflow: hidden;
}

.ecran { display: none; flex-direction: column; align-items: center; width: 100%; max-width: 860px; padding: 20px; min-height: 100vh; }
.ecran.actif { display: flex; }

/* ACCUEIL */
.logo { font-size: 90px; animation: sauter 0.8s ease-in-out infinite alternate; }
@keyframes sauter { from { transform: translateY(0); } to { transform: translateY(-18px); } }

h1 { font-size: 2.8rem; font-weight: 900; color: #fff; text-shadow: 3px 3px 0 #228B22; margin: 8px 0; }
.sous-titre { font-size: 1rem; color: #fff; text-shadow: 1px 1px 2px #006400; margin-bottom: 28px; text-align: center; }

.btns-accueil { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; margin-bottom: 20px; }

.btn-vert   { background: #27ae60; }
.btn-bleu   { background: #2980b9; }
.btn-orange { background: #e67e22; }
.btn-violet { background: #8e44ad; }
.btn-rouge  { background: #c0392b; }
.btn-retour { background: rgba(0,0,0,0.35); }

.btn-vert,.btn-bleu,.btn-orange,.btn-violet,.btn-rouge,.btn-retour {
  color: white; border: none; padding: 15px 22px; font-size: 1.1rem;
  border-radius: 14px; cursor: pointer; font-weight: bold;
  transition: transform 0.1s; box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.btn-vert:hover,.btn-bleu:hover,.btn-orange:hover,.btn-violet:hover,.btn-rouge:hover,.btn-retour:hover { transform: scale(1.05); }

.meilleur-temps { background: rgba(255,255,255,0.85); border-radius: 12px; padding: 8px 20px; font-weight: bold; min-height: 34px; }

.credit { margin-top: auto; padding-top: 16px; text-align: center; color: rgba(255,255,255,0.9); font-size: 0.85rem; line-height: 1.6; text-shadow: 1px 1px 2px rgba(0,0,0,0.4); }
.credit strong { color: #ffe066; }
.credit-petit { font-size: 0.72rem; opacity: 0.8; }

/* HAUT DE JEU */
.haut-jeu { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 10px; }
.titre-mode { font-size: 1.1rem; font-weight: bold; color: white; text-shadow: 1px 1px 3px rgba(0,0,0,0.5); }
.chrono { font-size: 1.4rem; font-weight: bold; background: rgba(0,0,0,0.45); color: #ffe066; padding: 5px 14px; border-radius: 10px; }

/* ═══════════════════════════════════════
   PISTE DE COURSE ANIMÉE
═══════════════════════════════════════ */
.piste-animee {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  margin-bottom: 14px;
  border: 3px solid rgba(255,255,255,0.4);
}

/* MODE CÔTE À CÔTE */
.piste-cote-a-cote {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  margin-bottom: 14px;
  border: 3px solid rgba(255,255,255,0.4);
}
.couloir-double {
  position: relative;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 50%, #90EE90 50%, #5cb85c 100%);
}
.separateur {
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, white 0, white 14px, transparent 14px, transparent 28px);
  z-index: 6;
}
.lapin-coureur.haut { bottom: auto !important; top: 22px !important; }
.lapin-coureur.bas  { bottom: 22px !important; }
.couloir-label.haut { top: 4px; bottom: auto; transform: none; }
.couloir-label.bas  { top: auto; bottom: 4px; transform: none; }

/* Couloir */
.couloir {
  position: relative;
  height: 110px;
  overflow: hidden;
}

.couloir-label {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  font-size: 0.8rem;
  font-weight: bold;
  background: rgba(0,0,0,0.45);
  color: white;
  padding: 3px 8px;
  border-radius: 8px;
}

/* Ciel */
.couloir-1 { background: linear-gradient(180deg, #87CEEB 0%, #b8e4f0 100%); }
/* Herbe */
.couloir-2 { background: linear-gradient(180deg, #90EE90 0%, #5cb85c 100%); border-top: 3px dashed rgba(255,255,255,0.5); }

/* Décor qui défile */
.decor {
  position: absolute;
  top: 0; left: 0;
  width: 200%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  animation: defiler linear infinite;
  animation-duration: 4s; /* sera modifié par JS */
  animation-play-state: paused;
}

@keyframes defiler {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.arbre { font-size: 2.2rem; position: absolute; bottom: 4px; }
.nuage { font-size: 1.6rem; position: absolute; top: 6px; }
.fleur { font-size: 1.2rem; position: absolute; bottom: 2px; }

/* Sol */
.sol {
  height: 18px;
  background: repeating-linear-gradient(90deg, #8B4513 0px, #8B4513 40px, #A0522D 40px, #A0522D 80px);
  animation: defiler linear infinite;
  animation-duration: 1s;
  animation-play-state: paused;
}

/* Lapin coureur */
.lapin-coureur {
  position: absolute;
  left: 80px;
  bottom: 18px;
  font-size: 3rem;
  z-index: 5;
  animation: courir 0.3s steps(2) infinite;
  animation-play-state: paused;
  filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.3));
}

@keyframes courir {
  0%   { transform: translateY(0) scaleX(1); }
  50%  { transform: translateY(-5px) scaleX(1.05); }
  100% { transform: translateY(0) scaleX(1); }
}

/* Ligne d'arrivée */
.ligne-arrivee-flag {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  z-index: 5;
}

/* Barre de progression */
.barre-mini {
  height: 10px;
  background: rgba(0,0,0,0.15);
}
.barre-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffe066, #ff9900);
  transition: width 0.4s ease;
}
.barre-mini-fill.j2 {
  background: linear-gradient(90deg, #ff6b6b, #e74c3c);
}

/* QUESTION */
.zone-question {
  background: rgba(255,255,255,0.93);
  border-radius: 20px;
  padding: 18px 20px;
  width: 100%;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.question { font-size: 2.2rem; font-weight: 900; color: #2c3e50; margin-bottom: 8px; }

.feedback { font-size: 1.2rem; font-weight: bold; height: 28px; margin-bottom: 8px; }
.feedback.bon { color: #27ae60; }
.feedback.mauvais { color: #e74c3c; }

.choix { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn-choix {
  background: #3498db; color: white; border: none;
  padding: 13px 26px; font-size: 1.4rem; font-weight: bold;
  border-radius: 12px; cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 3px 6px rgba(0,0,0,0.2);
  min-width: 75px;
}
.btn-choix:hover { transform: scale(1.1); background: #2980b9; }
.btn-choix.bon-choix { background: #27ae60; }
.btn-choix.mauvais-choix { background: #e74c3c; }

/* RÉSULTAT */
.resultat-contenu { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.resultat-emoji { font-size: 80px; }
.resultat-contenu h2 { font-size: 2rem; color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.4); }
.resultat-contenu p { font-size: 1.1rem; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); }
.resultat-stats { background: rgba(255,255,255,0.88); border-radius: 14px; padding: 12px 24px; font-size: 1rem; color: #333; line-height: 1.9; }
.btns-resultat { display: flex; gap: 14px; }
