:root {
  --color-light-green: #8CC461;
  --color-medium-green: #3B6720;
  --color-dark-green: #004429;
  --color-white: #fff;
  --color-dark: #222;
  --color-red: #f33636;

  --color-rock: #0074B6;
  --color-paper: #FFA943;
  --color-scissor: #BD00FF;

  --font: 'Roboto', sans-serif;
  --radius-md: 5px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

body {
  font-family: var(--font);
  background-color: var(--color-light-green);
  display: grid;
  place-content: center;
  color: var(--color-white);
  padding: 1rem;
}

h1,
h2,
h3 {
  line-height: 1;
}

/***********************/
/***** UTILITY CLASSES *****/
/************************/

.btn--play-again {
  background: none;
  border: none;
  font: inherit;
  font-size: 1.6rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
  background-color: var(--color-white);
  color: var(--color-dark);
  padding: 1rem 3rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}


/***********************/
/***** MAIN STYLING *****/
/************************/


.game {
  width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* GAME HEADER */

.game__header {
  border: 1px solid var(--color-white);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  height: 20vh;
}

.game__header h1 {
  font-size: 3rem;
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: .5rem;
}

.game__scores {
  display: flex;
  gap: 1rem;
}

.game__score {
  width: 12rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  background-color: var(--color-white);
  color: var(--color-dark);
  border-radius: var(--radius-md);
}

.game__score span:first-child {
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  opacity: .8;
}

.game__score span:last-child {
  font-size: 3rem;
  font-weight: 600;
}


/* GAME BODY */
.game__body {
  height: calc(80vh - 2rem);
}

/* PLAYER CHOICE DISPLAY */

.player-choice-display,
.choice-result-display,
.game-win-display {
  height: 100%;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choices {
  height: 22rem;
  width: 22rem;
  position: relative;
}

.choices::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url(./assets/bg-triangle.svg) no-repeat center center/cover;
  z-index: -1;
}

.choices__choice-rock {
  position: absolute;
  top: -15%;
  left: -20%;
}

.choices__choice-scissors {
  position: absolute;
  top: -15%;
  right: -15%;
}

.choices__choice-paper {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}


/* CHOICE RESULT DISPLAY */

.choice-result-display {
  display: none;
}

.result {
  align-self: center;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-around;
}

.result-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;

}

.message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

.message span:first-child {
  font-size: 6rem;
}

.message span:last-child {
  font-size: 3rem;
}

.player,
.computer {
  position: relative;
}

.player::before,
.computer::before {
  position: absolute;
  z-index: 10;
  top: -50%;
  text-transform: uppercase;
  font-size: 1.8rem;
  letter-spacing: 1px;
}

.player::before {
  content: 'You Picked';

}

.computer::before {
  content: 'PC Picked'
}

.winner-ring {
  position: relative;
  display: inline-block;
}

.winner-ring::after,
.result-winner::before,
.result-winner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-color: var(--color-medium-green);
  opacity: 0;
  z-index: -1;
  animation: ringPulse 3s infinite;
}

.winner-ring::after {
  animation-delay: 0s;
  scale: 1;
}

.result-winner::before {
  animation-delay: 1s;
  scale: 1.5;
}

.result-winner::after {
  animation-delay: 2s;
  scale: 2;
}

@keyframes ringPulse {
  from {
    scale: 1;
    opacity: 1;
  }

  to {
    scale: 2;
    opacity: 0;
  }
}

/* GAME WIN DISPLAY */

.game-win-display {
  display: none;
  height: calc(100vh - 2rem);
}

.winning-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
  text-transform: uppercase;
  font-weight: 600;
}

.winning-img img {
  width: 100%;
  object-fit: cover;
}

.winning-message h2 {
  font-size: 6rem;
  letter-spacing: 1rem;
}

.winning-message p {
  font-size: 4rem;
  letter-spacing: 2px;
}

/***********************/
/***** CHOICE ICON BOX STYLING *****/
/************************/

.choice {
  height: 12rem;
  width: 12rem;
  background: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}

/* this is for not to select img on click */
.choice::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.choice img {
  width: 50%;
}

.choice--ROCK {
  border: 10px solid var(--color-rock);
}

.choice--SCISSORS {
  border: 10px solid var(--color-scissor);
}

.choice--SCISSORS img {
  width: 30%;
}

.choice--PAPER {
  border: 10px solid var(--color-paper);
}


/***********************/
/***** FOOTER BUTTONS *****/
/************************/
.footer-buttons {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.btn-footer {
  font: inherit;
  font-size: 1.6rem;
  background: none;
  border: 2px solid var(--color-white);
  color: var(--color-white);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 1rem 3rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

#btn--next {
  display: none;
}

/***********************/
/***** RULES WINDOW *****/
/************************/

.rules-window {
  position: absolute;
  bottom: 8rem;
  right: 2rem;
  width: 25rem;
  border-radius: var(--radius-md);
  border: 5px solid var(--color-white);
  background-color: var(--color-dark-green);
  padding: 2rem 2rem 2rem 3rem;
  z-index: 200;
  display: none;
}

.rules-window h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
}

.rules-window ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rules-window ul li {
  font-size: 1.4rem;
  line-height: 1.6;
  position: relative;
}

.rules-window ul li::before {
  position: absolute;
  content: '';
  top: .6rem;
  left: -1.5rem;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background-color: var(--color-paper);
}

.btn-close {
  position: absolute;
  top: -1.8rem;
  right: -1.8rem;
  background: none;
  border: none;
  background-color: var(--color-red);
  color: var(--color-white);
  border: 3px solid var(--color-white);
  height: 4rem;
  width: 4rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 3rem;
}



/***********************/
/***** MEDIA QUERIES *****/
/************************/
/* 1000px */
@media(max-width:62.5em) {
  .game {
    width: 80rem;
  }
}

/* 800px */
@media(max-width:50em) {
  .game {
    width: 60rem;
  }
}

/* 600px */
@media(max-width:37.5em) {
  .game {
    width: 100%;
  }

  .game__header {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
  }

  .game__header h1 {
    font-size: 2.5rem;
    flex-direction: row;
    letter-spacing: 2px;
    gap: 2rem;
  }

  .game__scores {
    gap: 2rem;
  }

  .game__score span:first-child {
    font-size: 1.4rem;
  }

  .game__score span:last-child {
    font-size: 2rem;
  }

  .game__score {
    flex-direction: row;
    width: 100%;
  }

  .message span:first-child {
    font-size: 4rem;
  }

  .message span:last-child {
    font-size: 2rem;
  }

  .choice {
    height: 10rem;
    width: 10rem;
  }

  .btn--play-again {
    padding: 1rem;
  }
}

/* 430px */
@media(max-width:26.87em) {
  .message span:first-child {
    font-size: 3rem;
  }

  .message span:last-child {
    font-size: 1.8rem;
  }

  .btn--play-again,
  .btn-footer {
    font-size: 1.4rem;
  }

  .winning-img img {
    width: 80%;
  }

  .winning-message h2 {
    font-size: 4rem;
  }

  .winning-message p {
    font-size: 2rem;
  }
}