We develop a ground-motion model (GMM) for crustal earthquakes in Japan that can directly model the probability distribution of ground-motion acceleration time histories based on generative adversarial networks (GANs). The proposed model can generate ground motions conditioned on moment magnitude, rupture distance, and detailed site conditions defined by the average shear-wave velocity in the top 5, 10, and 20 m (VS5, VS10, and VS20) and the depth to shear-wave velocities of 1.0 km/s and 1.4 km/s (Z1.0 and Z1.4). We construct the neural networks based on styleGAN2 and introduce a novel neural network architecture to generate ground motions considering the effect of source, path, and such detailed site conditions. The resulting 5% damped spectral acceleration from the proposed GMM is consistent with empirical GMMs in terms of magnitude and distance scaling. The proposed GMM can also generate ground motions accounting for the shear-wave velocity profiles of surface soil with different magnitudes and distances and represent characteristics that are not explained solely byVS30.