@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300..700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
  user-select: none !important;
  -ms-user-select: none !important;
  -moz-user-select: none !important;
  -webkit-user-select: none !important;
}

html {
  font-size: 62.5%;
  box-sizing: border-box;
}

body {
  font-family: 'Sora', sans-serif;
  font-weight: 500;
  height: 100vh;
  color: #333;
  /* background-image: linear-gradient(to top left, #753682 0%, #bf2e34 100%); */
  background: url(https://images.unsplash.com/photo-1542273917363-3b1817f69a2d)
    no-repeat center center;
  background-size: cover;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* LAYOUT */

h1 {
  margin-bottom: 4rem;
  font-size: 10rem;
}

svg {
  width: 100%;
  height: 100%;
}

main {
  position: relative;
  width: 100rem;
  height: 60rem;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(20px);
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}

.winning {
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.winning .wins {
  padding: 1rem 2rem;
  border-radius: 4rem;
  background-image: linear-gradient(to bottom right, #ff5722, #e21d60);
}

.player {
  flex: 50%;
  padding: 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.75s;
}

/* ELEMENTS */

.name {
  position: relative;
  font-size: 4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  word-spacing: 2px;
  font-weight: 300;
  margin-bottom: 1rem;
}

.score,
.trophy {
  font-size: 8rem;
  font-weight: 300;
  color: #e21d60;
  margin-bottom: auto;
}

.player._active {
  background-color: rgba(255, 255, 255, 0.5);
}
.player._active .name {
  font-weight: 700;
}
.player._active .score {
  font-weight: 500;
}

.player._active .current {
  opacity: 1;
}

.current {
  background-color: #e21d60;
  border-radius: 10px;
  color: #fff;
  width: 50%;
  padding: 2rem;
  text-align: center;
  transition: all 0.75s;
}

.current-label {
  text-transform: uppercase;
  margin-bottom: 1rem;
  font-size: 1.7rem;
  color: #ddd;
}

.current-score {
  font-size: 3.5rem;
}

/* ABSOLUTE POSITIONED ELEMENTS */

.btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  color: #444;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.8rem;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 400;
  transition: all 0.2s;

  background-color: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);

  padding: 1rem 2.5rem;
  border-radius: 50rem;
  box-shadow: 0 1.75rem 3.5rem rgba(0, 0, 0, 0.1);
}

.btn::first-letter {
  font-size: 2.4rem;
  display: inline-block;
  margin-right: 0.7rem;
}

.btn-reset {
  top: 4rem;
}
.btn-roll {
  top: 39.3rem;
}
.btn-hold {
  top: 46.1rem;
}

.btn:active {
  transform: translate(-50%, 3px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.btn:focus {
  outline: none;
}

.disabled {
  pointer-events: none;
}

._winner .score {
  color: #138813;
}

._winner .current {
  background-color: #138813;
}

/* DICE STYLES */

.dice-gird {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  padding: 6rem;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 0 40px #ccc;
}

.dice {
  width: 100px;
  height: 100px;
  transform-style: preserve-3d;
  transition: all 0.5s ease;
}

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

.face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  border: 5px solid #f6f3f0;
  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: #dd0000;
  margin: -15px 0 0 -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 0 0 -36px;
  box-shadow: 26px 26px, 52px 52px, 52px 0, 0 52px;
}

.right::after {
  margin: -30px 0 0 -30px;
  box-shadow: 40px 0, 0 40px, 40px 40px;
}

.left::after {
  margin: -35px 0 0 -35px;
  box-shadow: 25px 25px, 50px 50px;
}

.text {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-dasharray: 40 180;
  stroke-dashoffset: 0;
  -webkit-animation: stroke 6s infinite linear;
  animation: stroke 6s infinite linear;
}
.text:nth-child(5n + 1) {
  stroke: #f2385a;
  -webkit-animation-delay: -1.2s;
  animation-delay: -1.2s;
}
.text:nth-child(5n + 2) {
  stroke: #f5a503;
  -webkit-animation-delay: -2.4s;
  animation-delay: -2.4s;
}
.text:nth-child(5n + 3) {
  stroke: #e9f1df;
  -webkit-animation-delay: -3.6s;
  animation-delay: -3.6s;
}
.text:nth-child(5n + 4) {
  stroke: #56d9cd;
  -webkit-animation-delay: -4.8s;
  animation-delay: -4.8s;
}
.text:nth-child(5n + 5) {
  stroke: #3aa1bf;
  -webkit-animation-delay: -6s;
  animation-delay: -6s;
}

@-webkit-keyframes stroke {
  100% {
    stroke-dashoffset: -220;
  }
}
@keyframes stroke {
  100% {
    stroke-dashoffset: -220;
  }
}
