Создавайте и настраивайте flex-контейнеры с квадратными блоками и выравниванием текста
.flex-container {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: stretch;
align-content: stretch;
gap: 10px;
padding: 20px;
width: 100%;
height: 400px;
background-color: #f0f0f0;
border: 1px solid #ddd;
box-sizing: border-box;
}
.flex-item {
width: 100%;
aspect-ratio: 1 / 1;
background-color: #3498db;
color: #ffffff;
padding: 10px;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
box-sizing: border-box;
border-radius: 4px;
font-weight: 500;
}