In a part of Barcelona best known as a concrete transport hub, just a stone's throw from the bustling Sants railway station, a square has been transformed into an idyllic play area.
Sitting on a sea of bright ethnic cushions and rugs, under canopies shading them from the sun, children tinker with nature-inspired toys, including bits of wood in all shapes and sizes, as their parents look on.
The pop-up play area is part of an Urban Forest initiative organised by Tata Inti, a local non-profit founded in 2014 that provides education to children under six.
The government-funded organisation aims to "democratise the care of young children, make it visible, and at the same time recover public space as a meeting place", said MercE Aranda, co-founder of Tata Inti.
The Urban Forest project, which will hold sessions in eight areas of Barcelona over the next few months, offers free play to lower-income families, Aranda told the Thomson Reuters Foundation.
It comes at a time when city authorities are pushing forward with a 20.7 million-euro ($A31.8 million) initiative, started in 2015, to make Barcelona a more child-friendly city.
Under the plan, 89 new play spaces will be built and 150 existing ones renovated by the end of next year, to make them more accessible and inclusive for children of different ages, as well as those with disabilities.
Underpinning the ambitious scheme is a desire to develop areas outside of the traditional playground model, providing more spontaneous opportunities for play and physical activity.
Globally, fast-growing cities are under pressure to protect children from urban pressures including crime, traffic, pollution, cramped living conditions and social isolation.
Of the four billion people living in the world's urban areas, nearly a third are children, according to UNICEF, the UN agency for children's rights. By 2050, 70 per cent of the world's children will live in urban areas, it estimates.
Healthy development of children is crucial to the wellbeing of any society, and the costs of failing are huge, as children's early experiences shape their future achievements, according to UNICEF, which runs the global Child Friendly Cities Initiative.
Weaker social cohesion and higher crime rates in dense urban areas increase psychotic symptoms in children, including hearing or seeing things that others do not, found a 2016 study published by US-based Duke University.
Urban planners have begun looking for ways to make cities better for children in an everyday sense, by enabling them to get around independently and increasing the amount of time they spend outdoors and in contact with nature.
In Singapore, a new child-friendly bus stop opened last year, featuring a swing, artwork, children's books, a rooftop garden, lots of seating and access to e-books, digital maps and other online information.
If the project, devised by the government with local firm DP Architects, is a success, the authorities plan to expand it from the Jurong region to other parts of Singapore.
Some cities have also begun incorporating wild spaces or freestyle playgrounds, where children can play in nature rather than a man-made setting, take risks, and even have accidents.
Critics say playground design since the 1970s has become too focused on health and safety, leading to unimaginative facilities that stifle children's creativity by preventing them from trying new things and making discoveries for themselves.
New initiatives like forest schools and wild spaces aim to counter that. In Rotterdam's Nature Playground in the Netherlands, children are allowed to camp and build fires and dens, as if they were in the countryside. In London's adventure playgrounds, or junk playgrounds, there are no rules, provided everyone is safe.
Unstructured outdoor play can improve children's problem-solving skills, focus and self-discipline, and boost their ability to get along with others, leading to healthier and happier lives, experts say.
However, a number of studies show children in richer countries are spending less time outdoors.
British children play outside half as much as their parents did, according to a 2016 survey from Britain's National Trust.
The developing world is starting to experience the same trend, said Gill.
"As you are seeing a growing middle-class in poorer countries, you are also seeing children's lives becoming more constrained, and more fear about children's freedoms," he said.
That is partly because wealthier families tend to live in gated communities, he added.
Giving children simple liberties, rather than rearing them "in captivity", is good for them, but also for society more broadly because it points to the general healthiness of a neighbourhood, said Gill.