@font-face {
  font-family: 'Raleway';
  font-style: normal;
  font-weight: 300;
  src: url(https://fonts.gstatic.com/s/raleway/v22/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVuEorCIPrQ.ttf) format('truetype');
}
.dice-container {
  width: 300px;
  height: 300px;
  position: relative;
  perspective: 1000px;
  cursor: -webkit-grab;
  cursor: grab;
  z-index: 999;
  transition: transform 0.2s ease 0;
}
.dice-container:hover {
  transform: scale(0.98);
}
#dice {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 1s;
}
#dice figure {
  width: 198px;
  height: 198px;
  display: block;
  position: absolute;
  border: 1px solid #000;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  text-align: center;
  line-height: 200px;
  font-size: 60px;
  background-color: #FFF;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
#dice .front {
  transform: rotateY(0deg) translateZ(100px);
  background-image: url('https://alexerlandsson.github.io/assets/codepen/roll-the-dice/images/dice-1.png');
}
#dice .back {
  transform: rotateX(180deg) translateZ(100px);
  background-image: url('https://alexerlandsson.github.io/assets/codepen/roll-the-dice/images/dice-6.png');
}
#dice .right {
  transform: rotateY(90deg) translateZ(100px);
  background-image: url('https://alexerlandsson.github.io/assets/codepen/roll-the-dice/images/dice-4.png');
}
#dice .left {
  transform: rotateY(-90deg) translateZ(100px);
  background-image: url('https://alexerlandsson.github.io/assets/codepen/roll-the-dice/images/dice-3.png');
}
#dice .top {
  transform: rotateX(90deg) translateZ(100px);
  background-image: url('https://alexerlandsson.github.io/assets/codepen/roll-the-dice/images/dice-2.png');
}
#dice .bottom {
  transform: rotateX(-90deg) translateZ(100px);
  background-image: url('https://alexerlandsson.github.io/assets/codepen/roll-the-dice/images/dice-5.png');
}
#dice.show-front {
  transform: translateZ(-100px) rotateY(0deg);
}
#dice.show-back {
  transform: translateZ(-100px) rotateX(-180deg);
}
#dice.show-right {
  transform: translateZ(-100px) rotateY(-90deg);
}
#dice.show-left {
  transform: translateZ(-100px) rotateY(90deg);
}
#dice.show-top {
  transform: translateZ(-100px) rotateX(-90deg);
}
#dice.show-bottom {
  transform: translateZ(-100px) rotateX(90deg);
}
#dice.show-same {
  transform: translateZ(-100px) rotateX(360deg);
}
/* Base Style */
html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  background-color: #24262C;
  color: #555;
  font-family: 'Raleway', sans-serif;
}
#instructions {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5vw;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
footer {
  position: fixed;
  bottom: 10px;
  width: 100%;
  text-align: center;
}
footer a {
  color: #555;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
footer a:hover {
  color: #CCC;
}
button {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: transparent;
  border: 1px solid #555;
  border-radius: 50%;
  color: #555;
  width: 30px;
  height: 30px;
  font-size: 16px;
  transition: all 0.2s ease 0;
}
button:hover {
  color: #CCC;
  border-color: #CCC;
}
button:focus {
  outline: none;
}