#reader-container {
  position: relative;
  width: 95%;
  max-width: 500px;
  margin: 15px auto;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  border: 2px solid #a3d9c9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#reader {
  width: 100% !important;
  height: auto !important;
  border: none !important;
  background: transparent !important;
}

/* --- ON MASQUE TOUT CE QUE LA BIBLIOTHÈQUE AJOUTE SAUF LA VIDÉO --- */
#reader > *:not(video) {
  display: none !important;
}

#reader video {
  object-fit: cover;
  width: 100% !important;
  height: auto !important;
  display: block !important;
}

/* --- Votre Viseur moderne (Coins de visée et laser par-dessus) --- */
.scanner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Laisse passer les clics (zoom, etc.) */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10; /* S'assure de passer au-dessus de la vidéo */
}

.scan-window {
  position: relative;
  width: 300px;
  height: 300px;
}

.scan-window span {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: #2b7a5e; /* Votre vert */
  border-style: solid;
  border-width: 0;
}

/* Coin Haut-Gauche */
.scan-window span:nth-child(1) {
  top: 0;
  left: 0;
  border-top-width: 4px;
  border-left-width: 4px;
  border-top-left-radius: 8px;
}

/* Coin Haut-Droit */
.scan-window span:nth-child(2) {
  top: 0;
  right: 0;
  border-top-width: 4px;
  border-right-width: 4px;
  border-top-right-radius: 8px;
}

/* Coin Bas-Gauche */
.scan-window span:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom-width: 4px;
  border-left-width: 4px;
  border-bottom-left-radius: 8px;
}

/* Coin Bas-Droit */
.scan-window span:nth-child(4) {
  bottom: 0;
  right: 0;
  border-bottom-width: 4px;
  border-right-width: 4px;
  border-bottom-right-radius: 8px;
}

/* --- La ligne horizontale animée (laser) --- */
.scanner-laser {
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: scanAnimation 2s infinite ease-in-out;
}

@keyframes scanAnimation {
  0% {
    transform: translateY(10px);
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(300px);
    opacity: 0.2;
  }
}