@import url('https://fonts.googleapis.com/css2?family=Nunito&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  font-size: 62.5%;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  font-weight: 400;

  color: #333;
  background-image: linear-gradient(to top left, #e7e7e7 0%, #0e0e0e 100%);
}
main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.cta-link {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  z-index: 10;
  background-color: #333;
  padding: 1.5rem 3rem;
  border-radius: 20rem;
  color: white;
  text-decoration: none;
  font-size: 1.2rem;
}
/* LAYOUT */
.game-board {
  position: relative;
  width: 30rem;
  background-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(200px);
  filter: blur();
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.25);
  border-radius: 9px;
  display: flex;
  flex-direction: column;
}

.player {
  flex: 50%;
  padding: 2rem;
  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 {
  font-size: 5rem;
  font-weight: 300;
  color: #4b4b4b;
  margin-bottom: auto;
}

.player--active {
  background-color: rgba(255, 255, 255, 0.4);
}
.player--active .name {
  font-weight: 700;
}
.player--active .score {
  font-weight: 400;
}

.player--active .current {
  opacity: 1;
}

.current {
  background-color: #4b4b4b;
  opacity: 0.8;
  border-radius: 9px;
  color: #fff;
  width: 65%;
  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%);
  color: #444;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 1.4rem;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 400;
  transition: all 0.2s;
  background-color: white;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  padding: 0.7rem 2.5rem;
  max-width: 19rem;
  width: 100%;
  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;
}

.btn--new {
  bottom: 9rem;
}
.btn--roll {
  top: 39.3rem;
}

.btn--continue,
.btn--roll {
  top: 28rem;
  left: 100%;
  border-radius: 0;
  width: fit-content;
  padding: 1rem;
}

.btn--continue span,
.btn--roll span {
  display: none;
}
.btn--tutorial {
  bottom: 3rem;
}

.btn:active {
  transform: translate(-50%, 3px);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
}

.btn:focus {
  outline: none;
}

.message {
  position: absolute;
  top: 25rem;
  font-size: 8rem;
  font-weight: bolder;
  font-style: italic;
  text-transform: uppercase;
  animation: tilt-shaking 0.5s ease-in-out infinite;
}

.dice {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  height: 6rem;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.2);
  overflow: auto;
}

.dice-1 {
  top: 25.5rem;
}

.dice-2 {
  top: 32rem;
}

.player--winner {
  background-color: #006e06;
  color: #fff;
}

.player--winner .score {
  color: #fff;
}

.player--winner .name {
  font-weight: 700;
  color: #ffffff;
}

.hidden {
  display: none;
}

.overlay {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.432);
  width: 100vw;
  height: 100vh;
}

.modal {
  position: absolute;
  border-radius: 1rem;
  background-color: #fff;
  width: 30rem;
  height: 50rem;
  padding: 5rem;
  z-index: 5;
  overflow-y: scroll;
}

.modal-content {
  display: flex;
  flex-direction: column;
}

.close-modal {
  position: absolute;
  background: none;
  border: 1px solid;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  border-radius: 50%;
  top: 5%;
  right: 5%;
}

.close-modal:hover,
.overlay {
  cursor: pointer;
}

.modal h2 {
  font-size: 4rem;
  text-align: center;
  padding-bottom: 2rem;
}

.modal p {
  padding-bottom: 2rem;
  font-size: 1.5rem;
}

.modal p span {
  font-weight: bolder;
}

/* Tablet & Desktop */

@media screen and (min-width: 768px) {
  .btn {
    font-size: 1.6rem;
    max-width: 20.5rem;
    width: 100%;
  }

  .btn--new {
    top: 40rem;
    bottom: inherit;
  }

  .btn--continue,
  .btn--roll {
    top: 28rem;
    left: 50%;
    border-radius: 50rem;
    width: 100%;
    padding: 1rem;
  }

  .btn--continue span,
  .btn--roll span {
    display: inline-block;
  }
  .btn--roll {
    top: 39.3rem;
  }
  .btn--continue {
    top: 39.3rem;
  }
  .btn--tutorial {
    top: 46.1rem;
    bottom: initial;
  }

  .btn::first-letter {
    font-size: 2.4rem;
    display: inline-block;
    margin-right: 0.7rem;
  }

  .game-board {
    width: 100rem;
    height: 60rem;
    flex-direction: row;
    overflow: hidden;
  }

  .dice {
    position: absolute;
    height: 10rem;
    left: 50%;
  }

  .dice-1 {
    top: 12.5rem;
  }

  .dice-2 {
    top: 25.5rem;
  }

  .score {
    font-size: 8rem;
  }
  .player {
    padding: 9rem;
  }

  .modal {
    width: 60rem;
  }

  .close-modal {
    top: 5%;
    right: 2%;
  }
}

@media screen and (min-width: 992px) {
  .modal {
    width: 80rem;
  }
}

@media screen and (min-width: 1000px) {
  .cta-link {
    top: 5rem;
    right: 5rem;
  }
}

@keyframes tilt-shaking {
  0% {
    transform: rotate(2deg);
  }
  25% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(2deg);
  }
  75% {
    transform: rotate(-2deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
