@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;
}

.btn {
  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: 0px 8px 15px rgb(0 0 0 / 10%);
  -webkit-box-shadow: 0px 8px 15px rgb(0 0 0 / 10%);
}

.player--active {
  background-color: #e3798e;
}

.player--active {
  background-color: rgba(255, 255, 255, 0.4);
}

.player--winner {
  background-color: #46ba0b;
}

.player--winner .name {
  font-weight: 700;
  color: #c7365f;
}

.player--active .name {
  font-weight: 700;
}

.player--active .score {
  font-weight: 400;
}

.player--active .current {
  opacity: 1;
}

/* MODAL STYLES */
.show-modal {
  font-size: 2rem;
  font-weight: 600;
  padding: 1.75rem 3.5rem;
  margin: 5rem 2rem;
  border: none;
  background-color: #fff;
  color: #444;
  border-radius: 10rem;
  cursor: pointer;
}

.close-modal {
  position: absolute;
  top: 1.2rem;
  right: 2rem;
  font-size: 5rem;
  color: #333;
  cursor: pointer;
  border: none;
  background: none;
}

.modal h1 {
  margin: 15px 0;
  font-size: 2.5rem;
}

.modal p {
  margin: 15px 0;
  font-size: 1.5rem;
}

/* CLASSES TO MAKE MODAL WORK */
.hidden {
  display: none;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70%;
  background-color: white;
  padding: 6rem;
  border-radius: 5px;
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.3);
  z-index: 99999;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 5;
}

/* END OF MODAL STYLES */

/* LAPTOP ABOVE SITE */

@media (min-width: 701px) {
  body {
    background-image: linear-gradient(to top left, #753682 0%, #bf2e34 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  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.5s;
    justify-content: center;
  }

  /* ELEMENTS */
  .name {
    position: relative;
    font-size: 4rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    word-spacing: 2px;
    font-weight: 300;
    margin-bottom: 1rem;
    text-align: center;
  }

  .score {
    font-size: 8rem;
    font-weight: 300;
    color: #c7365f;
    margin-bottom: auto;
  }

  .current {
    margin-top: 20px;
    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;
  }

  .score-label {
    display: none;
  }

  .current-score {
    font-size: 3.5rem;
  }

  /* ABSOLUTE POSITIONED ELEMENTS */
  .btn {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .btn::first-letter {
    font-size: 2.4rem;
    display: inline-block;
    margin-right: 0.7rem;
  }

  .btn--new {
    top: 3rem;
  }
  .btn--roll {
    bottom: 10rem;
  }
  .btn--hold {
    bottom: 3rem;
  }

  .btn:active {
    transform: translate(-50%, 3px);
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.15);
  }

  .btn:focus {
    outline: none;
  }

  .dice {
    position: fixed;
    left: 50%;
    top: 35%;
    transform: translateX(-50%);
    height: 10rem;
    box-shadow: 0px 8px 15px rgb(0 0 0 / 10%);
    -webkit-box-shadow: 0px 8px 15px rgb(0 0 0 / 10%);
  }
}

/* MOBILE SITE */
@media (max-width: 700px) {
  body {
    background-color: #ebd6dc;
    height: 100%;
    overflow: hidden;
  }

  .main {
    height: 100%;
  }

  .modal {
    width: 100%;
    padding: 3rem;
  }

  .btn {
    font-size: 1.5rem;
    padding: 1rem 2.5rem;
  }

  .btns-div {
    position: fixed;
    left: 0;
    padding: 15px 0;
    background-color: rgb(255, 255, 255);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 10%;
  }

  .btns-div.top {
    top: 0;
  }

  .btns-div.bottom {
    bottom: 0;
  }

  .btns-div button {
    margin: 0 10px;
    width: 45%;
  }

  .btn-new {
    position: fixed;
    top: 10px;
  }

  .dice {
    width: 80px;
    position: absolute;
    left: 50%;
    top: 44%;
    transform: translateX(-50%);
    box-shadow: 0px 8px 15px rgb(0 0 0 / 10%);
    -webkit-box-shadow: 0px 8px 15px rgb(0 0 0 / 10%);
    z-index: 999;
  }

  .player {
    transition: all 0.75s;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: column;
    text-align: center;
    position: fixed;
    left: 0;
    height: 40%;
    width: 100%;
    opacity: 0.3;
  }

  .player--1 {
    top: 10%;
  }

  .player--2 {
    bottom: 10%;
  }

  .player--active {
    background-color: #f39bb7;
    opacity: 1;
  }

  .player--winner {
    opacity: 1 !important;
  }

  .player .name {
    font-size: 3.5rem;
    text-transform: uppercase;
  }

  .score-div,
  .current {
    display: flex;
    align-items: center;
    font-size: 1.75rem;
  }

  .current-label,
  .score-label {
    margin-right: 5px;
    text-transform: uppercase;
  }

  .current {
    background: #c7365f;
    color: white;
    padding: 5px 15px;
    border-radius: 2em;
    margin: 10px 0 0 0;
    text-transform: uppercase;
    position: absolute;
    top: 0px;
    right: 10px;
    font-size: 1.25rem;
    box-shadow: 0px 8px 15px rgb(0 0 0 / 10%);
    -webkit-box-shadow: 0px 8px 15px rgb(0 0 0 / 10%);
  }

  .score-div {
    border-radius: 2em;
    font-size: 7rem;
    text-transform: uppercase;
  }

  .score {
    color: #c7365f;
  }

  .current-label {
    font-size: 1.25rem;
  }

  .current-score {
    font-size: 2rem;
  }
}

@media (max-width: 321px) {
  .modal,
  .overlay {
    display: none;
  }

  .btn {
    font-size: 1.25rem;
  }

  .dice {
    width: 65px;
  }

  .player .name {
    font-size: 2.5rem;
  }

  .score-div {
    font-size: 5.5rem;
  }

  .current-label {
    font-size: 1rem;
  }

  .current-score {
    font-size: 1.75rem;
  }
}
