:root {
  --sk-bg: #0d1117;
  --sk-panel: #111827;
  --sk-panel-2: #151b26;
  --sk-line: rgba(148, 163, 184, 0.18);
  --sk-text: #e5e7eb;
  --sk-muted: #94a3b8;
  --sk-live: #22c55e;
  --sk-live-soft: rgba(34, 197, 94, 0.12);
  --sk-blue: #38bdf8;
  --sk-amber: #f59e0b;
  --sk-red: #ef4444;
  --sk-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 14% 8%, rgba(56, 189, 248, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(34, 197, 94, 0.11), transparent 30rem),
    linear-gradient(180deg, var(--sk-bg) 0%, #090e16 52%, var(--sk-bg) 100%);
  color: var(--sk-text);
}

main,
section,
article,
aside,
nav,
.scoreboard-card,
.match-card,
.pitch {
  min-width: 0;
}

h1,
h2,
h3,
p,
a,
button,
td,
th {
  overflow-wrap: break-word;
}

.match-card button,
.scoreboard-card button {
  min-width: 0;
}

.arena-grid {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.live-dot {
  position: relative;
  display: inline-flex;
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 999px;
  background: var(--sk-live);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.72);
  animation: sk-pulse-dot 1.55s ease-out infinite;
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -0.35rem;
  border-radius: inherit;
  border: 1px solid rgba(34, 197, 94, 0.34);
  opacity: 0.75;
}

@keyframes sk-pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.62);
  }
  70% {
    box-shadow: 0 0 0 0.72rem rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.scoreboard-card,
.match-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--sk-line);
  border-radius: 0.5rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    linear-gradient(180deg, rgba(17, 24, 39, 0.96), rgba(13, 17, 23, 0.96));
  box-shadow: var(--sk-shadow);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.scoreboard-card::before,
.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.11), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 18px);
  opacity: 0.45;
}

.scoreboard-card:hover,
.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(52, 211, 153, 0.42);
}

.scoreboard-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--sk-line);
  background: rgba(0, 0, 0, 0.22);
  padding: 0.75rem 1rem;
}

.scoreline {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.team-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  flex: 0 0 2.45rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.10);
}

.match-clock {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(34, 197, 94, 0.36);
  border-radius: 999px;
  background: var(--sk-live-soft);
  padding: 0.32rem 0.7rem;
  color: #86efac;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Self-contained Koora-style native match feed */
.match-filter-btn {
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  white-space: nowrap;
}

.match-filter-btn:hover {
  transform: translateY(-1px);
}

.koora-league {
  contain: layout;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.28)),
    rgba(0, 0, 0, 0.20);
}

.koora-league-header {
  min-width: 0;
}

.koora-league-icon {
  display: inline-grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  flex: 0 0 1.85rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.22);
  font-size: 1rem;
}

.koora-match-row {
  border: 0;
  color: inherit;
  font: inherit;
  background: rgba(255, 255, 255, 0.025);
}

.koora-match-row:hover {
  background: rgba(255, 255, 255, 0.07);
}

.koora-match-row:focus-visible,
.match-filter-btn:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.75);
  outline-offset: 2px;
}

.koora-status {
  display: inline-flex;
  min-width: 4rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.36rem 0.58rem;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.koora-status.is-live {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.13);
  color: #86efac;
}

.koora-status.is-finished {
  color: #94a3b8;
}

.koora-status.is-upcoming {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.10);
  color: #7dd3fc;
}

.koora-crest {
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  flex: 0 0 2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(14, 165, 233, 0.72), rgba(34, 197, 94, 0.54)),
    #334155;
  color: #ffffff;
  font-size: 0.64rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.10);
}

.koora-score {
  display: inline-flex;
  min-width: 4.75rem;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 0.45rem;
  background: rgba(0, 0, 0, 0.30);
  padding: 0.48rem 0.7rem;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.koora-score.is-live-score {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.13);
  color: #fde68a;
}

.koora-score.is-finished-score {
  color: #e2e8f0;
}

.koora-score.is-upcoming-score {
  color: #94a3b8;
}

.match-empty {
  min-height: 12rem;
  display: grid;
  place-items: center;
}

.league-row {
  transition: background 150ms ease, transform 150ms ease;
}

.league-row:hover {
  background: rgba(255, 255, 255, 0.045);
}

.form-badge {
  display: inline-grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
}

.form-w {
  background: var(--sk-live);
  color: #04130a;
}

.form-d {
  background: #64748b;
  color: #fff;
}

.form-l {
  background: var(--sk-red);
  color: #fff;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .countdown-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.countdown-card,
.flip-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0 49%, rgba(0, 0, 0, 0.28) 50% 100%),
    #101722;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.32);
  padding: 1rem;
  text-align: center;
}

.countdown-card::after,
.flip-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.42);
}

.countdown-digit,
.flip-digit {
  position: relative;
  z-index: 1;
  display: block;
  color: #fff;
  font-size: clamp(2.15rem, 7vw, 4rem);
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.countdown-label,
.flip-label {
  position: relative;
  z-index: 1;
  margin-top: 0.45rem;
  color: var(--sk-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stoppage-meter {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.45rem;
  background: rgba(0, 0, 0, 0.24);
  padding: 0.75rem;
}

.stoppage-meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--sk-text);
  font-size: 0.88rem;
  font-weight: 800;
}

.stoppage-meter-track {
  height: 0.55rem;
  margin-top: 0.65rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.stoppage-meter-fill {
  width: var(--meter-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sk-live), var(--sk-blue));
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.32);
  transition: width 240ms ease;
}

.toast-region {
  position: fixed;
  top: 5rem;
  right: 1rem;
  z-index: 80;
  display: grid;
  width: min(24rem, calc(100vw - 2rem));
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid rgba(52, 211, 153, 0.32);
  border-radius: 0.5rem;
  background: rgba(13, 17, 23, 0.96);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.38);
  padding: 0.9rem 1rem;
  color: var(--sk-text);
  pointer-events: auto;
  transform: translateX(110%);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--sk-live-soft);
  color: #86efac;
}

.toast-title {
  font-size: 0.9rem;
  font-weight: 900;
  color: #fff;
}

.toast-message {
  margin-top: 0.12rem;
  color: var(--sk-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.tab-active {
  border-color: rgba(52, 211, 153, 0.55) !important;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(56, 189, 248, 0.12)) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.16), 0 12px 34px rgba(34, 197, 94, 0.10);
}

.filter-active {
  border-color: var(--sk-live) !important;
  background: var(--sk-live) !important;
  color: #04130a !important;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .toast-region {
    top: auto;
    right: 1rem;
    bottom: 1rem;
  }

  .scoreboard-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .koora-match-row {
    gap: 0.8rem;
    padding: 0.85rem;
  }

  .koora-status {
    min-width: 3.65rem;
  }

  .koora-score {
    min-width: 4.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .live-dot,
  .toast,
  .scoreboard-card,
  .match-card,
  .stoppage-meter-fill {
    animation: none !important;
    transition: none !important;
  }
}
