:root {
  /* Soccer / pitch theme */
  --bg-primary: #06140b;
  --bg-secondary: #0b2a15;
  --bg-card: rgba(8, 28, 16, 0.78);
  --bg-hover: rgba(12, 46, 24, 0.85);

  --text-primary: #f1f5f9;
  --text-secondary: rgba(241, 245, 249, 0.72);
  --text-muted: rgba(241, 245, 249, 0.55);

  --accent-blue: #22c55e; /* green */
  --accent-cyan: #a3e635; /* lime */
  --accent-green: #16a34a; /* pitch green */
  --accent-red: #ef4444;
  --accent-purple: #84cc16; /* lime-green */
  --accent-pink: #10b981;

  --border-color: rgba(148, 163, 184, 0.22);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.65);

  /* a subtle pitch stripes background */
  --gradient-bg: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.35),
      rgba(0, 0, 0, 0.65)
    ),
    repeating-linear-gradient(
      90deg,
      rgba(34, 197, 94, 0.14) 0px,
      rgba(34, 197, 94, 0.14) 60px,
      rgba(16, 163, 74, 0.1) 60px,
      rgba(16, 163, 74, 0.1) 120px
    ),
    radial-gradient(circle at 20% 15%, rgba(163, 230, 53, 0.1), transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(34, 197, 94, 0.1), transparent 45%);

  --gradient-accent: linear-gradient(90deg, #22c55e, #a3e635, #16a34a);
  --gradient-card: linear-gradient(
    145deg,
    rgba(10, 35, 19, 0.92),
    rgba(6, 20, 11, 0.92)
  );
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: var(--gradient-bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background: var(--gradient-accent);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  animation: float 3s ease-in-out infinite;
}

.logo-text h1 {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
}

.logo-text p {
  font-size: 14px;
  color: var(--text-secondary);
  font-family: "JetBrains Mono", monospace;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.3s ease;
}

.status-dot.live {
  background: var(--accent-green);
  box-shadow: 0 0 15px var(--accent-green);
  animation: pulse 2s infinite;
}

.status-dot.error {
  background: var(--accent-red);
  box-shadow: 0 0 15px var(--accent-red);
}

.status-text {
  font-size: 14px;
  font-weight: 500;
}

/* Layout */
.main-content {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
  margin-bottom: 30px;
}
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* Player */
.video-player {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.player-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.player-title i {
  color: var(--accent-cyan);
}

.stream-info {
  display: flex;
  gap: 15px;
  font-size: 14px;
  color: var(--text-secondary);
}
.stream-info span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  margin-bottom: 15px;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  outline: none;
}

.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.video-container:hover .video-overlay {
  opacity: 1;
}

.player-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.control-buttons {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--accent-blue);
  color: white;
}
.btn-primary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: var(--gradient-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.info-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-cyan);
}
.info-card h3 i {
  font-size: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-item {
  background: rgba(30, 41, 59, 0.5);
  border-radius: 10px;
  padding: 15px;
  border: 1px solid var(--border-color);
}
.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  color: var(--text-primary);
}
.stat-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.detection-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 5px;
}
.detection-list::-webkit-scrollbar {
  width: 6px;
}
.detection-list::-webkit-scrollbar-track {
  background: rgba(30, 41, 59, 0.3);
  border-radius: 3px;
}
.detection-list::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 3px;
}

.detection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 10px;
  border-left: 4px solid var(--accent-blue);
  transition: all 0.2s;
}
.detection-item:hover {
  background: rgba(30, 41, 59, 0.8);
  transform: translateX(5px);
}

.detection-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.detection-confidence {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--text-secondary);
}

.detection-item.goal {
  border-left-color: var(--accent-green);
}
.detection-item.shot {
  border-left-color: var(--accent-cyan);
}
.detection-item.foul {
  border-left-color: var(--accent-red);
}
.detection-item.corner {
  border-left-color: var(--accent-purple);
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 14px;
}
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .player-controls {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
  .control-buttons {
    width: 100%;
    justify-content: space-between;
  }
  .footer {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}

.tech-stack {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.tech-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.latency-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}
.latency-value {
  font-family: "JetBrains Mono", monospace;
  color: var(--accent-green);
  font-weight: 600;
}

.copyright {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.8;
}
.copyright span {
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.3px;
}

.copyright-link {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.copyright-link:hover {
  color: var(--accent-blue);
  border-bottom: 1px solid var(--accent-blue);
  text-decoration: none;
}

.fa-spin {
  animation: rotate 2s linear infinite;
}

/* Stream overlay message */
.overlay-message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

.overlay-message.hidden {
  display: none;
}

.overlay-card {
  width: min(560px, 92%);
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-xl);
}

.overlay-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--accent-red);
}

.overlay-body {
  color: var(--text-primary);
  margin-bottom: 10px;
}

.overlay-body code,
.overlay-hint code {
  font-family: "JetBrains Mono", monospace;
  background: rgba(30, 41, 59, 0.6);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(51, 65, 85, 0.8);
}

.overlay-hint {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}
