Anais is fifteen years old. She has never known her parents and has spent her life in care. She arrives at the Panopticon, an institution for young offenders, in a police car, accused of an assault she denies committing. We follow her as she adapts to life in her latest institutional home, forming friendships, facing investigation and struggling to balance the trauma of her past with her efforts to survive in the present and dream of a future.

In adapting her debut novel, The Panopticon (2012), to stage, writer Jenni Fagan, a Granta Best Young British Novelist, and director Debbie Hannan, have succeeded in taking the many layers of a novel in which time, space and characters’ lucidity appear fragmented, and making them communicable to an audience through magnificent feats of creativity in a production that pulsates with life, even as it grapples with death.

The set looks deceptively simple: two stone statues border a row of towering panels that encircle the expanse of centre stage. A square of white light watches over everything: the only mark of an all-seeing watchtower, establishing before a single line of dialogue that in this system power claims to be all-seeing and on high. However, these panels have tricks up their sleeves, with hidden rooms facilitating movement between spaces. Meanwhile, graphics by animator Cat Bruce and video by Lewis den Hertog sees imagery from Anais’ memories, dreams and hallucinations splashed across the set; the audience is engulfed in a tide of nightmarish juxtapositions, as metaphor becomes entangled with reality.

Nevertheless, the direction draws comedy out of a plot heavy in subject matter. Anais’ happier memories and heartfelt dreams are brought to life in whimsical moments as the ensemble cast transforms the stage into a hyperbolic Parisian street or abseil in as masked reincarnations of Anais on previous misadventures. The humour has the audience on side from the outset, but also acts as a bittersweet tonic to the more hard-hitting scenes to come.

The cast captivates across the board, with rapid costume changes and a deft use of props seeing the ensemble adopt a multitude of roles. Anna Russell-Martin gives a sensational performance as the lead Anais, capturing both the grit and vulnerability of a character the audience is willing to win in a battle in which she has been cast as the underdog from birth.

The Panopticon is not a play to see and forget. In the creativity of the production it had the audience hooked throughout, moving in time and space from the whirls of traumatised minds to the brutality of hard realities. Equally, however, Fagan’s story is unforgettable in the piercing spotlight it insists upon searing onto the cruelties inflicted upon vulnerable children in a system which it is hard to leave thinking of as anything but broken. And yet, the failings of the care system were not the echo resounding most poignantly as the sold-out audience rose to its feet. It was the strength of friendship, the dignity of resilience and the defiance of hope which this stunning play underscored most boldly.

The Panopticon runs at the Traverse Theatre until 19 October 2019.