/* Salle de contrôle des caméras de surveillance (src/surveillance.js) */
#surveillance { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #070b09; color: #b9f3c8; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
#surveillance[hidden] { display: none; }
.sv-haut { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid #1d3a28; }
.sv-haut h2 { margin: 0; font: 600 0.95rem ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.14em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.sv-haut .sv-heure { margin-left: auto; font-size: 0.8rem; opacity: 0.8; }
.sv-quitter { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #2c5a3f; background: transparent; color: inherit; font-size: 1rem; cursor: pointer; }
.sv-quitter:hover, .sv-quitter:focus-visible { border-color: #b9f3c8; }
.sv-rec { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #ff3b2a; animation: sv-clignote 1.2s steps(2, jump-none) infinite; }
@keyframes sv-clignote { 0% { opacity: 1; } 100% { opacity: 0.15; } }
.sv-corps { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 14px 16px 16px; }
.sv-scene { flex: 1 1 62%; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.sv-grand, .sv-vignette { position: relative; overflow: hidden; background: #000; border: 1px solid #1d3a28; border-radius: 6px; }
.sv-grand { width: 100%; max-height: calc(100% - 90px); aspect-ratio: 16 / 10; align-self: center; }
.sv-grand canvas:not(.sv-visages), .sv-vignette canvas:not(.sv-visages) { display: block; width: 100%; height: 100%; object-fit: cover; touch-action: none; filter: grayscale(0.88) contrast(1.18) brightness(1.12) sepia(0.25) hue-rotate(75deg); }
#surveillance.en-couleur .sv-grand canvas:not(.sv-visages), #surveillance.en-couleur .sv-vignette canvas:not(.sv-visages) { filter: contrast(1.05) saturate(1.1); }
/* lignes de balayage, vignettage et bruit léger par-dessus l'image */
.sv-voile { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, 0.22) 3px),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.55) 100%); }
.sv-nom { position: absolute; left: 8px; top: 6px; font-size: 0.72rem; letter-spacing: 0.08em; color: #d9ffe2; text-shadow: 0 0 4px #000, 0 0 2px #000; pointer-events: none; }
.sv-grand .sv-nom { font-size: 0.85rem; }
.sv-heure-grand { position: absolute; right: 10px; bottom: 8px; font-size: 0.78rem; color: #d9ffe2; text-shadow: 0 0 4px #000; pointer-events: none; }
.sv-grand::after { content: "● REC"; position: absolute; right: 10px; top: 7px; font-size: 0.78rem; color: #ff5a4a; text-shadow: 0 0 4px #000; animation: sv-clignote 1.2s steps(2, jump-none) infinite; pointer-events: none; }
.sv-commandes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sv-commandes button { min-width: 42px; height: 38px; padding: 0 12px; border-radius: 6px; border: 1px solid #2c5a3f; background: #0d1a13; color: inherit; font: inherit; font-size: 0.85rem; cursor: pointer; }
.sv-commandes button:hover, .sv-commandes button:focus-visible { border-color: #b9f3c8; }
.sv-commandes .sv-auto[aria-pressed="true"] { background: #1c4a30; border-color: #b9f3c8; }
.sv-commandes .sv-couleur[aria-pressed="true"] { background: #1c4a30; border-color: #b9f3c8; }
.sv-commandes .sv-aller { background: #c49a4a; border-color: #c49a4a; color: #1a1208; font-weight: 600; }
.sv-aide { margin: 0; text-align: center; font-size: 0.72rem; opacity: 0.6; }
.sv-cote { flex: 1 1 38%; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.sv-pages { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 0.8rem; }
.sv-pages[hidden], .sv-vignette[hidden] { display: none; }
.sv-pages button { width: 38px; height: 34px; border-radius: 6px; border: 1px solid #2c5a3f; background: #0d1a13; color: inherit; font-size: 1.1rem; cursor: pointer; }
.sv-grille { min-width: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-content: start; }
.sv-vignette { aspect-ratio: 16 / 10; padding: 0; cursor: pointer; }
.sv-vignette.actif { border-color: #b9f3c8; box-shadow: 0 0 0 1px #b9f3c8; }
.sv-vignette:hover { border-color: #b9f3c8; }
@media (orientation: portrait) {
  .sv-corps { flex-direction: column; overflow-y: auto; }
  .sv-scene, .sv-cote { flex: none; }
  .sv-grand { max-height: none; }
  .sv-grille { flex: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .sv-rec, .sv-grand::after { animation: none; } }

.sv-visages { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sv-commandes .sv-reco[aria-pressed="true"] { background: #1c4a30; border-color: #7dffa0; }
.sv-vignette .sv-nom { right: 6px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.62rem; letter-spacing: 0.04em; }
/* téléphone en paysage : 6 vignettes en 3 rangées, sans défilement */
@media (orientation: landscape) and (max-height: 500px) {
  .sv-haut { padding: 6px 16px; }
  .sv-corps { padding: 8px 12px; gap: 10px; }
  .sv-cote { gap: 6px; }
  .sv-grille { gap: 6px; }
  .sv-pages button { height: 30px; }
  /* les rangées se partagent la hauteur disponible : la dernière n'est jamais coupée (l'image se recadre) */
  .sv-grille { flex: 1; min-height: 0; overflow: hidden; grid-template-rows: repeat(3, minmax(0, 1fr)); }
  .sv-vignette { aspect-ratio: auto; min-height: 0; height: 100%; }
}

.sv-haut .sv-nb { margin-left: auto; font-size: 0.8rem; }
.sv-haut .sv-nb + .sv-heure { margin-left: 0; }
