Please reason step by step, and put your final answer within \boxed{}.
Within a cube with edge length 6, there is a regular tetrahedron with edge length \( x \) that can rotate freely inside the cube. What is the maximum value of \( x \)?
user