Quantum chaos and critical behavior on a chip