/* Live presence: keeps the site feeling like a broadcast desk between page refreshes. */
.live-status-bar {
  overflow: hidden;
}

.live-status-bar.live-presence-enhanced {
  box-shadow: 0 8px 28px rgba(0, 230, 118, 0.055);
}

.live-presence-meter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}

.live-presence-meter__fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #00e676, #ff6b35, #42a5f5);
  box-shadow: 0 0 16px rgba(0, 230, 118, 0.35);
  transition: transform 320ms linear;
}

.live-presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(0, 230, 118, 0.22);
  border-radius: 999px;
  background: rgba(0, 230, 118, 0.055);
  color: #b7c5d1;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  text-transform: uppercase;
}

.live-presence-chip strong {
  color: #00e676;
}

.live-presence-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.55);
  animation: live-presence-pulse 1.5s ease-in-out infinite;
}

.live-presence-dock {
  position: sticky;
  top: 0;
  z-index: 45;
  border-bottom: 1px solid rgba(255, 107, 53, 0.16);
  background:
    linear-gradient(90deg, rgba(255, 107, 53, 0.08), rgba(0, 230, 118, 0.055)),
    rgba(9, 13, 19, 0.92);
  backdrop-filter: blur(10px);
  color: #aab6c4;
  font-size: 0.72rem;
}

.live-presence-dock__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.live-presence-dock__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e7edf5;
  font-weight: 900;
}

.live-presence-dock__muted {
  color: #8090a2;
}

.live-presence-dock a {
  color: #ff6b35;
  font-weight: 900;
  text-decoration: none;
}

.live-presence-dock a:hover {
  text-decoration: underline;
}

.live-presence-scan {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 100vh;
  z-index: 42;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0, 230, 118, 0.045) 48%, rgba(255, 107, 53, 0.055) 50%, transparent 56%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 7px);
  transform: translateY(-100%);
}

body.live-presence-refreshing .live-presence-scan {
  animation: live-presence-scan 900ms ease-out;
}

body.live-presence-refreshing .live-status-bar,
body.live-presence-refreshing .live-presence-dock,
body.live-presence-refreshing .alive-ticker,
body.live-presence-refreshing .market-pulse__main,
body.live-presence-refreshing .play-board-status,
body.live-presence-refreshing .pick-card-preview {
  animation: live-presence-sync-flash 900ms ease-out;
}

body.live-presence-refreshing .match-card:nth-of-type(1),
body.live-presence-refreshing .match-card:nth-of-type(2),
body.live-presence-refreshing .match-card:nth-of-type(3),
body.live-presence-refreshing .odds-match-card:nth-of-type(1),
body.live-presence-refreshing .odds-match-card:nth-of-type(2),
body.live-presence-refreshing .market-card:nth-of-type(1),
body.live-presence-refreshing .market-card:nth-of-type(2),
body.live-presence-refreshing .cmd-card:nth-of-type(1) {
  animation: live-presence-card-check 760ms ease-out;
}

@keyframes live-presence-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.35);
  }
}

@keyframes live-presence-scan {
  0% {
    opacity: 0;
    transform: translateY(-100%);
  }
  16% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(100%);
  }
}

@keyframes live-presence-sync-flash {
  0% {
    box-shadow: 0 0 0 rgba(0, 230, 118, 0);
  }
  28% {
    box-shadow: 0 0 34px rgba(0, 230, 118, 0.18), 0 0 0 1px rgba(0, 230, 118, 0.16);
  }
  100% {
    box-shadow: inherit;
  }
}

@keyframes live-presence-card-check {
  0% {
    transform: translateY(0);
    border-color: inherit;
  }
  36% {
    transform: translateY(-2px);
    border-color: rgba(0, 230, 118, 0.42);
  }
  100% {
    transform: translateY(0);
    border-color: inherit;
  }
}

@media (max-width: 640px) {
  .live-presence-chip {
    font-size: 0.58rem;
    padding: 2px 6px;
  }

  .live-presence-dock__inner {
    gap: 6px;
    padding: 6px 10px;
  }

  .live-presence-dock__muted:nth-of-type(n+2) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-presence-pulse,
  .live-presence-scan,
  .live-presence-meter__fill {
    animation: none !important;
  }

  body.live-presence-refreshing .live-status-bar,
  body.live-presence-refreshing .live-presence-dock,
  body.live-presence-refreshing .alive-ticker,
  body.live-presence-refreshing .market-pulse__main,
  body.live-presence-refreshing .play-board-status,
  body.live-presence-refreshing .pick-card-preview,
  body.live-presence-refreshing .match-card,
  body.live-presence-refreshing .odds-match-card,
  body.live-presence-refreshing .market-card,
  body.live-presence-refreshing .cmd-card {
    animation: none !important;
  }
}
