<div id="old">было</div>
<div id="new">стало</div>
<div id="ani">hah</div>
body{
  background: #446;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
body > div{
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  width: 30mm;
  height: 30mm;
  margin: 5mm;
  padding: 3mm;
  positon: relative;
}

#old{
  background: #cce;
  border-radius: 3mm;
  box-shadow: #000 calc( var(--ofx) * -1mm ) calc( var(--ofy) * -1mm ) 1.5mm;
  --ofx: 1;
  --ofy: 1;
}

#new{
  background: #cce;
  border-radius: 3mm;
}
#new::before{
  content: '';
  width: 32mm;
  height: 32mm;
  background: #66c;
  position: absolute;
  z-index: -1;
  margin: -4mm;
  border-radius: 4mm;
  box-shadow:
    inset #aaf calc( var(--ofx) * -1mm ) calc( var(--ofy) * -1mm ) 2mm,
    inset #f77 calc( var(--ofx) * -1mm ) calc( var(--ofy) * 1mm ) 2mm;
  --ofx: inherit;
  --ofy: inherit;
}


#ani{
  background: #ccc;
  animation: rotatione 2s linear infinite both;
  border-radius: 20% 20% 10% 10%/50% 50% 10% 10%;
}
@keyframes rotatione{
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.