  We construct non-archimedean SYZ fibrations for maximally degenerate
Calabi-Yau varieties, and we show that they are affinoid torus fibrations away
from a codimension two subset of the base. This confirms a prediction by
Kontsevich and Soibelman. We also give an explicit description of the induced
integral affine structure on the base of the SYZ fibration. Our main technical
tool is a study of the structure of minimal dlt-models along one-dimensional
strata.
