body {
  background: #0e0e0e;
  color: #fff;
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  margin: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 140px);
  grid-gap: 12px;
}

.cell {
  width: 140px;
  height: 210px;
  border: 2px solid #2a2a2a;
  cursor: pointer;
  overflow: hidden;
  transition: transform .2s, border-color .2s, background .2s;
  border-radius: 10px;
  background: #111;
  position: relative;
}

.cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .85;
  transition: opacity .2s;
}

.cell:hover img {
  opacity: 1;
}

.cell.selected {
  border-color: #44ffb2;
  transform: scale(1.05);
}

button {
  margin-top: 20px;
  padding: 12px 28px;
  background: #44ffb2;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background .2s, transform .2s;
}

button:hover {
  background: #32d293;
  transform: translateY(-2px);
}

/* 🔥 Animation erreur */
.error {
  animation: shake .4s ease, flash .4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

@keyframes flash {
  0% { background: rgba(255,0,0,.3); }
  100% { background: transparent; }
}

.success {
  animation: whiteFlash 0.3s ease-out, glowCinematic 1.2s ease-out forwards;
}

@keyframes whiteFlash {
  0% { filter: brightness(1); }
  50% { filter: brightness(5); }
  100% { filter: brightness(1); }
}

@keyframes glowCinematic {
  0% { filter: brightness(1) contrast(1) saturate(1); }
  100% { filter: brightness(1.6) contrast(1.4) saturate(1.3); }
}

#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: white;
  opacity: 0;
}
.flash-success {
  animation: flashScreen 2.8s ease-out;
}

@keyframes flashScreen {
  0% { opacity: 0; }
  30% { opacity: 1; }
  100% { opacity: 0; }
}
