/* NBA Live Lineup Tracker Styles */

:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #121722;
  --bg-tertiary: #1b2333;
  --card-bg: rgba(12, 18, 30, 0.34);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-orange: #f97316;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
}

body {
  background-color: #0a0d14;
  background-image:
    linear-gradient(rgba(8, 12, 20, 0.42), rgba(8, 12, 20, 0.56)),
    url('./court-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

/* Custom Scrollbars (Thicker horizontal slider bars for easy dragging) */
::-webkit-scrollbar {
  width: 9px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.65);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.45);
  border-radius: 9999px;
  border: 2px solid rgba(15, 23, 42, 0.65);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.8);
}

.custom-scrollbar {
  scrollbar-width: auto;
  scrollbar-color: rgba(148, 163, 184, 0.5) rgba(15, 23, 42, 0.65);
}
.custom-scrollbar::-webkit-scrollbar {
  width: 10px;
  height: 13px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(249, 115, 22, 0.85);
}

/* Live Badge Glow & Pulsing */
@keyframes live-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.live-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  animation: live-pulse 1.8s infinite;
}

/* Stat Update Glow Animations */
@keyframes stat-increase {
  0% {
    background-color: rgba(16, 185, 129, 0.5);
    color: #ffffff;
    transform: scale(1.15);
  }
  50% {
    background-color: rgba(16, 185, 129, 0.25);
  }
  100% {
    background-color: transparent;
    transform: scale(1);
  }
}

.stat-flash {
  animation: stat-increase 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 4px;
}

/* Glassmorphism card (blur reserved for headers/modals; cards use fast GPU-friendly translucent fill) */
.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel-interactive {
  background: linear-gradient(145deg, rgba(24, 32, 50, 0.96) 0%, rgba(13, 18, 29, 0.98) 100%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45),
    0 12px 28px -8px rgba(0, 0, 0, 0.68),
    0 4px 12px -2px rgba(249, 115, 22, 0.08);
  transform-style: preserve-3d;
  transition: border-color 0.2s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
  will-change: transform;
}

.glass-panel-interactive::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    420px circle at var(--glare-x, 50%) var(--glare-y, 35%),
    rgba(255, 255, 255, 0.11),
    rgba(249, 115, 22, 0.06) 35%,
    transparent 70%
  );
  transition: opacity 0.25s ease;
  z-index: 1;
}

.glass-panel-interactive:hover {
  border-color: rgba(249, 115, 22, 0.58);
  transform: perspective(1100px) rotateX(var(--tilt-x, 2deg)) rotateY(var(--tilt-y, -2deg)) translateY(-6px) scale(1.014);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 22px 40px -10px rgba(0, 0, 0, 0.78),
    0 0 26px -4px rgba(249, 115, 22, 0.28);
}

.glass-panel-interactive:hover::before {
  opacity: 1;
}

.player-card-avatar-3d {
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.55),
    0 0 0 2px rgba(249, 115, 22, 0.35);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}

.glass-panel-interactive:hover .player-card-avatar-3d,
.player-card-avatar-3d:hover {
  transform: translateZ(18px) scale(1.08);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.65),
    0 0 16px rgba(249, 115, 22, 0.5);
}

@keyframes highlightBubblePopIn {
  0% {
    opacity: 0;
    transform: scale(0.14);
  }
  70% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes highlightBubbleShrinkOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.12);
  }
}

.highlight-bubble-pop-in {
  transform-origin: top left;
  animation: highlightBubblePopIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.highlight-bubble-shrink-out {
  transform-origin: top left;
  animation: highlightBubbleShrinkOut 0.26s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Tabular Monospace for Stats */
.stat-mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* Drag & Drop Overlay Active */
.drag-over {
  border-color: var(--accent-orange) !important;
  background-color: rgba(249, 115, 22, 0.08) !important;
}

/* Player Image Shimmer Loading */
.headshot-loading {
  background: linear-gradient(90deg, #1b2333 25%, #2a344a 50%, #1b2333 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Exposure Ring Bar */
.exposure-pill {
  position: relative;
  overflow: hidden;
}
.exposure-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.4));
  z-index: 1;
}

/* Horizontal Games Marquee */
.games-ticker {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: auto;
  padding-bottom: 6px;
}
.games-ticker::-webkit-scrollbar {
  height: 13px;
}

/* 3-Second Flashy Centered Stat Increase Celebration Burst & Explosion */
@keyframes stat-burst-pop-in {
  0% {
    opacity: 0;
    transform: scale(0.25) rotate(-8deg);
    filter: brightness(2);
  }
  55% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
    filter: brightness(1.25);
  }
  75% {
    opacity: 1;
    transform: scale(0.97) rotate(-1deg);
    filter: brightness(1);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: brightness(1);
  }
}

@keyframes stat-core-explode-vanish {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: brightness(1.2);
  }
  20% {
    opacity: 1;
    transform: scale(0.86) rotate(-3deg);
    filter: brightness(3) contrast(1.5) drop-shadow(0 0 40px #ffffff);
  }
  55% {
    opacity: 0.85;
    transform: scale(1.75) rotate(6deg);
    filter: brightness(2.5) blur(3px);
  }
  100% {
    opacity: 0;
    transform: scale(2.6) translateY(-60px) rotate(12deg);
    filter: brightness(3) blur(16px);
  }
}

@keyframes stat-shockwave-blast {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.2);
    border-width: 14px;
  }
  70% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.4);
    border-width: 1px;
  }
}

@keyframes stat-particle-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translate(0px, 0px) scale(1.3) rotate(0deg);
  }
  75% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0) rotate(var(--rot));
  }
}

@keyframes stat-fuse-countdown {
  0% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}

@keyframes stat-burst-pulse-border {
  0%, 100% {
    box-shadow: 0 0 25px rgba(249, 115, 22, 0.75), inset 0 0 25px rgba(249, 115, 22, 0.3);
  }
  50% {
    box-shadow: 0 0 45px rgba(250, 204, 21, 0.95), inset 0 0 35px rgba(250, 204, 21, 0.45);
  }
}

.stat-burst-badge {
  animation: stat-burst-pop-in 0.42s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stat-burst-wrapper.is-exploding .stat-burst-badge {
  animation: stat-core-explode-vanish 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards !important;
}

.stat-shockwave-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  border-radius: 9999px;
  border: 10px solid var(--burst-color, #f97316);
  box-shadow: 0 0 35px var(--burst-color, #f97316), inset 0 0 25px var(--burst-color, #f97316);
  opacity: 0;
  pointer-events: none;
}

.stat-burst-wrapper.is-exploding .stat-shockwave-ring {
  animation: stat-shockwave-blast 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stat-burst-wrapper.is-exploding .stat-shockwave-ring.ring-delay {
  animation: stat-shockwave-blast 0.45s cubic-bezier(0.16, 1, 0.3, 1) 0.07s forwards;
}

.stat-explosion-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--psize, 12px);
  height: var(--psize, 12px);
  border-radius: var(--pradius, 9999px);
  background: var(--pcolor, #facc15);
  box-shadow: 0 0 16px var(--pcolor, #facc15), 0 0 6px #ffffff;
  opacity: 0;
  pointer-events: none;
}

.stat-burst-wrapper.is-exploding .stat-explosion-particle {
  animation: stat-particle-fly 0.46s cubic-bezier(0.12, 0.8, 0.28, 1) forwards;
}

.stat-fuse-bar {
  animation: stat-fuse-countdown 2.55s linear forwards;
}

.stat-burst-card-glow {
  animation: stat-burst-pulse-border 0.75s ease-in-out infinite;
}
