/*
 * hud.css — HUD en jeu FC 27 (overlay de fan), partagé par hud.html (avec caméra) et hud-sans-camera.html.
 * Langage « réalisation télé » : score bug en haut à DROITE par défaut (le tableau de score + chrono de FC est en haut
 * à gauche : bugPos=tr|tl|tc), logo de diffusion sous le bug (ou en haut à droite si bugPos=tl|tc), bandeau fin en bas
 * coupé en deux au centre (barGap) pour laisser le radar de FC dégagé.
 * Le jeu reste dégagé : pas de panneau vert, pas de grand titre, aucun nom ni note de joueur.
 * Cadre webcam (cam=br|bl|tr|tl) : angles coupés à la pente FC 27, dessiné en SVG autour d'un trou transparent de 480×270.
 * Sans caméra (cam=none) : le joueur (photo officielle, buste) répond au score bug en bas à droite.
 */
html, body { background: transparent; }
.stage { --m: 32px; --barH: 48px; --gap: 24px;
  --T: var(--m);                                    /* haut utile (sous le bandeau si bar=top) */
  --B: calc(var(--barH) + var(--gap));              /* bas utile (au-dessus du bandeau) */
  color: var(--w); font-family: var(--cond); }
.bar-top .stage { --T: calc(var(--barH) + 20px); --B: var(--m); }
.bar-none .stage { --B: var(--m); }

/* ---------------- Score bug : haut droite (défaut, bugPos=tr), haut gauche (tl) ou haut centre (tc) ---------------- */
.h-bug { position: absolute; z-index: 5; left: var(--m); top: calc(var(--T) - 4px); }
.cam-tl .h-bug { left: calc(var(--m) + 8px + 480px + 8px + var(--gap)); }
.bug-tr .h-bug { left: auto; right: var(--m); }
.bug-tr.cam-tr .h-bug { right: calc(var(--m) + 8px + 480px + 8px + var(--gap)); }
.bug-tr.cam-tl .h-bug { left: auto; }
.bug-tc .h-bug { left: 0; right: 0; margin: 0 auto; width: max-content; }
.h-bug .fc-bug-state span { display: inline-block; max-width: 620px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-bug { transition: transform .8s var(--ease), opacity .5s ease; }
.stage:not(.is-in) .h-bug { transform: translateX(-560px); opacity: 0; }
.bug-tr .stage:not(.is-in) .h-bug { transform: translateX(560px); }
.bug-tc .stage:not(.is-in) .h-bug { transform: translateY(-110px); }

/* ---------------- Logo de diffusion (haut droite) ---------------- */
.h-logo { position: absolute; z-index: 5; right: var(--m); top: calc(var(--T) - 4px); display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  padding: 12px 20px 11px 34px; background: var(--plate); clip-path: polygon(16px 0, 100% 0, 100% 100%, 0 100%); border-bottom: 3px solid var(--g); }
.cam-tr .h-logo { right: calc(var(--m) + 8px + 480px + 8px + var(--gap)); }
/* bugPos=tr : la plaque du logo se range SOUS le bug, alignée à droite */
.bug-tr .h-logo { top: calc(var(--T) - 4px + 64px + 12px); }
.h-logo .fc-logo { height: 40px; width: 124px; }
.h-logo .fc-logo img { left: auto; right: 0; }
.h-logo .fc-logo-fb { left: auto; right: 0; top: 0; text-align: right; }
.h-logo .fc-logo-fb small { display: none; }   /* repli typo compact : « FC 27 » seul (pas de micro-texte illisible) */
.h-logo .fc-logo-fb b { font-size: 28px; line-height: 1; }
.h-logo { transition: transform .8s var(--ease) .12s, opacity .5s ease .12s; }
.stage:not(.is-in) .h-logo { transform: translateX(60px); opacity: 0; }

/* ---------------- Bandeau bas (fin) ---------------- */
.h-strip { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; height: var(--barH); display: flex; align-items: center; gap: 30px;
  padding: 0 var(--m); background: rgba(9,12,15,.92); border-top: 2px solid rgba(7,244,104,.55); }
.bar-top .h-strip { bottom: auto; top: 0; border-top: 0; border-bottom: 2px solid rgba(7,244,104,.55); }
.bar-none .h-strip { display: none; }
/* barGap (défaut 520 px) : deux demi-bandeaux, le centre bas (radar de FC) reste dégagé */
.bar-gap .h-strip { background: none; border-top: 0; justify-content: space-between; }
.bar-gap .h-strip::before, .bar-gap .h-strip::after { content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; width: var(--segW, 700px);
  background: linear-gradient(180deg, rgba(7,244,104,.55) 0 2px, rgba(9,12,15,.92) 2px); }
.bar-gap .h-strip::before { left: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 22px) 100%, 0 100%); }
.bar-gap .h-strip::after { right: 0; clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%); }
.bar-gap.no-soc .h-strip::before { display: none; }
.bar-gap .h-strip .fc-socials { flex: none; order: 1; }
.bar-gap .h-strip .h-msg { flex: none; margin-left: auto; order: 2; }
.bar-gap .h-strip .fc-legal { order: 3; }
.h-msg.is-legal em { display: none; }
/* bar=none : mention courte dans un coin (bas gauche, bas droite si cam=bl) */
.fc-legal.h-corner { position: absolute; z-index: 4; left: var(--m); bottom: 8px; padding: 5px 10px 4px; background: rgba(9,12,15,.72);
  font-size: 16px; line-height: 1; white-space: nowrap; }
.fc-legal.h-corner.is-right { left: auto; right: var(--m); }
.h-msg { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 14px; overflow: hidden; height: 100%; }
.h-msg[hidden] { display: none; }
.h-msg em { flex: none; padding: 5px 14px 4px 12px; background: var(--p); color: var(--w); font: 800 18px/1 var(--cond); font-style: normal; letter-spacing: .2em;
  text-transform: uppercase; clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.h-msg span { font: 600 24px/1 var(--cond); letter-spacing: .03em; color: var(--w); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-msg span.is-legal { font-size: 18px; font-weight: 500; color: #B3BDC7; }
.h-strip .fc-socials { flex: 1 1 auto; gap: 34px; height: 100%; }
.h-strip .fc-soc { font-size: 24px; gap: 10px; }
.h-strip .fc-soc .ok-icon { font-size: 22px; }
.h-strip .fc-legal { flex: none; font-size: 18px; line-height: 1; white-space: nowrap; }
.h-strip .fc-legal[hidden] { display: none; }
.h-strip { transition: transform .7s var(--ease) .3s; }
.stage:not(.is-in) .h-strip { transform: translateY(60px); }
.bar-top .stage:not(.is-in) .h-strip { transform: translateY(-60px); }

/* ---------------- Cadre webcam (angles coupés) ----------------
 * Trou transparent 480×270 (cam 16:9). Le SVG entoure la cam d'un liseré ; seuls le coin haut gauche et le coin bas
 * droit de la cam sont coupés (26 px) ; plaque nominative de 46 px SOUS la cam (ne la couvre pas). */
.cam { position: absolute; z-index: 3; width: 480px; height: 270px; right: calc(var(--m) + 8px); bottom: calc(var(--B) + 46px); }
.cam-bl .cam, .cam-tl .cam { right: auto; left: calc(var(--m) + 8px); }
.cam-tr .cam, .cam-tl .cam { bottom: auto; top: calc(var(--T) + 20px); }
.cam-none .cam { display: none; }
.cam svg { position: absolute; left: -8px; top: -20px; width: 496px; height: 336px; overflow: visible; }
.cam-shine { position: absolute; left: -8px; top: -20px; width: 496px; height: 336px; overflow: hidden; pointer-events: none; }
.cam-shine i { position: absolute; top: -10%; left: 0; width: 90px; height: 120%; opacity: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.4), rgba(255,255,255,0));
  transform: translateX(-140px) skewX(-18deg); animation: hudShine 12s ease-in-out 3s infinite; will-change: transform, opacity; }
@keyframes hudShine { 0% { transform: translateX(-140px) skewX(-18deg); opacity: 0; } 3% { opacity: 1; } 14%, 100% { transform: translateX(620px) skewX(-18deg); opacity: 0; } }
.cam-plate { position: absolute; left: 6px; right: 6px; top: 270px; height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; }
.cam-plate > i { width: 14px; height: 22px; flex: none; background: var(--g); transform: skewX(-16deg); }
.cam-name { flex: 0 1 auto; min-width: 0; font: italic 900 26px/1 var(--disp); font-stretch: 112%; letter-spacing: -.01em; white-space: nowrap; color: var(--w); }
.cam { transition: opacity .6s ease .2s, transform .8s var(--ease) .2s; }
.stage:not(.is-in) .cam { opacity: 0; transform: translateY(24px); }

/* ---------------- Le joueur (sans caméra) : miroir du score bug, en bas à droite ---------------- */
.h-player { position: absolute; z-index: 3; right: var(--m); bottom: var(--B); width: 300px; height: 318px; display: none; pointer-events: none; }
.cam-none .h-player { display: block; }
.no-player .h-player { display: none !important; }
.h-player::before { content: ''; position: absolute; left: 6px; right: 0; bottom: 18px; height: 150px; background: var(--plate);
  clip-path: polygon(28px 0, 100% 0, 100% 100%, 0 100%); border-bottom: 3px solid var(--g); }
.h-pl { left: 10px; top: 0; width: 290px; height: 300px; --pl-fade: 6%; }
.h-credit { position: absolute; right: 0; bottom: -4px; font: 600 18px/1 var(--cond); letter-spacing: .04em; color: #B3BDC7; white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,.8); }
.h-player { transition: transform .8s var(--ease) .2s, opacity .5s ease .2s; }
.stage:not(.is-in) .h-player { transform: translateX(80px); opacity: 0; }

/* ---------------- Mouvement réduit ---------------- */
body.fc-rm .stage:not(.is-in) .h-bug, body.fc-rm .stage:not(.is-in) .h-logo, body.fc-rm .stage:not(.is-in) .cam,
body.fc-rm .stage:not(.is-in) .h-player, body.fc-rm .stage:not(.is-in) .h-strip { transform: none; }
body.fc-rm .cam-shine { display: none; }
