I'm trying to recreate a math game for a University project with HTML CSS and JS. During the layout, my flexbox items are going outside their container. I gave them a thick border so it is easier to see what is happening. I'm trying to design it first for mobile as I show in the picture below.
.container {
display: flex;
flex: 1;
flex-flow: column wrap;
justify-content: center;
align-items: center;
margin: 1em;
border-width: 5px;
border-style: solid;
border-color: red;
}
.flex-item {
align-items: center;
justify-content: center;
border-width: 5px;
border-style: solid;
border-color: rgb(0, 255, 64);
}
Here is the full code in codepen
What I'm doing wrong?