:root {
  --bg-deep: #0a1f14;
  --bg-mid: #123524;
  --turf: #1a5c38;
  --turf-bright: #2d8a52;
  --line: rgba(232, 245, 233, 0.14);
  --text: #eef6ef;
  --text-muted: #a3c4b0;
  --accent: #c8f542;
  --accent-dim: #8fb82e;
  --card: rgba(8, 28, 18, 0.72);
  --card-border: rgba(200, 245, 66, 0.12);
  --danger: #ff6b6b;
  --warn: #f0c674;
  --live: #ff4d4d;
  --font-display: "Bebas Neue", Impact, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --max: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.45;
  position: relative;
}

.pitch-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(45, 138, 82, 0.45), transparent 60%),
    linear-gradient(180deg, var(--bg-mid) 0%, var(--bg-deep) 55%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(255, 255, 255, 0.015) 48px,
      rgba(255, 255, 255, 0.015) 49px
    );
}

.pitch-bg::after {
  content: "";
  position: absolute;
  inset: 12% 8%;
  border: 1px solid var(--line);
  border-radius: 40% / 12%;
  opacity: 0.35;
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: #e4ff7a;
}

.site-header,
.site-main,
.site-footer {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.site-header {
  padding: 2rem 0 1rem;
  animation: rise 0.6s ease both;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--accent), var(--turf-bright));
  color: #0a1f14;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 3px rgba(200, 245, 66, 0.2);
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  letter-spacing: 0.06em;
  line-height: 1;
}

.brand-tagline {
  margin: 0.4rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.site-main {
  padding-bottom: 3rem;
}

.site-footer {
  padding: 1.5rem 0 2.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

.page-intro {
  margin-bottom: 1.25rem;
  animation: rise 0.7s ease both;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 3.5rem);
  letter-spacing: 0.04em;
  font-weight: 400;
}

.page-lead {
  margin: 0.35rem 0 0;
  color: var(--text-muted);
  max-width: 36rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.25rem 0 1.75rem;
  animation: rise 0.75s ease both;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: rgba(200, 245, 66, 0.35);
}

.chip.is-active {
  background: var(--accent);
  color: #0a1f14;
  border-color: transparent;
}

.chip-refresh {
  margin-left: auto;
  border-style: dashed;
  color: var(--text-muted);
}

.match-list {
  display: grid;
  gap: 0.85rem;
}

.match-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  overflow: hidden;
  animation: rise 0.55s ease both;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.match-card:nth-child(1) { animation-delay: 0.05s; }
.match-card:nth-child(2) { animation-delay: 0.1s; }
.match-card:nth-child(3) { animation-delay: 0.15s; }
.match-card:nth-child(4) { animation-delay: 0.2s; }
.match-card:nth-child(5) { animation-delay: 0.25s; }

.match-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 245, 66, 0.35);
}

.match-card.is-live {
  border-color: rgba(255, 77, 77, 0.45);
}

.match-card-link {
  display: block;
  padding: 1rem 1.1rem 1.05rem;
  color: inherit;
}

.match-card-link:hover {
  color: inherit;
}

.match-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.match-competition {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.match-competition img {
  object-fit: contain;
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
}

.team {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.team.away {
  justify-content: flex-end;
  text-align: right;
}

.team img {
  flex-shrink: 0;
  object-fit: contain;
}

.team-name {
  font-weight: 600;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 1.85rem;
  letter-spacing: 0.04em;
  min-width: 4.5rem;
}

.match-score.large {
  flex-direction: column;
  gap: 0.45rem;
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  min-width: 6rem;
}

.score-sep {
  color: var(--text-muted);
  font-size: 0.85em;
}

.score-vs {
  font-size: 1.1rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
}

.match-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.status-badge.live {
  background: rgba(255, 77, 77, 0.18);
  color: #ffb4b4;
  animation: pulse 1.6s ease infinite;
}

.match-cta {
  font-size: 0.82rem;
  color: var(--accent-dim);
}

.alert {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(255, 107, 107, 0.12);
  border-color: rgba(255, 107, 107, 0.35);
  color: #ffc9c9;
}

.alert-warn {
  background: rgba(240, 198, 116, 0.12);
  border-color: rgba(240, 198, 116, 0.35);
  color: #ffe2a8;
}

.empty-state,
.empty-hint {
  color: var(--text-muted);
}

.back-link {
  margin: 0 0 1.25rem;
}

.back-link a {
  color: var(--text-muted);
}

.back-link a:hover {
  color: var(--accent);
}

.match-detail {
  animation: rise 0.55s ease both;
}

.detail-header {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.detail-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}

.detail-scoreboard .team {
  flex-direction: column;
  text-align: center;
  gap: 0.65rem;
}

.detail-scoreboard .team.away {
  justify-content: center;
}

.detail-scoreboard .team-name {
  white-space: normal;
  font-size: 1.05rem;
}

.detail-actions {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.source-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.section-title {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: 1.75rem;
  letter-spacing: 0.05em;
  font-weight: 400;
}

.scorers-block,
.stats-block {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.scorers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.scorers-team {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.scorer-list,
.scorer-timeline,
.stats-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scorer-list li,
.scorer-timeline li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.scorer-list li:last-child,
.scorer-timeline li:last-child {
  border-bottom: none;
}

.scorer-minute {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--accent);
  min-width: 2.6rem;
}

.scorer-name {
  font-weight: 600;
}

.scorer-team {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.scorer-timeline {
  border-top: 1px dashed var(--line);
  padding-top: 0.85rem;
}

.stats-legend {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-row {
  margin-bottom: 0.85rem;
}

.stat-row:last-child {
  margin-bottom: 0;
}

.stat-values {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.stat-home {
  font-weight: 700;
}

.stat-away {
  text-align: right;
  font-weight: 700;
}

.stat-label {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.stat-bars {
  display: flex;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  gap: 2px;
}

.stat-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-bar.home {
  background: linear-gradient(90deg, var(--turf-bright), var(--accent));
  margin-left: auto;
}

.stat-bar.away {
  background: linear-gradient(90deg, #5ec4ff, #2a7fff);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

@media (max-width: 640px) {
  .match-teams {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .match-score {
    order: -1;
  }

  .team.away {
    justify-content: flex-start;
    text-align: left;
    flex-direction: row-reverse;
    justify-content: flex-end;
  }

  .chip-refresh {
    margin-left: 0;
  }

  .detail-scoreboard {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

  .scorer-timeline {
    display: none;
  }
}
