Скруглить, задать тень. Лишнее обрезать.
Если у елемента взять радиус побольше, например 15px
100% 100%
сломает пропорции скругления.#canvasWrapper {
width: 500px;
height: 625px;
position: relative;
&::before {
/* Если по какой-то причине нельзя задать фон прямо #canvasWrapper */
/* div id="fon" удалить */
content: "";
position: absolute;
/* width: 100%; */
/* height: 100%; */
inset: 0;
background-color: #ffdcdc;
background-image: url(https://cs4.pikabu.ru/post_img/2016/07/13/2/og_og_1468372209297155173.jpg);
z-index: 0;
}
}
.grid-field {
--gap: 4px;
/* display: flex; */
/* flex-wrap: wrap; */
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: var(--gap); /* Промежутки между элементами */
box-sizing: border-box;
position: absolute;
/* left: 0; */
/* width: 100%; */
/* height: 100%; */
inset: 0;
overflow: hidden;
}
.grid-item {
/* position: relative; */
/* display: flex; */
/* justify-content: center; */
/* align-items: center; */
/* background-color: transparent; */
font-size: 24px;
/* flex: 1 0 calc(25% - 10px); */
/* aspect-ratio: 1; */
pointer-events: auto;
z-index: 1;
overflow: hidden;
box-shadow: 0 0 0 calc(var(--gap) / 2 + 1px) white;
}
.item-inner {
display: flex;
justify-content: center;
align-items: center;
aspect-ratio: 1;
border: 1px solid #4b80a5;
box-sizing: border-box;
border-radius: 12px;
box-shadow: 0 0 0 100vw white;
/* position: absolute; */
/* left: 0; */
/* right: 0; */
/* top: 0; */
/* bottom: 0; */
}
.grid-field {
display: flex;
flex-wrap: wrap;
position: absolute;
gap: 4px;
padding-right: 4px;
box-sizing: border-box;
left: 0;
width: 100%;
pointer-events: none;
z-index: -1;
background-color: #fff;
}
.grid-item {
display: flex;
justify-content: center;
align-items: center;
background-color: #000;
color: #e5e5e5;
font-size: 24px;
border-radius: 5px;
flex: 1 0 calc(25% - 10px);
aspect-ratio: 1;
pointer-events: auto;
border: 1px solid #bdbdbd;
}