/* Overlay de télémétrie : superposition sur le direct, page pour OBS, aperçu de la gestion, page de liaison Pilot 2. */
@font-face { font-family: "Atkinson"; src: url("/assets/fonts/atkinson-next.woff2?v=1") format("woff2"); font-weight: 200 800; font-display: swap; }

.ov-host svg, .ov-prev svg { display: block; width: 100%; height: 100%; }
/* par-dessus le lecteur de la page Live */
.ov-embed { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
/* source navigateur d'OBS : fond transparent */
body.ov-page { margin: 0; background: transparent; overflow: hidden; }
body.ov-page .ov-host { position: fixed; inset: 0; }

/* aperçu de la gestion */
.ov-prev { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-m); overflow: hidden; touch-action: none; user-select: none; cursor: grab;
  background: linear-gradient(135deg, #3b2a4a 0%, #c0602a 52%, #f2d27a 100%); border: 1px solid var(--line); }
.ov-prev.drag { cursor: grabbing; }
.ov-prev svg [data-w] { cursor: grab; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; margin: 16px 0 4px; }
.ov-grid label.chk { margin: 2px 0; }
.ov-grid label.chk.is-sel span { font-weight: 700; text-decoration: underline; text-decoration-color: var(--hot, #ff6b1a); text-underline-offset: 4px; }
.ov-sel { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; margin: 12px 0; padding: 14px 16px; border-radius: var(--r-s); background: var(--mist); }
.ov-sel .f { margin: 0; min-width: 0; }
.ov-theme { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 22px; margin: 16px 0; }
.ov-theme .f { margin: 0; }
.rng { position: relative; padding-bottom: 12px; min-width: 190px; }
.rng input[type="range"] { width: 100%; margin: 0; display: block; }
.rng::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 7px; border-right: 1px solid #8a97a6;
  background: linear-gradient(90deg, #8a97a6 1px, transparent 1px) 0 0 / calc(100% / 10) 100% repeat-x; pointer-events: none; }
.rng:has(input[data-ticks="6"])::after { background-size: calc(100% / 6) 100%; }
.rng:has(input[data-ticks="12"])::after { background-size: calc(100% / 12) 100%; }
.f label:has(.rng-val) { display: flex; justify-content: space-between; gap: 10px; }
.rng-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-sel .rng { min-width: 220px; }
.ov-sel input[type="range"]:disabled { opacity: .4; }
.ov-theme input[type="color"] { width: 64px; height: 38px; padding: 2px; }
.ov-theme input[type="range"] { width: 100%; }
.ov-check { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 4px; }
.ov-check li::before { content: "✗ "; color: #c0392b; font-weight: 700; }
.ov-check li.ok::before { content: "✓ "; color: #1e8449; }
/* calibration du pointeur sur l'image du direct */
.ov-cal { margin: 12px 0; }
.ov-cal-stage { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-m); overflow: hidden; touch-action: none; user-select: none; }
.ov-cal-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ov-cal-rect { position: absolute; box-sizing: border-box; border: 2px solid #ff6b1a; background: rgba(255, 107, 26, .14); cursor: move; }
.ov-cal-rect i { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #ff6b1a; border: 2px solid #fff; box-sizing: border-box; }
.ov-cal-rect i[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; } .ov-cal-rect i[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.ov-cal-rect i[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; } .ov-cal-rect i[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.ov-xy { display: flex; gap: 8px; }
.ov-xy input { width: 5.2em; }
.ov-raw { max-height: 320px; overflow: auto; font-size: .82rem; background: #0d1a2a; color: #d7e3ef; padding: 12px; border-radius: var(--r-s); white-space: pre-wrap; word-break: break-all; }

/* page de liaison avec DJI Pilot 2 (écran de la télécommande) */
body.dji-page { margin: 0; min-height: 100vh; background: #0d1a2a; color: #eaf1f7; font: 18px/1.5 "Atkinson", system-ui, sans-serif; }
.dji-wrap { max-width: 640px; margin: 0 auto; padding: 28px 22px 48px; }
.dji-wrap h1 { font-size: 1.6rem; margin: 0 0 6px; }
.dji-wrap p { margin: 8px 0; color: #b9c9d8; }
.dji-steps { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.dji-steps li { display: grid; grid-template-columns: 1.4em 1fr; gap: 2px 12px; align-items: baseline; padding: 12px 14px; border-radius: 12px; background: #142840; }
.dji-steps li::before { content: "…"; flex: none; width: 1.4em; text-align: center; color: #8aa2b8; font-weight: 700; }
.dji-steps li.ok::before { content: "✓"; color: #4cd68a; }
.dji-steps li.bad::before { content: "✗"; color: #ff6b6b; }
.dji-steps small { display: block; grid-column: 2; color: #8aa2b8; font-size: .85rem; }
.dji-wrap form { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.dji-wrap input { flex: 1 1 200px; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid #35506b; background: #0a1522; color: #fff; }
.dji-wrap button { font: inherit; font-weight: 700; padding: 12px 20px; border-radius: 10px; border: 0; background: #ff6b1a; color: #0d1a2a; cursor: pointer; }
.dji-wrap button.ghost { background: #23405d; color: #eaf1f7; }
.dji-err { color: #ff9b9b; }
.dji-wrap[hidden], .dji-wrap [hidden] { display: none !important; }

/* grille magnétique : visible pendant le déplacement d'un élément (32 × 18) */
.ov-prev::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s;
  background-image: linear-gradient(to right, rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(to bottom, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: calc(100% / 32) calc(100% / 18); }
.ov-prev.snap.drag::after { opacity: 1; }

/* repères de l'étalonnage du pointeur */
.ov-mark { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; border: 3px solid #fff; background: rgba(255, 107, 26, .85); box-sizing: border-box; pointer-events: none; color: #fff; font: 700 12px/16px sans-serif; text-align: center; font-style: normal; }
.ov-mark.m1, .ov-mark.m2 { background: #1e8449; }
#ovMapStage { cursor: crosshair; margin: 10px 0; }
