RIO DE JANEIRO (AP) Rafaela Silva hoped to get an Olympic gold medal four years ago in London. Instead she got racial abuse.
Disqualified in her Olympic judo match and eliminated from the chance of winning a medal, Brazil's Silva thought she'd find refuge in sympathetic text messages from fans in her country.
Instead, here's what she found: ''The place for a monkey is in a cage. You are not an Olympian.''
''The messages said I was an embarrassment to my family, so they really hurt,'' said Silva, who won gold in the world championships a year after London, and is among the favorites for gold when the Rio de Janeiro Olympics open in just over a week.
Silva is one of many athletes familiar with the sting of racism in a country where most of the poor are brown and black. Though a nation of rich diversity - 51 percent identify as non-white, brown, black or mixed race - racism still runs deep.
On the one hand, Brazil is thoroughly mixed. On the other, there is searing racial inequality in a place often portrayed as a ''racial democracy,'' or ''race-blind.'' The myth of a race-blind country has been losing force, but there's still a yawning gap between black and white.
''Behind the apparent peaceful melting pot there's a lot of tension and not much open talk about race,'' Marta Arretche, a political scientist who studies inequality at the University of Sao Paulo, told The Associated Press.
Diversity and inequality will line up side-by-side at the Olympics, just as they did at Brazil's World Cup two years ago. Visitors will see the country's racial politics play out in ways that are subtle, yet clear.
Magazine covers seldom feature a black face. The very popular soap operas feature mostly white actors, although black actors are now getting roles other than drivers, cooks or doormen. Upscale restaurants and suburban shopping malls are almost all white. Waiters in top restaurants are seldom black. And the only black faces at the airport are the hired help, or black women caring for white children in the airline lounges.
All shades sunbathe on most Rio's beaches, though Ipanema and Leblon tend to be more white. Vendors selling trinkets and drinks on all beaches are usually black.
It will also be apparent in the crowds at venues, an issue that began with the World Cup two years ago. White fans bought the pricey tickets, and the black and brown were priced out.
Rio de Janeiro Mayor Eduardo Paes promised during the World Cup that the Olympics would be different, pledging to supply 1.2 million free tickets to schools and the poor. In the end, he came up with 47,000 Olympics tickets - 4 percent of his promise.
The cheapest Olympic tickets cost 40 Brazilian reals ($12), though the average price is 100-200 ($30-$60). The top ticket for the opening ceremony is listed on the official website at 4,600 ($1,400). By comparison, the government-mandated monthly minimum wage is 880 reals (about $270).
Blacks earn about half of what whites do, and among the wealthier the gap jumps to 2.5 times less.
The root of the problem starts with slavery.
Brazil imported about 5 million African slaves - about 10 times more than the United States. Slavery ended in 1888, which was 25 years after the United States. Brazil was overwhelmingly black at the time, which triggered a government policy to ''whiten'' the country with poor European immigrants, Japanese and others to replace slave labor.
It's difficult to define who's black. Most Brazilians self-identify, which means that two people of similar skin colors may identify differently - one as white and one as black.
In a case at the University of Brasilia, identical twins applied for admission under an affirmative-action program. Only one was judged to be black.
The Brazilian government in a household survey in 1976 asked people to describe their color. It came up with 136 descriptions from morena (brown), to canela (cinnamon), to trigo (wheat) and 133 other shades, an exhaustive list explained by Brazilian anthropologist Lilia Moritz Schwarcz .
Barcelona soccer star Neymar has been the subject of many reports about his skin color. A mix-raced Brazilian, photos show his skin tone has lightened since he's become world-famous and a marketing success. He frequently appears in TV ads for dandruff shampoo, foot cream and electronic products.
''The bias against being black shows up almost everywhere,'' Arretche said.
Brazil's 400 Olympic athletes represent all colors and shades, easy to see in photos on the website of the Brazilian Olympic Committee . The same website carries a group photo of the BOC's administration standing in front of the headquarters: the members are almost all white headed by IOC member Carlos Nuzman.
The same is true for the local Olympic organizing committee, which Nuzman also leads - virtually all white from CEO Sidney Levy on down.
Michel Temer, the acting president of Brazil, has only white men in his cabinet - no women and no blacks. Temer has the honor of declaring the Olympics ''open'' at the opening ceremony on Aug. 5.
''There was a strong silence in Brazil about race, a taboo,'' said Marcia Lima, who studies the subject at the University of Sao Paulo. ''That was the most powerful way for the white elite to control black people; that nobody talked about race. We don't have a race problem here would be the response, so we didn't need to talk about it.''
Mortiz Schwarcz cites a Brazilian study in which 97 percent said they were not prejudiced, but 98 percent said they knew people who were.
''It's not so open, not institutional as it was in the south in the United States,'' Arretche said. ''The racism is much more disguised.''
Stephen Wade on Twitter: http://twitter.com/StephenWadeAP .His work can be found at http://bigstory.ap.org/content/stephen-wade