.teams_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.team_card {
  background-color: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  transition: all 0.25s ease;
}

.team_card:hover {
  border-color: var(--brand);
  transform: translateY(-4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.team_logo img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: brightness(0.9);
}

.team_info h3 {
  color: var(--text-primary);
  font-size: 14px;
}

/* =============== TEAM DETAIL PAGE =============== */
.team_header {
  display: flex;
  align-items: center;
  column-gap: 25px;
  margin-bottom: 30px;
}

.team_header h1 {
  border: none;
  padding: 0;
}

.team_header_logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: var(--dark-secondary);
  border-radius: 12px;
  padding: 10px;
}

.team_header_info {
  display: flex;
  flex-direction: column;
}

.team_meta {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 5px;
  line-height: 1.3;
}

/* Form badges (W/D/L) */
.form_badges {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.form_badges span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
}

.form_win {
  background-color: #2ecc71;
}
.form_draw {
  background-color: #f1c40f;
}
.form_loss {
  background-color: #e74c3c;
}

/* Stats grid */
.team_stats_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat_box {
  background-color: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
}

.stat_label {
  color: var(--text-secondary);
  font-size: 13px;
}

.stat_value {
  font-size: 20px;
  color: var(--text-primary);
  margin-top: 5px;
}

.fixture_box {
  background-color: var(--dark);
  border-radius: 8px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.fixture_box p {
  margin-bottom: 0px;
}

/* =============== RECENT MATCHES TABLE =============== */
.recent_matches_table {
  display: grid;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.match_row {
  display: grid;
  grid-template-columns: 100px 1fr 100px 140px;
  align-items: center;
  background-color: var(--dark);
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 14px;
}

.match_row.t_header {
  background-color: var(--brand);
  letter-spacing: 0.5px;
  color: var(--dark);
  font-weight: bold;
}

.match_row:last-child {
  border-bottom: none;
}

.match_result span {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--dark);
}

.match_result .win {
  background-color: #2ecc71;
}

.match_result .draw {
  background-color: #f1c40f;
}

.match_result .loss {
  background-color: #e74c3c;
}

@media screen and (max-width: 820px) {
  .teams_grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
  }

  .team_logo img {
    width: 60px;
    height: 60px;
  }

  .team_header {
    flex-direction: column;
    row-gap: 10px;
  }

  .team_header_info {
    align-items: center;
    text-align: center;
  }

  .match_row {
    grid-template-columns: 80px 1fr 70px;
  }
  .match_row div:nth-child(4) {
    display: none;
  }
}
