@keyframes handShake {
  0%,100% { transform: rotate(10deg); }
  50% { transform: rotate(-10deg); }
}

@keyframes handShake2 {
  0%,100% { transform: rotateY(180deg) rotate(10deg); }
  50% { transform: rotateY(180deg) rotate(-10deg); }
}

*{
  box-sizing: border-box;
}

body{
  background: radial-gradient(circle at 50% 20%, hsl(214, 47%, 23%) , hsl(237, 49%, 15%));
  font-family: 'Barlow Semi Condensed', sans-serif;
  color: #fff;
  min-height: 100vh;
}

button:focus{
  outline: none;
}

h1 {
  margin: 0 0 10px;
}

.container{
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* HEADER SECTION */
header{
  border: 3px solid hsl(217, 16%, 45%);
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  padding: 20px;
  margin: 50px 0;
  align-items: center;
}

h4{
  color: hsl(229, 64%, 46%);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin: 0;
}

.score-container{
  background-color: #fff;
  border-radius: 10px;

  padding: 20px 30px;
  text-align: center;
}

.score-container p{
  color: hsl(229, 25%, 31%);
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0;
}

.score-wrapper{
  display: flex;
  justify-content: space-between;
  width: 60%;
}

/* Game Section (Before selection)*/
main{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  height: 350px;
  margin: 0 auto;
  position: relative;
  width: 100%;
  max-width: 400px;
}

main::before{
  background-image: url(../images/bg-triangle.svg);
  background-repeat: no-repeat;
  background-size: cover;
  content: '';
  position: absolute;
  top: 20%;
  right: 15%;
  height: 70%;
  width:70%;
  z-index: -1;
}

.btn-circle{
  border: none;
  border-radius: 50%;
  box-shadow: inset 0 -5px rgba(0,0,0,0.15);
  cursor: pointer;
  margin: 0 25px;
  height: 150px;
  width: 150px;
}

.btn-circle:active{
  transform: scale(0.9);
}

.wrapper{
  background-color: #fff;
  border-radius: 50%;
  box-shadow: inset 0 5px rgba(0,0,0,0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  width: 120px;
}

.btn-paper{
  background: linear-gradient(to bottom, hsl(230, 89%, 62%), hsl(230, 89%, 65%));
}

.btn-scissors{
  background: linear-gradient(to bottom, hsl(39, 89%, 49%), hsl(40, 84%, 53%));
}

.btn-rock{
  background: linear-gradient(to bottom, hsl(349, 71%, 52%), hsl(349, 70%, 56%));
}

.btn-rules{
  background: transparent;
  border: 1px solid #fff;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 2px;
  padding: 10px 25px;
  position: fixed;
  right: 30px;
  bottom: 30px;
  text-transform: uppercase;
}

/* Game Section (After selection)*/
.selection{
  display: none;
  grid-template-areas: "user result computer";
  justify-content: space-between;
  align-items: center;
  text-align: center;
  width: 800px;
  max-width: 100%;
  margin: 0 auto;
}

.user_choice{
  grid-area: user;
}

.computer_choice{
  grid-area: computer;
}

.result-text{
  grid-area: result;
}

.selection h2{
  font-size: 17px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.selection h1{
  font-size: 3rem;
  letter-spacing: 2px;
  margin: 0 0 20px;
  text-transform: uppercase;
}

.selection .btn-circle{
  margin: 50px;
  transform: scale(1.2);
}

.btn-reset{
  background-color: #fff;
  border: 1px solid #fff;
  border-radius: 5px;
  color: hsl(229, 25%, 31%);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 10px 40px;
  text-transform: uppercase;
}

.btn-reset:hover{
  color: red;
}

/* Rules Window */
.rules-container{
  position: fixed;
  display: none;
  top:0;
  left: 0;
  background-color: rgba(0,0,0,0.5);
  height: 100vh;
  width: 100vw;
  z-index: -1;
}

.rules-modal{
  background-color: #f0f0f0;
  border-radius: 5px;
  display:none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translate(-50%, 0);
  height: 450px;
  width: 400px;
  z-index: 2;
}

.rules-modal button{
  background-color: transparent;
  border: none;
  cursor: pointer;
  margin-top:80px;
  transform: scale(1.5);
}

.attribution{
  text-align: center;
  margin-top: 5%;
}

.animation {
  display: none;
}

#hands {
  text-align: center;
}

.hand {
  margin: 20px;
  width: 200px;
  height: 200px;
  position: relative;
  transform: rotate(10deg);
  display: inline-block;
  animation: handShake 1s infinite;
}

.hand > div {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid white;
  background: #0c0c1e;
  transition: all 0.1s;
}

.fist {
  height: 110px;
  left: 40px;
  top: 50px;
  width: 90px;
  border-radius: 20px 0 0 20px;
}

.finger {
  width: 70px;
  height: 30px;
  border-radius: 20px;
  left: 80px;
  transform-origin: 0 50%;
}

.finger-1 { top: 50px; --dif: 0px; }
.finger-2 { top: 78px; left: 84px; --dif: 4px; }
.finger-3 { top: 106px; --dif: 0px; }
.finger-4 { top: 134px; height: 26px; left: 76px; --dif: -8px; }

div.thumb {
  width: 35px;
  height: 70px;
  
  border-radius: 0 20px 20px 20px;
  top: 50px;
  left: 80px;
  border-left: 0 solid;
  box-shadow: -17px 6px 0 -15px white;
}

div.arm {
  width: 22px;
  height: 70px;
  left: 20px;
  top: 70px;
  border: 0;
  border-top: 2px solid white;
  border-bottom: 2px solid white;
}

#user-hand {
  transform: rotateY(180deg);
  animation: handShake2 1s infinite;
  position: relative;
}


/* MOBILE VIEW */
@media screen and (max-width:500px){

  body {
    min-height: unset;
  }

  header {
    flex-wrap: wrap;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .hand {
    width: 170px;
    margin: 0;
  }

  .btn-circle {
    margin: 10px;
  }

  .selection .btn-circle {
    transform: scale(1);
  }

  .score-wrapper {
    width: 100%;
  }

  .score-container {
    margin: 0 10px 0 0;
    width: 50%;
  }

  .selection .btn-circle {
    margin: 10px;
  }

  .selection{
    display: none;
    grid-template-areas: "user computer"
                         "result result"
  }

  .user_choice{
    grid-area: user;
  }

  .computer_choice{
    grid-area: computer;
  }

  .result-text{
    grid-area: result;
  }
}