@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;
  height: 100vh;
  color: #333;
  background-image: linear-gradient(to top left, #753682 0%, #bf2e34 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LAYOUT */
main {
  position: relative;
  width: 100rem;
  height: 60rem;
  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;
  overflow: hidden;
  display: flex;
}

.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 {
  font-size: 8rem;
  font-weight: 300;
  color: #c7365f;
  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: #c7365f;
  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.8rem;
  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;
  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--new {
  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;
}

.dice {
  position: absolute;
  left: 50%;
  top: 16.5rem;
  transform: translateX(-50%);
  height: 10rem;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.2);
}

.player--winner {
  background-color: #2f2f2f;
}

.player--winner .name {
  font-weight: 700;
  color: #c7365f;
}

.game {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-items: top;
  justify-content: center;
}

.gameBtns div {
  font-size: 1.6rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
  background-color: white;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  padding: 0.6rem 2rem;
  border-radius: 50rem;
  color: #444;
  margin: -10rem 0 1rem 1rem;
}
.gameBtns:hover {
  box-shadow: 0 1.75rem 3.5rem rgba(0, 0, 0, 0.1);
}

.modal {
  position: absolute;
  z-index: 20;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 2rem;
  flex-direction: column;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}

.overlay {
  text-transform: uppercase;
  width: 70%;
  height: 70%;
  background-color: #dbb2c0;
  padding: 4rem 8rem 4rem 8rem;
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.6);
  border-radius: 2rem;
  overflow: auto;
}

.closeBtn {
  position: relative;
  margin-bottom: 1rem;
  color: #ddd;
  font-size: 5rem;
  cursor: pointer;
  transition: 0.1s;
  width: 7rem;
  height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.closeBtn:hover {
  scale: 1.1;
  box-shadow: 0 1.75rem 3.5rem rgba(0, 0, 0, 0.1);
  border-radius: 100%;
}

.overlay h2 {
  margin-bottom: 2rem;
  font-size: 4rem;
  text-align: center;
}

.loader {
  position: absolute;
  font-family: 'Nunito', sans-serif;
  font-weight: 400;
  height: 100%;
  width: 100%;
  color: #ffffff;
  background-image: linear-gradient(to top left, #753682 0%, #bf2e34 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.loader h1 {
  margin: 5rem;
  font-size: 3rem;
  font-family: inherit;
  border: 1px solid white;
  padding: 2rem;
  border-radius: 2rem;
  animation: headerAnim 2s ease 0s 1 normal forwards;
}

@keyframes headerAnim {
  0% {
    animation-timing-function: ease-in;
    opacity: 0;
    transform: scale(0);
  }

  38% {
    animation-timing-function: ease-out;
    opacity: 1;
    transform: scale(1);
  }

  55% {
    animation-timing-function: ease-in;
    transform: scale(0.7);
  }

  72% {
    animation-timing-function: ease-out;
    transform: scale(1);
  }

  81% {
    animation-timing-function: ease-in;
    transform: scale(0.8);
  }

  100% {
    animation-timing-function: ease-out;
    transform: scale(1);
  }
}
.one {
  width: 200px;
  height: 200px;
  background-image: url('dice-1.png');
  background-size: cover;
  background-position: center;
  margin: 5rem;
  animation: rollRight 3s ease 0s 1 normal forwards;
  border-radius: 1rem;
}

@keyframes rollRight {
  0% {
    opacity: 0;
    transform: translateX(360px) rotate(200deg);
  }

  100% {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
  }
}

.six {
  margin: 5rem;
  width: 200px;
  height: 200px;
  background-image: url('dice-6.png');
  background-size: cover;
  background-position: center;
  animation: rollLeft 3s ease 0s 1 normal forwards;
  border-radius: 1rem;
}

@keyframes rollLeft {
  0% {
    opacity: 0;
    transform: translateX(-360px) rotate(-200deg);
  }

  100% {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
  }
}

.start {
  display: flex;
  flex-direction: row;
  z-index: 15;
}

.start h1 {
  margin: -10rem 0 10rem -30rem;
  font-size: 8rem;
  font-family: inherit;
  border: 1px solid white;
  padding: 2rem;
  border-radius: 2rem;
  color: #ffffff;
}

.startFlex {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.startBtn {
  color: #444;
  font-size: 1.8rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
  background-color: white;
  background-color: rgba(255, 255, 255, 1);
  padding: 1rem 2rem;
  border-radius: 50rem;
  margin: -5rem 0 2rem -10rem;
}
.rulesBtn {
  color: #444;
  font-size: 1.8rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: 0.2s;
  background-color: white;
  background-color: rgba(255, 255, 255, 1);
  padding: 1rem 2rem;
  border-radius: 50rem;
  margin-left: -5rem;
}

.rulesBtn:hover {
  box-shadow: 0 1.75rem 3.5rem rgba(0, 0, 0, 0.1);
}
.startBtn:hover {
  box-shadow: 0 1.75rem 3.5rem rgba(0, 0, 0, 0.1);
}

.one0 {
  width: 100px;
  height: 100px;
  background-image: url('dice-1.png');
  background-size: cover;
  background-position: center;
  margin: 10rem 2rem 0 10rem;
  animation: rollRight0 3s ease 4s 1 normal forwards;
  border-radius: 1rem;
}

@keyframes rollRight0 {
  0% {
    opacity: 0;
    transform: translateX(360px) rotate(200deg);
  }

  100% {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
  }
}

.six0 {
  margin: 10rem -15rem 0 10rem;
  width: 100px;
  height: 100px;
  background-image: url('dice-6.png');
  background-size: cover;
  background-position: center;
  animation: rollLeft0 3s ease 4s 1 normal forwards;
  border-radius: 1rem;
}

@keyframes rollLeft0 {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(-200deg);
  }

  100% {
    opacity: 1;
    transform: translateX(-360px) rotate(0deg);
  }
}

.startQuit {
  display: flex;
  flex-direction: row;
  z-index: 15;
}

/* Dark Mode  */
body.dark-mode {
  color: #ffffff;
  background-image: linear-gradient(to top left, #646164 0%, #443e3e 100%);
}

body.dark-mode .gameBtns {
  background-color: #555;
  color: #fff;
}

body.dark-mode .player {
  background-color: #3a3a3a;
  color: #ffffff;
}

body.dark-mode .player--active {
  background-color: rgba(95, 95, 95, 0.87);
}

body.dark-mode .dice {
  background-color: #4a4a4a;
}
body.dark-mode .current {
  background-color: #4d494a;
  color: #fff;
}

body.dark-mode button {
  background-color: #555;
  color: #fff;
}

body.dark-mode .current-score {
  color: #b93636;
}
body.dark-mode .score {
  color: #fff;
}
body.dark-mode .loader {
  color: #ffffff;
  background-image: linear-gradient(to top left, #646164 0%, #443e3e 100%);
}

body.dark-mode .overlay {
  background-color: #3b3b3b;
}

.hidden {
  display: none;
}
