body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #111;
  color: #eee;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

h1 {
  font-size: 1.3rem;
  margin: 0 0 .25rem;
}

.lot,
.version {
  color: #999;
  font-size: .85rem;
  margin: 0 0 1rem;
}

/* Sa propre image en miroir (D4 §10.1) ; l'image envoyée à l'adversaire ne le sera pas. */
video {
  display: block;
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  background: #000;
  transform: scaleX(-1);
  border-radius: .5rem;
}

button {
  margin: 1rem 0;
  padding: .8rem 1.2rem;
  font-size: 1rem;
  width: 100%;
}

#etat {
  padding-left: 1.2rem;
  line-height: 1.6;
}

.ok { color: #7c7; }
.erreur { color: #f77; }

#bloques {
  color: #fb7;
  font-size: .85rem;
  word-break: break-all;
}

#mesures {
  background: #1b1b1b;
  padding: .75rem;
  border-radius: .5rem;
  font-size: .8rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Ovale de placement (D5 E5), centré sur la vidéo. */
.cadre {
  position: relative;
}

.ovale {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 70%;
  aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 3px dashed rgba(255, 255, 255, .6);
  border-radius: 50%;
  pointer-events: none;
}

#calibrage {
  margin: 1rem 0;
}

#calibrage h2 {
  font-size: 1.1rem;
  margin: 0 0 .5rem;
}

#cal-barre {
  width: 100%;
}

#cal-detail {
  font-size: .75rem;
  color: #aaa;
  white-space: pre-wrap;
}

#manche h2 {
  font-size: 1.1rem;
  margin: 0 0 .5rem;
}

/* Jauge J (D2 R3) : niveau en direct et repère du pic de la manche (n° 190). */
.jauge {
  position: relative;
  height: 1.2rem;
  background: #2a2a2a;
  border-radius: .3rem;
  overflow: hidden;
}

#jauge-niveau {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7c7, #fb7 70%, #f77);
}

#jauge-pic {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: #fff;
}

#manche-etat {
  font-size: .8rem;
  white-space: pre-wrap;
}

/* Image de preuve (R7), en miroir comme sa propre vidéo ; en mémoire vive seulement. */
#preuve {
  display: block;
  max-width: 100%;
  max-height: 40vh;
  transform: scaleX(-1);
  border-radius: .5rem;
}

#protocole h2 {
  font-size: 1.1rem;
  margin: 0 0 .5rem;
}

#protocole label {
  display: block;
  margin: .4rem 0;
}

#protocole button {
  margin: .4rem 0;
}

/* Consigne de la séquence, lisible par le testeur à distance. */
#proto-consigne {
  font-size: 1.4rem;
  font-weight: bold;
  color: #fb7;
}

#proto-revue-image {
  display: block;
  max-width: 100%;
  max-height: 40vh;
  transform: scaleX(-1);
}

#proto-resumes {
  font-size: .8rem;
  white-space: pre-wrap;
}

/* PERF : vignette de la vidéo reçue (appel simulé). [hidden] doit l'emporter sur video { display: block }. */
#perf-retour {
  width: 30%;
}
#perf-retour[hidden] {
  display: none;
}
