* {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #eeeeee;
  font-family: "Roboto", sans-serif;
}

h1 {
  color: #222;
  text-align: center;
  margin-top: 16vh;
  margin-bottom: 10vh;
}

.container {
  display: grid;
  place-items: center;
  width: 250px;
  padding: 60px 0 40px;
  border-radius: 20px;
  background: #eeeeee;
  box-shadow: -10px -10px 15px rgba(255, 255, 255, 0.5),
    10px 10px 15px rgba(70, 70, 70, 0.12);
}

.dice {
  cursor: pointer;
  position: relative;
  width: 100px;
  height: 100px;
  transform-style: preserve-3d;
  transition: 1s ease;
}

@keyframes rolling {
  50% {
    transform: rotateX(455deg) rotateY(455deg);
  }
}

.face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  border: 5px solid #eeeeee;
  transform-style: preserve-3d;
  background: linear-gradient(145deg, #dddbd8, #fff);
}

.face::before {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: #f6f3f0;
  transform: translateZ(-1px);
}

.face::after {
  position: absolute;
  content: "";
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #131210;
}

.front {
  transform: translateZ(50px);
}
.back {
  transform: rotateX(180deg) translateZ(50px);
}
.top {
  transform: rotateX(90deg) translateZ(50px);
}
.bottom {
  transform: rotateX(-90deg) translateZ(50px);
}
.right {
  transform: rotateY(90deg) translateZ(50px);
}
.left {
  transform: rotateY(-90deg) translateZ(50px);
}

.front::after {
  width: 30px;
  height: 30px;
  background: #f63330;
  margin: -15px;
}
.back::after {
  margin: -35px 0 0 -30px;
  box-shadow: 40px 0, 0 25px, 40px 25px, 0 50px, 40px 50px;
}
.top::after {
  margin: -30px 0 0 -30px;
  box-shadow: 40px 40px;
}
.bottom::after {
  margin: -36px;
  box-shadow: 26px 26px, 52px 52px, 52px 0, 0 52px;
}
.right::after {
  margin: -30px;
  box-shadow: 40px 0px, 0px 40px, 40px 40px;
}
.left::after {
  margin: -35px;
  box-shadow: 25px 25px, 50px 50px;
}

.roll {
  cursor: pointer;
  margin-top: 4rem;
  padding: 8px 18px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: -10px -10px 15px rgba(255, 255, 255, 0.5),
    10px 10px 15px rgba(70, 70, 70, 0.12);
  transition: 0.2s ease-out, box-shadow ease 0.2s, box-shadow 0.3s ease;
}
.roll:hover {
  color: #f63330;
  transition: 0.2s ease-out;
  box-shadow: -10px -10px 15px rgba(255, 255, 255, 0.9),
    10px 10px 15px rgba(70, 70, 70, 0.2);
}

footer {
  margin-top: auto;
}
footer p {
  padding-top: 1rem;
  padding-bottom: 1rem;
  text-align: center;
  color: #222;
}

@media (max-width: 400px) {
  footer p {
    font-size: 0.8rem;
  }
}

/* landscape mode */

@media (max-height: 536px) {
  h1 {
    margin-top: 10vh;
    margin-bottom: 8vh;
  }
  .container {
    padding: 40px 0 40px;
  }
}
@media (max-height: 470px) {
  h1 {
    margin-top: 6vh;
    margin-bottom: 4vh;
  }
}
@media (max-height: 410px) {
  .container {
    padding: 30px 0 30px;
  }
  .roll {
    margin-top: 3rem;
    padding: 8px 18px;
    font-size: 1rem;
    font-weight: 600;
  }
}
