@import url('./lb-modal-close-unified-v1.css?v=1');

/* La Bétaillère — Le Troupeau en direct v1
 * Micro-compteur dans La Voix du Bétail + fiche détaillée à la demande.
 * Aucun espace vertical permanent supplémentaire.
 */

#home .live-wall-card--home .live-wall-title {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

#home .lb-herd-live-badge {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 0 0 auto;
  height: 21px !important;
  min-height: 21px !important;
  min-width: 38px !important;
  padding: 0 6px !important;
  margin: 0;
  border: 1px solid rgba(74, 231, 241, .34);
  border-radius: 999px;
  background: rgba(2, 20, 31, .74);
  color: #dffcff;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 9px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 8px rgba(30,224,239,.08);
  cursor: pointer;
  vertical-align: middle;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

#home .lb-herd-live-badge[hidden] {
  display: none !important;
}

#home .lb-herd-live-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #37efa0;
  box-shadow: 0 0 7px rgba(55,239,160,.78);
}

#home .lb-herd-live-badge__cow {
  font-family: system-ui, sans-serif;
  font-size: 10px;
  line-height: 1;
}

#home .lb-herd-live-badge:hover,
#home .lb-herd-live-badge:focus-visible {
  border-color: rgba(88, 242, 250, .68);
  background: rgba(5, 38, 51, .90);
  outline: none;
}

#home .lb-herd-live-badge.is-pulsing {
  animation: lb-herd-live-pulse .52s ease;
}

@keyframes lb-herd-live-pulse {
  0%, 100% { transform: scale(1); }
  48% { transform: scale(1.09); }
}

.lb-herd-live-dialog {
  box-sizing: border-box;
  width: min(380px, calc(100vw - 28px));
  max-width: 380px;
  padding: 0;
  border: 1px solid rgba(83, 228, 241, .30);
  border-radius: 18px;
  background:
    radial-gradient(circle at 15% -10%, rgba(53, 226, 241, .13), transparent 44%),
    linear-gradient(155deg, rgba(8, 43, 58, .98), rgba(2, 15, 25, .99) 72%);
  color: #eafcff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06),
    0 22px 60px rgba(0,0,0,.52),
    0 0 24px rgba(21,218,237,.09);
  overflow: hidden;
}

.lb-herd-live-dialog::backdrop {
  background: rgba(0, 7, 13, .62);
  backdrop-filter: blur(2px);
}

.lb-herd-live-sheet {
  padding: 14px;
}

.lb-herd-live-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lb-herd-live-heading {
  min-width: 0;
}

.lb-herd-live-heading h3 {
  margin: 0;
  color: #65eef8;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
}

.lb-herd-live-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  color: #9bc4cc;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.lb-herd-live-kicker i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #37efa0;
  box-shadow: 0 0 7px rgba(55,239,160,.75);
}

.lb-herd-live-close {
  appearance: none;
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(113, 223, 235, .22);
  border-radius: 9px;
  background: rgba(2, 19, 30, .65);
  color: #b9e6ec;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.lb-herd-live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.lb-herd-live-stat {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid rgba(93, 221, 234, .16);
  border-radius: 11px;
  background: rgba(3, 24, 36, .58);
}

.lb-herd-live-stat strong {
  display: block;
  color: #f4feff;
  font-family: "Orbitron", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.lb-herd-live-stat span {
  display: block;
  margin-top: 4px;
  color: #a8cbd1;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.08;
}

.lb-herd-live-foot {
  margin: 9px 1px 0;
  color: #759da6;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.18;
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 900px) {
  #home .live-wall-card--home .live-wall-title {
    gap: 5px !important;
  }

  #home .lb-herd-live-badge {
    height: 19px !important;
    min-height: 19px !important;
    min-width: 34px !important;
    padding: 0 5px !important;
    gap: 2px !important;
    font-size: 8.5px !important;
  }

  #home .lb-herd-live-badge::before {
    width: 4px;
    height: 4px;
    flex-basis: 4px;
  }

  #home .lb-herd-live-badge__cow {
    font-size: 9px;
  }

  .lb-herd-live-dialog[open] {
    position: fixed;
    inset: auto 10px max(78px, calc(env(safe-area-inset-bottom, 0px) + 70px)) 10px;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 17px;
  }

  .lb-herd-live-sheet {
    padding: 12px;
  }

  .lb-herd-live-heading h3 {
    font-size: 13px;
  }

  .lb-herd-live-grid {
    gap: 6px;
    margin-top: 10px;
  }

  .lb-herd-live-stat {
    padding: 8px 7px;
  }

  .lb-herd-live-stat strong {
    font-size: 15px;
  }

  .lb-herd-live-stat span {
    font-size: 10.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home .lb-herd-live-badge.is-pulsing {
    animation: none;
  }
}

/* Audience connectée : détail compact sans nouvelle carte ni ligne sur l'accueil. */
.lb-herd-live-stat--audience small {
  display: block;
  margin-top: 5px;
  color: #7fa9b1;
  font-family: "Rajdhani", system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.lb-herd-live-stat--audience small b {
  color: #c9f7fb;
  font-family: inherit;
  font-size: inherit;
  font-weight: 800;
}

@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-width: 900px) {
  .lb-herd-live-stat--audience small {
    margin-top: 4px;
    font-size: 9px;
  }
}

/* ===== Cohérence modale #BER v3 =====
 * Le Troupeau reprend exactement le langage visuel des autres modales :
 * overlay plein écran, carte centrale, croix Tron commune.
 */
html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-dialog {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border: none !important;
  border-radius: 0 !important;
  background: rgba(4, 12, 20, .78) !important;
  box-shadow: none !important;
  z-index: 6000 !important;
}

html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-dialog[open] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-dialog::backdrop {
  background: rgba(2, 8, 14, .72) !important;
  backdrop-filter: none !important;
}

html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-sheet {
  position: relative !important;
  width: min(420px, calc(100vw - 40px)) !important;
  max-width: 100% !important;
  max-height: calc(100dvh - var(--top-bar-height, 72px) - var(--bottom-bar-height, 84px) - 28px) !important;
  margin: 0 auto !important;
  padding: 14px 14px 12px !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  border: 1px solid rgba(0, 240, 255, .44) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at top, rgba(12, 34, 54, .88), rgba(6, 14, 24, .96)) !important;
  color: #fff !important;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, .45),
    0 0 30px rgba(0, 220, 255, .18),
    inset 0 0 18px rgba(0, 220, 255, .20) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}

html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-head {
  min-height: 30px !important;
  align-items: flex-start !important;
  margin-bottom: 10px !important;
}

html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-heading h3 {
  color: #63ecf6 !important;
  text-shadow: 0 0 9px rgba(0, 232, 248, .20) !important;
}

html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-close.tron-close-button {
  margin-left: auto !important;
  align-self: flex-start !important;
}

html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-grid {
  margin-top: 0 !important;
}

@media (max-width: 600px) {
  html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-dialog,
  html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-dialog[open] {
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 12px !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0 !important;
  }

  html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-sheet {
    width: min(340px, calc(100vw - 24px)) !important;
    max-width: 100% !important;
    max-height: calc(100dvh - var(--top-bar-height, 64px) - var(--bottom-bar-height, 84px) - 24px) !important;
    margin: 0 auto !important;
    padding: 12px 12px 10px !important;
    border-radius: 16px !important;
  }

  html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-head {
    min-height: 28px !important;
    margin-bottom: 9px !important;
  }
}


/* Garde-fou mobile : les règles tactiles globales ne doivent pas étirer la croix commune. */
html[data-lb-v4-live="1"] body.lb-v3 .lb-herd-live-dialog .lb-herd-live-close.tron-close-button {
  --tron-close-size: 26px !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  flex: 0 0 26px !important;
  padding: 0 !important;
  border-radius: 999px !important;
}