#jeu-association {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.colonne {
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 2;
}

#traitCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.colonne img {
  width: 140px;
  max-width: 25vw;
  height: auto;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: transform 0.2s ease, border-color 0.2s;
}

.colonne img:hover,
.colonne img.selected {
  transform: scale(1.05);
  border-color: #007cba;
}

.colonne img.erreur {
  animation: shake 0.3s;
  border-color: red !important;
}

#end-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fffaf3;
  border: 3px solid #ffd700;
  padding: 30px 40px;
  font-size: 1.3rem;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  border-radius: 15px;
  animation: popin 0.5s ease-out;
}

@keyframes popin {
  from { transform: scale(0.5) translate(-50%, -50%); opacity: 0; }
  to { transform: scale(1) translate(-50%, -50%); opacity: 1; }
}

.bravo-box {
  font-family: "Comic Sans MS", cursive, sans-serif;
  color: #ff6a00;
}


@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

#score-display {
  display: none; /* initialement masqué */
  text-align: center;
  font-size: 1.8rem;
  font-weight: bold;
  background: white;
  padding: 10px 15px;
  margin: 20px auto;
  width: fit-content;
  max-width: 90%;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
}



@media (max-width: 768px) {
  #jeu-association {
    flex-direction: column;
    align-items: center;
  }

  .colonne {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .colonne img {
    max-width: 30vw;
    margin: 10px;
  }
}

#jeu-association {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  gap: 10px;
  padding: 20px 0;
  width: 100%;
}

.colonne {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 45%;
  gap: 20px;
}

.colonne img {
  max-width: 100%;
  height: auto;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

.colonne img.selected {
  border-color: #007bff;
}

.colonne img.erreur {
  animation: shake 0.3s;
  border-color: red !important;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

#traitCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Responsive : conserver 2 colonnes en petit écran */
@media (max-width: 768px) {
  #jeu-association {
    flex-direction: row; /* reste en ligne même sur mobile */
    flex-wrap: nowrap;
  }

  .colonne {
    flex: 1 1 50%;
  }

  .colonne img {
    max-width: 90%;
  }
}
