* {
    box-sizing: border-box;
}

body {
   
}

.boxcontainer {
	margin: 0;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    max-width: 600px;
}

.box {
    width: 150px;
    height: 150px;
    background-color: orange;
    color: transparent;
    display: flex;
    font-size: xx-large;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    cursor: pointer;
}

.show {
    animation: show 0.3s forwards;
}

@keyframes show {
    0% {
        background-color: orange;
        color: transparent;
    }

    100% {
        background-color: white;
        color: black;
    }
}

.hide {
    animation: hide 1s forwards;
}

@keyframes hide {
    0% {
        background-color: white;
        color: black;
    }

    100% {
        background-color: orange;
        color: transparent;
    }
}