/**********************************************
*** GENERAL
**********************************************/

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

.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

body {
  /* background: linear-gradient(
    135deg,
    rgba(88, 158, 18) 0%,
    rgba(228, 163, 32, 1) 100%
  ); */

  background: -webkit-linear-gradient(
    315deg,
    rgb(32, 165, 228) 0%,
    rgba(88, 158, 18) 100%
  );

  background: linear-gradient(
    135deg,
    rgb(32, 165, 228) 0%,
    rgba(88, 158, 18) 100%
  );

  background-size: cover;
  background-position: center;
  font-family: Lato;
  font-weight: 300;
  position: relative;
  height: 100vh;
  color: #555;
}

.header {
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  margin: 0 auto;
  overflow: hidden;
  padding: 44px 0;
  position: relative;
  width: 90%;
  max-width: 1000px;
}

.header .form-group label {
  font-size: 1.3em;
}

.title {
  color: #fff;
  display: inline-block;
}

nav ul {
  display: inline-block;
  margin-left: 45px;
}

nav ul li {
  color: #fff;
  display: inline-block;
  list-style-type: none;
}

nav ul li:not(:last-child) {
  margin-right: 20px;
}

nav ul li a {
  color: inherit;
  text-decoration: none;
}

nav ul li a .menuicon {
  display: none;
}

input {
  font-family: Lato;
}

.form-group label {
  color: #fff;
}

.form-group input {
  outline: none;
  display: inline-block;
  font-size: 1em;
  height: 33px;
  padding: 5px;
  width: 65px;
  margin-left: 8px;
  border: 2px solid #82de2b;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.3);
}

.form-group input:focus {
  border: 2px solid #f6ff45;
}

.wrapper {
  border-radius: 10px;
  background-color: #fff;
  box-shadow: 0px 10px 50px rgba(0, 0, 0, 0.3);
  margin: 0 auto 0;
  overflow: hidden;
  position: relative;
  width: 90%;
  max-width: 1000px;
}

.dice-turn {
  display: none;
  text-align: center;
  position: absolute;
  width: 100%;
  left: 0;
  top: 70px;
}

.dice-emote {
  display: block;
  font-size: 2.3em;
  -webkit-transform: translatey(0px);
  transform: translatey(0px);
  -webkit-animation: float 2s ease-in-out infinite;
  animation: float 2s ease-in-out infinite;
}

.dice-shadow {
  display: inline-block;
  width: 30px;
  height: 8px;
  top: -12px;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 50%;
  -webkit-animation: shadowfloat 2s ease-in-out infinite;
  animation: shadowfloat 2s ease-in-out infinite;
  position: relative;
}

.player-0-panel,
.player-1-panel {
  float: left;
  height: 570px;
  padding: 120px 30px 0;
  width: 50%;
  position: relative;
}

@-webkit-keyframes float {
  0% {
    -webkit-transform: translatey(0px);
    transform: translatey(0px);
  }
  50% {
    -webkit-transform: translatey(-20px);
    transform: translatey(-20px);
  }
  100% {
    -webkit-transform: translatey(0px);
    transform: translatey(0px);
  }
}

@keyframes float {
  0% {
    -webkit-transform: translatey(0px);
    transform: translatey(0px);
  }
  50% {
    -webkit-transform: translatey(-20px);
    transform: translatey(-20px);
  }
  100% {
    -webkit-transform: translatey(0px);
    transform: translatey(0px);
  }
}

@-webkit-keyframes shadowfloat {
  0% {
    width: 30px;
    height: 8px;
  }
  50% {
    width: 20px;
    height: 6px;
  }
  100% {
    width: 30px;
    height: 8px;
  }
}

@keyframes shadowfloat {
  0% {
    width: 30px;
    height: 8px;
  }
  50% {
    width: 20px;
    height: 6px;
  }
  100% {
    width: 30px;
    height: 8px;
  }
}

/**********************************************
*** PLAYERS
**********************************************/

.player-name {
  font-size: 40px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 100;
  margin-top: 20px;
  margin-bottom: 10px;
  position: relative;
}

/* .player-name::after {
  content: "🎲";
  font-size: 35px;
  position: absolute;
  color: #eb4d4d;
  top: -60px;
  left: 50%;
  transition: transform 0.2s ease-in-out;
  transform: translateX(-50%) scale(0);
  transform-origin: center;
} */

.player-score {
  text-align: center;
  font-size: 80px;
  color: #589e12;
  margin-bottom: 100px;
}

.active {
  background-color: #fffbf3;
}
.active .player-name {
  font-weight: 300;
}

.active .player-name:after {
  -webkit-transform: translateX(-50%) scale(1);
  transform: translateX(-50%) scale(1);
}

.active .dice-turn {
  display: block;
}

.player-current-box {
  background-color: #fff;
  color: #ae4918;
  width: 40%;
  min-width: 110px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0px 0px 6px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.player-current-label {
  background: #e4a320;
  text-transform: uppercase;
  margin-bottom: 0;
  font-size: 12px;
  color: #fff;
  padding: 4px;
  font-weight: normal;
}

.player-current-score {
  font-size: 30px;
  padding: 15px 0;
}

button {
  text-align: left;
  position: absolute;
  width: 173px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  color: #fff;
  background: #549e1d;
  border: none;
  padding: 3px 0;
  font-family: Lato;
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 300;
  -webkit-transition: all 0.3s;
  -webkit-transition: all 0.2s;
  transition: all 0.2s;
  box-shadow: 4px 5px 0px 1px rgba(0, 0, 0, 0.1);
}

button[disabled="disabled"] {
  background: #9a9a9a;
}

button:hover {
  box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0);
  margin-top: 2px;
  margin-left: 2px;
}

button:focus {
  outline: none;
}

i {
  color: #fff;
  display: inline-block;
  margin-right: 10px;
  font-size: 24px;
  line-height: 1;
  vertical-align: sub;
  height: 34px;
  width: 43px;
  text-align: center;
  padding-top: 5px;
  margin-left: 3px;
}

.btn-new {
  top: 25px;
}

.btn-roll {
  top: 424px;
}

.btn-roll.disable {
  pointer-events: none;
}

.btn-hold {
  top: 477px;
}

.dices-container {
  position: absolute;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  width: 100px;
  top: 60px;
}

.dice {
  background-color: #fff;
  height: 100px;
  box-shadow: 0px 10px 60px rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  -webkit-transform-origin: center;
  transform-origin: center;
  -webkit-transition: all 0.8s cubic-bezier(0, 0, 0, 0.99);
  transition: all 0.8s cubic-bezier(0, 0, 0, 0.99);
  margin: 40px 0 0;
}

.dice-1 {
  top: 128px;
}

.dice-2 {
  top: 248px;
}

.dicedots {
  display: none;
}

.dice-1[data-value="1"] .d1,
.dice-1[data-value="2"] .d2,
.dice-1[data-value="3"] .d3,
.dice-1[data-value="4"] .d4,
.dice-1[data-value="5"] .d5,
.dice-1[data-value="6"] .d6,
.dice-2[data-value="1"] .d1,
.dice-2[data-value="2"] .d2,
.dice-2[data-value="3"] .d3,
.dice-2[data-value="4"] .d4,
.dice-2[data-value="5"] .d5,
.dice-2[data-value="6"] .d6 {
  display: block;
}

.winner {
  background-color: #f7f7f7;
}

.winner .player-name {
  font-weight: 300;
  color: #eb4d4d;
}

.winner .player-name:after {
  content: "🎉";
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  position: absolute;
  left: 50%;
  top: -70px;
}

.new-game-win {
  /* display: none; */
  display: block;
  height: 100px;
  width: 100px;
  position: absolute;
  left: 50%;
  top: 120px;
  -webkit-transform: translateX(-50%) scale(1);
  transform: translateX(-50%) scale(1);
  -webkit-transition: all 0.25s ease-out;
  transition: all 0.25s ease-out;
}

.new-game-win:hover {
  cursor: pointer;
  -webkit-transform: translateX(-50%) scale(1.25);
  transform: translateX(-50%) scale(1.25);
}

.new-game-win:hover .rect {
  border-radius: 20px;
  -webkit-animation-play-state: running;
  animation-play-state: running;
}

.new-game-win .rect {
  -webkit-animation-play-state: paused;
  animation-play-state: paused;
  border-radius: 5px;
  display: block;
  height: 80px;
  width: 80px;
  -webkit-transform-origin: center;
  transform-origin: center;
  left: 10px;
  top: 0px;
  position: absolute;
  -webkit-transition: all 0.1s ease-out;
  transition: all 0.1s ease-out;
}

.rect-1 {
  background-color: rgba(84, 158, 29, 0.5);
  -webkit-animation: spin 3s linear infinite;
  animation: spin 3s linear infinite;
}

.rect-2 {
  background-color: rgba(228, 163, 32, 0.8);
  -webkit-animation: spin 3s linear infinite reverse;
  animation: spin 3s linear infinite reverse;
}

.new-game-win span {
  color: #fff;
  padding: 19px;
  display: block;
  position: absolute;
  text-align: center;
}

@-webkit-keyframes spin {
  100% {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes spin {
  100% {
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

#keybindings {
  text-align: center;
  padding-top: 20px;
  font-size: 0.8em;
}

#keybindings .key-command {
  text-transform: uppercase;
  font-size: 0.8em;
  border-radius: 5px;
  border: 1px solid #fff;
  padding: 2px 10px;
}

#keybindings .key-set:not(:last-child) {
  margin-right: 30px;
}

#keybindings .key-set {
  color: #fff;
}

.lightbox-how-to-play {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0, 0, 0, 0.2);
  display: none;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: start;
  -ms-flex-align: start;
  -ms-grid-row-align: flex-start;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
}

.lightbox-how-to-play .lightbox-desc {
  background: #fff;
  border: 5px solid #000;
  padding: 40px 35px;
  margin-top: 100px;
  width: 55%;
  max-width: 1055px;
  min-width: 320px;
}

.lightbox-how-to-play .lightbox-desc ul {
  padding-left: 20px;
  margin-top: 20px;
  line-height: 1.7em;
  font-weight: 600;
}

.lightbox-how-to-play .lightbox-desc ul li {
  margin-bottom: 15px;
}

.lightbox-how-to-play:target {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

/**********************************************
*** RESPONSIVE
**********************************************/

@media (max-width: 768px) {
  .header {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    padding: 25px 0 18px;
  }

  .header .title {
    font-size: 1.4em;
    margin-bottom: 14px;
  }

  .header nav {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    width: 100%;
  }

  nav ul {
    margin-left: 0;
    margin-bottom: 18px;
  }

  nav ul li:not(:last-child) {
    margin-right: 0;
  }

  nav ul li a .maintext {
    display: none;
    margin: 0;
  }

  nav ul li a .menuicon {
    display: block;
    margin: 0;
  }

  .form-group {
    margin-top: 5px;
  }

  .wrapper {
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: inherit;
    padding-bottom: 10px;
  }

  .player-0-panel,
  .player-1-panel {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0px 10px 50px rgba(0, 0, 0, 0.3);
    float: none;
    height: auto;
    padding: 30px 30px 25px;
    width: 100%;
  }

  .active {
    background-color: #fffbf3;
  }

  .player-0-panel {
    margin-bottom: 15px;
  }

  .dice-turn {
    width: auto;
    left: 15px;
    top: 25px;
  }

  .player-name {
    font-size: 30px;
    margin-top: 0;
  }

  .player-score {
    font-size: 50px;
    margin-bottom: 11px;
  }

  .player-current-box {
    background-color: transparent;
    box-shadow: none;
    width: auto;
    min-width: auto;
    margin: 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .player-current-label {
    background-color: #23a5dc;
    font-size: 13px;
    padding: 7px 8px;
    font-weight: 500;
  }

  .player-current-score {
    font-size: 18px;
    font-weight: 700;
    padding: 3px 15px;
    background: #fff;
    border: 1px solid #23a5dc;
  }

  .main-commands {
    padding-top: 22px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
  }

  button {
    background-color: #e4a320;
    position: relative;
    -webkit-transform: none;
    transform: none;
    left: 0;
    width: 140px;
  }

  button i {
    margin-right: 0;
    width: 33px;
  }

  .btn-roll,
  .btn-hold {
    top: 0;
  }

  .winner .player-name:after {
    left: 8px;
    top: -6px;
  }

  .dices-container {
    top: 92px;
    left: 100%;
    -webkit-transform: translateX(-80%) scale(0.6);
    transform: translateX(-80%) scale(0.6);
    width: auto;
  }

  .dices-container .dice {
    margin: 10px 30px;
  }

  .new-game-win {
    left: 87%;
  }

  #keybindings {
    display: none;
  }

  .lightbox-how-to-play .lightbox-desc {
    font-size: 0.9em;
    margin-top: 70px;
    padding: 28px;
  }
}

@media (max-width: 425px) {
  .dices-container {
    -webkit-transform: translateX(-65%) scale(0.5);
    transform: translateX(-65%) scale(0.5);
  }
}
