:root{
	--box-color: #0ff5;
	--rotate-speed: 30s;
	--bounce-speed: 2.5s;
}
body{
	background-color: black;
	min-height: 100vh;
	overflow: hidden;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 75px;
	perspective: 15em;
	perspective-origin: 50% calc(50% - 3em);
}

.scene{
	position: relative;
	transform-style: preserve-3d;
	animation: scenerotate var(--rotate-speed) infinite linear;
}
@keyframes scenerotate{
	to {transform: rotateY(360deg);}
}

.ball{
	position: absolute;
	left: -.5em;
	bottom: 1em;
	width: 1em;
	height: 1em;
	border-radius: 50%;
	background-image: radial-gradient(circle at top, lightgreen, 30%, darkgreen);
	animation:
		ballbounce var(--bounce-speed) infinite ease-out,
		scenerotate var(--rotate-speed) infinite linear reverse;
	transform-style: preserve-3d;
}
@keyframes ballbounce{
	0%, 100% {bottom: 0.5em; height: .8em; width: 1.2em;}
	8%, 93.5% {height: 1em; width: 1em;}
	50% {bottom: 3em; animation-timing-function: ease-in; height: 1em; width: 1em;}
}
.ball-shadow{
	position: absolute;
	width: 100%;
	height: 100%;
	background-image: radial-gradient(#0007, #0000 42%);
	animation:
		ballshadow var(--bounce-speed) infinite ease-out;
}
@keyframes ballshadow{
	0%, 8%, 93.5%, 100% {transform: scale(1); opacity: 1;}
	50% {transform: scale(2); opacity: 0.5; animation-timing-function: ease-in;}
}

.cube{
	position: absolute;
	bottom: -1em;
	left: -1em;
	width: 2em;
	height: 2em;
	transform-style: preserve-3d;
	animation:
		cubeheight var(--bounce-speed) infinite linear;
}
.front, .back, .left, .right{
	position: absolute;
	width: 100%;
	height: 100%;
	background: var(--box-color);
	box-shadow:  0 0 0.5em #000a inset;
}
.front{
	transform: translateZ(1em);
}
.right{
	transform: rotateY(90deg) translateZ(1em);
}
.back{
	transform: rotateY(180deg) translateZ(1em);
}
.left{
	transform: rotateY(270deg) translateZ(1em);
}
.top{
	position: absolute;
	width: 2em;
	height: 2em;
	background: var(--box-color);
	transform: translateY(-50%) rotateX(90deg);
	box-shadow:  0 0 0.5em #000a inset;
}
.bottom{
	position: absolute;
	width: 2em;
	height: 2em;
	background: #0007;
	bottom: -.998em;
	z-index: 1;
	transform: rotateX(90deg);
	box-shadow:  0 0 0.5em #000a;
}
@keyframes cubeheight{
	0%, 100% {height: 1.5em;}
	8%, 93.5% {height: 2em;}
}

.floor{
	position: absolute;
	transform: translate(-50%, -50%) rotateX(90deg);
	top: 1em;
	width: 16em;
	height: 16em;
	background-image: 
		radial-gradient(#0000, #000 75%), 
		repeating-conic-gradient(from 45deg, #111 0deg 90deg, #222 90deg 180deg);
	background-size: 100%, 1em 1em;
}