@import url('https://fonts.googleapis.com/css2?family=Barlow+Semi+Condensed:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
  --dark-text: hsl(229, 25%, 31%);
  --score-text: hsl(229, 64%, 46%);
  --header-outline: hsl(217, 16%, 45%);
}

*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  font-size: 62.5%;
}

body {
  height: 100vh;
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 600;
  background: radial-gradient(at top, hsl(214, 47%, 23%) 15%, hsl(237, 49%, 15%) 70%);
  display: flex;
  /* align-items: center; */
  justify-content: center;
  padding: 6.4rem 2.4rem;
  position: relative;
}

/* HEADER STYLES */

.container {
  flex: 0 1 100rem;
  display: flex;
  flex-direction: column;
  gap: 4.8rem;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2.4rem;
  border: 3px solid var(--header-outline);
  border-radius: 11px;
}

.header__score-box {
  padding: 2.4rem 6.4rem;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9px;
}

.header__score {
  color: var(--score-text);
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header__point {
  font-size: 4.8rem;
  color: var(--dark-text);
}

/* MAIN GAME STYLES  */
.main {
  align-self: center;

  display: grid;
  background: url(../images/bg-triangle.svg) no-repeat center;
  /* background-size: contain; */
  grid-template-columns: repeat(2, min-content);
  column-gap: 9.6rem;
  row-gap: 2.4rem;
}

.main__paper,
.main__scissors,
.main__rock {
  width: 15rem;
  height: 15rem;
  background-color: #fff;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1.5rem solid;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.main__paper:active,
.main__scissors:active,
.main__rock:active {
  transform: scale(0.92);
  box-shadow: 0 0.3rem 0.6rem rgba(0, 0, 0, 0.2);
}

.main__paper {
  border-color: hsl(230, 89%, 62%);
  box-shadow: 0 0.7rem 1rem rgba(72, 101, 244, 0.3);
}

.main__scissors {
  border-color: hsl(39, 89%, 49%);
  box-shadow: 0 0.7rem 1rem rgba(236, 158, 14, 0.3);
}

.rock--grid {
  grid-column: 1 / 3;
  justify-self: center;
}

.main__rock {
  border-color: hsl(349, 71%, 52%);
  box-shadow: 0 0.7rem 1rem rgba(220, 46, 78, 0.3);
}

/* RULES STYLES */

.rule {
  align-self: flex-end;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.rule:active,
.you-win__btn:active {
  transform: scale(0.92);
}

.rule__text {
  text-align: end;
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  border: 2px solid var(--header-outline);
  border-radius: 9px;
  padding: 0.9rem 3.2rem;
}

/* WHEN A PLAYER WINS STYLES */
.main--win {
  margin: 3.2rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
}

/* WIN BACKGROUND PATTERN STYLE */
.win--container {
  position: relative;
}

.win--container::before {
  content: '';
  position: absolute;
  bottom: 0;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.05),
    /* 1st ring */ 0 0 0 90px rgba(255, 255, 255, 0.04),
    /* 2nd ring */ 0 0 0 120px rgba(255, 255, 255, 0.03);
  z-index: 0;
}

/* WIN BACKGROUND PATTERN ENDS */

.you-picked,
.you-win {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 1;
}

.you-picked__text {
  font-size: 3.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
}

.you-win__text {
  font-size: 4.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  text-align: center;
}

.you-win__btn {
  border: none;
  outline: none;
  background-color: #fff;
  color: var(--dark-text);
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 9px;
  padding: 1.2rem 4.8rem;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.3);
}

/* MODAL RULES STYLES  */
.hidden {
  display: none !important;
}

.modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  width: 25%;
  padding: 3.2rem;
  border-radius: 11px;

  margin: 0 auto;
  box-shadow: 0 3rem 5rem rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.modal__heading {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.modal__text {
  font-size: 2.4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dark-text);
  font-weight: 700;
}

.modal__close {
  cursor: pointer;
}

.modal__rule {
  width: 100%;
}

.img-rule {
  width: 100%;
}

/* overlay style */
.overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  z-index: 5;
}

/* 800px */
@media only screen and (max-width: 55em) {
  body {
    height: 100%;
  }

  .you-picked__text {
    text-align: center;
  }

  .rule {
    align-self: center;
  }

  .modal {
    width: 60%;
  }
}

/* MEDIA QUERY 550PX */
@media only screen and (max-width: 38.4em) {
  html {
    font-size: 50%;
  }

  .container {
    gap: 9.6rem;
  }

  .header {
    column-gap: 2rem;
  }

  .header__img {
    width: 16rem;
  }

  .header__score-box {
    padding: 2.4rem 4.8rem;
  }

  .main--win {
    align-self: center;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 4.8rem;
    row-gap: 9.6rem;
  }

  .you-win {
    grid-row: 2 / 3;
    grid-column: 1 / 3;
    justify-self: center;
  }

  .you-picked__text {
    text-align: center;
    order: 1;
    font-size: 2.4rem;
  }

  .you-win__text {
    font-size: 6.4rem;
  }

  .you-win__btn {
    font-size: 2.4rem;
  }

  .rule {
    align-self: center;
  }

  .win--container::before {
    top: 0;
    box-shadow: 0 0 0 20px rgba(255, 255, 255, 0.05),
      /* 1st ring */ 0 0 0 40px rgba(255, 255, 255, 0.04),
      /* 2nd ring */ 0 0 0 50px rgba(255, 255, 255, 0.03);
  }

  .modal {
    width: 80%;
  }
}

/* 1750px */
@media only screen and (min-width: 109.4em) {
  body {
    height: 100%;
  }
  html {
    font-size: 75%;
  }
}
