* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* Empêche le défilement tactile */
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
  background-color: #000;
  color: #fff;
}

/* Overlay d'activation audio */
#start-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#start-btn {
  padding: 18px 32px;
  font-size: 18px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
}

/* Zone tactile globale */
#touch-zone {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Grille de carrés */
#grid {
  display: grid;
  width: 100vw;
  height: 100vh;
  gap: 2px;
  background-color: #000;
}

/* Style de chaque carré */
.square {
  background-color: #111;
  border: 1px solid #222;
  transition: transform 0.15s ease, background-color 0.8s ease;
  transform-style: preserve-3d;
}

/* État quand le carré se retourne en blanc */
.square.active {
  background-color: #ffffff;
  transform: rotateY(180deg) scale(1.05);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  transition: transform 0.1s ease, background-color 0s;
}

/* Curseur visuel */
#pointer {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  box-shadow: 0 0 15px #ffffff;
  z-index: 5;
}