The fusion created by magnetically confined plasma is a promising clean and essentially unlimited future energy source. However, there are important problems hindering controlled fusion like the imperfect magnetic confinement and the associated plasma instabilities. We theoretically demonstrate how to create a fully confined magnetic field with the precise three-dimensional shape required by fusion theory, using a bulk superconducting toroid with a toroidal cavity. The vacuum field in the cavity consists of nested flux surfaces. The coils creating the field, embedded in the superconducting bulk, can be chosen with very simple shapes, in contrast with the cumbersome arrangements in current experiments, and can be spared from large magnetic forces between them. Because of the superconductor properties, the system will tend to maintain the optimum field distribution in response to instabilities in the plasma. We numerically demonstrate how a fully-confined magnetic field with the three-dimensional spatial distribution required in two of the most advanced stellarators, Large Helical Device and Wendelstein 7-X, can be exactly generated, using simple round coils as magnetic sources. Current high-temperature superconductors can be employed to construct the bulk superconducting toroid. This can lead to optimized robust magnetic confinement and largely simplified configurations in future fusion experiments.