:root {
  --bg: #0a0f1f;
  --bg-soft: #0f162b;
  --panel: rgba(18, 25, 47, 0.94);
  --panel-2: rgba(24, 34, 61, 0.98);
  --panel-3: rgba(12, 18, 34, 0.9);
  --border: #283252;
  --border-soft: #202a45;
  --text: #eef3ff;
  --muted: #96a2c8;
  --green: #18c37e;
  --green-dark: #0f8f5b;
  --green-soft: rgba(24, 195, 126, 0.16);
  --blue: #2d7ff9;
  --blue-dark: #2254b5;
  --amber: #f0b429;
  --amber-soft: rgba(240, 180, 41, 0.16);
  --red: #ef5350;
  --red-soft: rgba(239, 83, 80, 0.15);
  --cyan: #26c6da;
  --purple: #7c5cff;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 6px 20px rgba(0, 0, 0, 0.25);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(45,127,249,0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(24,195,126,0.13), transparent 22%),
    radial-gradient(circle at bottom center, rgba(124,92,255,0.10), transparent 30%),
    linear-gradient(180deg, #09101f 0%, #0a1120 100%);
}

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.topbar-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  color: white;
  cursor: pointer;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-green {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
}

.btn-dark {
  background: linear-gradient(135deg, #202944, #11182c);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
}

.filters-panel {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.filter-group label {
  color: var(--muted);
  font-size: 13px;
}

.filter-group select {
  background: #0f1527;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  margin: 0;
  font-size: 24px;
}

.match-count {
  color: var(--muted);
  font-size: 14px;
}

.matches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 18px;
}

.match-card {
  background: linear-gradient(180deg, rgba(26, 35, 64, 0.98), rgba(13, 19, 37, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(45,127,249,0.05), transparent 35%, rgba(24,195,126,0.03));
  pointer-events: none;
}

.match-card:hover {
  transform: translateY(-2px);
  border-color: #365089;
}

.match-card.alert {
  border-color: rgba(24, 195, 126, 0.65);
  box-shadow:
    0 0 0 1px rgba(24,195,126,0.25),
    0 0 26px rgba(24,195,126,0.16),
    var(--shadow);
}

.match-card.alert::after {
  content: "";
  position: absolute;
  top: 0;
  left: -20%;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(24,195,126,0.8), transparent);
  animation: scanLine 2.2s linear infinite;
}

@keyframes scanLine {
  0% {
    left: -30%;
  }
  100% {
    left: 110%;
  }
}

.match-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.teams {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  min-height: 32px;
  white-space: nowrap;
}

.badge-strong {
  background: var(--green-soft);
  color: #7dffcb;
  border: 1px solid rgba(24, 195, 126, 0.25);
  box-shadow: 0 0 16px rgba(24, 195, 126, 0.12);
}

.badge-watch {
  background: var(--amber-soft);
  color: #ffd369;
  border: 1px solid rgba(240, 180, 41, 0.22);
}

.badge-no {
  background: var(--red-soft);
  color: #ff9d9b;
  border: 1px solid rgba(239, 83, 80, 0.2);
}

.score-row,
.stats-mini {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.mini-box {
  flex: 1;
  min-width: 95px;
  background: var(--panel-3);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.mini-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.probability-wrap {
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.probability-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text);
}

.probability-bar {
  width: 100%;
  height: 12px;
  background: #0e1527;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #243050;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.35);
}

.probability-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--green));
  box-shadow: 0 0 18px rgba(24,195,126,0.22);
}

.card-footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.card-footer strong {
  color: var(--text);
}

.edge-positive {
  color: #7dffcb;
}

.edge-neutral {
  color: #ffd369;
}

.edge-negative {
  color: #ff9d9b;
}

@media (max-width: 1100px) {
  .matches-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (max-width: 900px) {
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 16px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 26px;
  }

  .section-header h2 {
    font-size: 22px;
  }

  .matches-grid {
    grid-template-columns: 1fr;
  }

  .mini-box {
    min-width: 100%;
  }
}
