/*
 * hud.css — HUD Watch Dogs: Legion « PIRATAGE DEDSEC », partagé par hud.html (avec caméra) et hud-sans-camera.html.
 * Chargé après ../shared/base.css et theme.css. Transparent : pas de trame, pas de key art par-dessus le jeu.
 *
 *  Barre d'état (56 px, haut)  : logo officiel (petit) · ≡ EN DIRECT + titre/jeu · « bug » ctOS barré / ≡ DEDSEC / date + heure
 *  Bandeau (60 px)             : étiquette Info · messages · réseaux · crédit Ubisoft      bar=bottom (bas) · top (sous la barre d'état) · none
 *  Cadre webcam (480×270)      : liseré profiler #95E3F8, onglet nom (décodé), ≡ rouge au coin extérieur, barre rouge décalée de 6 px
 *  Sans caméra                 : le pseudo passe dans la barre d'état, à gauche de l'horloge ; bar=none → petit bloc en haut à droite
 */
html, body { background: transparent; }
.stage { color: #fff; font-family: var(--wdl-ui);
  --T: 56px; --B: 60px;                         /* hauteurs réservées en haut / en bas (bar=bottom) */
  --gapT: 24px; --gapB: 30px; --tabH: 40px; --side: 40px; }
.bar-top .stage  { --T: 116px; --B: 0px; --gapB: 40px; }
.bar-none .stage { --T: 0px;   --B: 0px; --gapB: 40px; --gapT: 40px; }

/* ==========================================================================
 * Barre d'état
 * ========================================================================== */
.hs { position: absolute; left: 0; right: 0; top: 0; height: 56px; z-index: 5; display: flex; align-items: stretch;
  background: linear-gradient(180deg, rgba(0, 12, 36, .84), rgba(12, 36, 48, .72));
  border-bottom: 1px solid rgba(149, 227, 248, .18); }
.bar-none .hs { display: none; }
.hs-l { display: flex; align-items: center; gap: 26px; padding-left: var(--side); flex: none; }
.hs-mid { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 28px; overflow: hidden; }

/* logo officiel 243×65 (recadré serré) : hauteur 38 px ; repli texte seulement après échec / 1,5 s */
.hs-logo.wdl-logo { width: 142px; height: 38px; }
.hs-logo .wdl-logo-img { position: static; display: block; width: auto; height: 100%; max-width: none; left: auto; top: auto; }
.hs-logo .wdl-logo-txt { position: static; transform: none; display: none; font: 700 20px/1 var(--wdl-ui); letter-spacing: .2em; }
.hs-logo.is-fb:not(.has-img) { width: auto; display: flex; align-items: center; }
.hs-logo.is-fb:not(.has-img) .wdl-logo-txt { display: block; }

.hs-live { display: flex; align-items: center; gap: 12px; flex: none; font: 700 20px/1 var(--wdl-ui); letter-spacing: .24em; text-transform: uppercase; white-space: nowrap; }
.hs-live .wdl-tri { --tw: 24px; --th: 20px; --tb: 4px; }
.hs-title { min-width: 0; font: 600 22px/1.1 var(--wdl-ui); letter-spacing: .04em; color: var(--wdl-prof); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-title:empty { display: none; }
.hs-title::before { content: ''; display: inline-block; width: 2px; height: 20px; margin-right: 16px; vertical-align: -3px; background: rgba(226, 31, 38, .8); }

/* « bug » collé au bord droit, pleine hauteur */
.hs .wdl-bug { height: 56px; flex: none; }
.hs .wdl-bug > :last-child { padding-right: var(--side); }
.wdl-bug .b-name { gap: 0; background: var(--wdl-panel-flat); border-left: 3px solid var(--wdl-prof); }
.wdl-bug .b-name span { display: block; font: 700 26px/1 var(--wdl-ui); letter-spacing: .02em; text-transform: none; color: var(--wdl-prof); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wdl-bug .b-name span.is-decoding { text-overflow: clip; }

/* ==========================================================================
 * Bandeau (reprend .wdl-tk de « Ça commence », en plus fin)
 * ========================================================================== */
.stage .hud-tk { height: 60px; z-index: 5; }
.hud-tk .wdl-tk-tag { padding: 0 24px 0 var(--side); font-size: 22px; }
.hud-tk .wdl-tk-tag .wdl-tri { --tw: 24px; --th: 20px; }
.hud-tk .wdl-tk-msg { margin: 0 26px; }
.hud-tk .wdl-tk-msg > span { font-size: 26px; }
.hud-tk .wdl-soc { font-size: 23px; }
.hud-tk .wdl-soc svg { width: 24px; height: 24px; }
.hud-tk .wdl-tk-cr { padding: 0 var(--side) 0 22px; font-size: 16px; }
.bar-top .hud-tk { top: 56px; bottom: auto; border-top: 0; border-bottom: 1px solid rgba(226, 31, 38, .55); }
.bar-none .hud-tk { display: none; }

/* ==========================================================================
 * Cadre webcam — fenêtre transparente EXACTE de 480×270 (le liseré est dessiné à l'extérieur)
 * ========================================================================== */
.cam { position: absolute; z-index: 4; width: 480px; height: 270px;
  left: calc(1920px - var(--side) - 480px); top: calc(1080px - var(--B) - var(--gapB) - 270px); }
.cam-bl .cam, .cam-tl .cam { left: var(--side); }
.cam-tr .cam, .cam-tl .cam { top: calc(var(--T) + var(--gapT) + var(--tabH)); }
.cam-none .cam { display: none; }

.cam-fr { position: absolute; inset: -2px; border: 2px solid rgba(149, 227, 248, .62); pointer-events: none; }
/* coins de visée « profiler » (pleine intensité) par-dessus le liseré */
.cam-ret { position: absolute; inset: -2px; pointer-events: none; --c: var(--wdl-prof); --l: 26px; --w: 3px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 0 0 / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 100% 0 / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 0 100% / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) var(--w), linear-gradient(var(--c), var(--c)) 100% 100% / var(--w) var(--l);
  background-repeat: no-repeat; }
.cam-fr::before, .cam-fr::after { content: ''; position: absolute; inset: -2px; border: 2px solid var(--wdl-red); opacity: 0; }
.cam-fr::after { border-color: var(--wdl-cyan); }

/* rangée au-dessus du cadre : onglet nom (côté intérieur) … ≡ rouge (coin extérieur) */
.cam-row { position: absolute; left: -2px; right: -2px; bottom: calc(100% + 2px); height: var(--tabH); display: flex; align-items: flex-end; justify-content: space-between; }
.cam-bl .cam-row, .cam-tl .cam-row { flex-direction: row-reverse; }
.cam-tab { position: relative; display: flex; align-items: center; gap: 12px; height: 100%; max-width: 420px; padding: 0 18px 0 14px;
  background: var(--wdl-panel-flat); border-left: 4px solid var(--wdl-prof); }
.cam-bl .cam-tab, .cam-tl .cam-tab { border-left: 0; border-right: 4px solid var(--wdl-prof); padding: 0 14px 0 18px; }
.cam-tab .wdl-hex { width: 16px; height: 18px; color: var(--wdl-prof); opacity: .8; }
.cam-name { display: block; min-width: 0; font: 700 26px/1 var(--wdl-ui); letter-spacing: .02em; color: var(--wdl-prof); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-name.is-decoding { text-overflow: clip; }
.cam-eq { display: flex; align-items: center; height: 100%; padding: 0 2px 9px; }
.cam-eq .wdl-tri { --tw: 30px; --th: 24px; --tb: 5px; }
.cam-eq .wdl-tri i:nth-child(2) { width: 74%; }
.cam-bl .cam-eq .wdl-tri i:nth-child(2), .cam-tl .cam-eq .wdl-tri i:nth-child(2) { margin-left: auto; }

/* bord décalé façon glitch : barre rouge à 6 px du cadre, côté intérieur de l'écran */
.cam-off { position: absolute; bottom: -2px; left: -14px; width: 6px; height: 46%; background: var(--wdl-red); }
.cam-bl .cam-off, .cam-tl .cam-off { left: auto; right: -14px; }
.cam-tr .cam-off, .cam-tl .cam-off { bottom: auto; top: -2px; }

/* rafale sur le cadre : UNIQUEMENT sur un vrai évènement (alerte reçue) */
.cam.is-glitch .cam-ret { animation: cam-jit var(--wdl-burst) steps(1, end) .05s both; }
.cam.is-glitch .cam-fr { animation: cam-jit var(--wdl-burst) steps(1, end) both; }
.cam.is-glitch .cam-fr::before { animation: cam-split-r var(--wdl-burst) steps(1, end) both; }
.cam.is-glitch .cam-fr::after  { animation: cam-split-c var(--wdl-burst) steps(1, end) both; }
.cam.is-glitch .cam-tab { animation: cam-tab var(--wdl-burst) steps(1, end) both; }
.cam.is-glitch .cam-off { animation: cam-off var(--wdl-burst) steps(1, end) both; }
.cam.is-glitch .cam-eq .wdl-tri i:nth-child(2) { animation: wdl-tick2 .36s steps(1, end) 2 both; }
@keyframes cam-jit { 0% { transform: translateX(-10px); } 22% { transform: translateX(8px); } 44% { transform: translateX(-4px); } 66%, 100% { transform: none; } }
@keyframes cam-split-r { 0% { opacity: .9; transform: translate(-9px, 3px); } 30% { opacity: .6; transform: translate(12px, -2px); } 60% { opacity: .8; transform: translate(-4px, 0); } 80%, 100% { opacity: 0; transform: none; } }
@keyframes cam-split-c { 0% { opacity: 0; } 15% { opacity: .8; transform: translate(10px, -3px); } 45% { opacity: .5; transform: translate(-8px, 2px); } 75%, 100% { opacity: 0; transform: none; } }
@keyframes cam-tab { 0% { transform: translateX(14px); } 25% { transform: translateX(-10px); } 50% { transform: translateX(5px); } 75%, 100% { transform: none; } }
@keyframes cam-off { 0% { transform: translateY(-60px); } 30% { transform: translateY(-140px); } 60% { transform: translateY(-30px); } 100% { transform: none; } }

/* ==========================================================================
 * Sans caméra + bar=none : petit bloc en haut à droite (logo + pseudo + heure), rien d'autre
 * ========================================================================== */
.corner { position: absolute; top: 40px; right: 40px; z-index: 5; display: none; align-items: stretch; height: 52px; }
.cam-none.bar-none .corner { display: flex; }
.corner .c-logo { display: flex; align-items: center; padding: 0 18px; background: rgba(0, 12, 36, .8); }
.corner .hs-logo.wdl-logo { width: 116px; height: 31px; }
.corner .hs-logo.is-fb:not(.has-img) { width: auto; }
.corner .hs-logo .wdl-logo-txt { font-size: 18px; letter-spacing: .16em; }
.corner .wdl-bug > :last-child { padding-right: 18px; }

/* entrée : une fois, transform / opacité */
.hs, .hud-tk, .cam, .corner { transition: opacity .5s ease, transform .6s var(--wdl-snap); }
.stage:not(.is-in) .hs { opacity: 0; transform: translateY(-20px); }
.stage:not(.is-in) .hud-tk { opacity: 0; transform: translateY(20px); }
.stage:not(.is-in) .cam, .stage:not(.is-in) .corner { opacity: 0; }
html.ok-reduced .hs, html.ok-reduced .hud-tk, html.ok-reduced .cam, html.ok-reduced .corner { transition: none; }
