@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 {
  --Scissors-Gradient1: hsl(40, 84%, 53%);
  --Scissors-Gradient2: hsl(39, 87%, 39%);
  --Paper-Gradient1: hsl(230, 89%, 65%);
  --Paper-Gradient2: hsl(230, 62%, 53%);
  --Rock-Gradient1: hsl(349, 70%, 56%);
  --Rock-Gradient2: hsl(349, 68%, 41%);
  --Lizard-Gradient1: hsl(261, 72%, 63%);
  --Lizard-Gradient2: hsl(261, 57%, 49%);
  --Spock-Gradient1: hsl(189, 58%, 57%);
  --Spock-Gradient2: hsl(189, 57%, 40%);

  --Dark-Text: hsl(229, 25%, 31%);
  --Score-Text: hsl(229, 64%, 46%);
  --Header-Outline: hsl(217, 16%, 45%);
  --Animation: #ffffff12;

  --Backgroud-Gradient: hsl(214, 47%, 23%), hsl(237, 49%, 15%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;

  transition: 0.2s all ease-in-out;
  font-family: "Barlow Semi Condensed", serif;

  user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

body {
  background: radial-gradient(
    ellipse at top,
    hsl(214, 47%, 23%),
    hsl(237, 49%, 15%)
  );
  background-repeat: no-repeat;
  height: 100vh;
  height: 100dvh;
  max-height: calc(100dvh - 2vmin);
  max-width: 100vw;
  position: relative;
}

/* Nav Start */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;

  margin-top: 2vmin;
  border: 0.4vmin solid var(--Header-Outline);
  padding: 1.5vmin 2vmin;
  border-radius: 1.5vmin;

  width: 80vw;
  max-width: 80vmin;
  max-height: 30vmin;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
nav img.logo {
  height: 100%;
  max-height: 15vmin;
}
nav button.score {
  background: #fff;
  border-radius: 1.5vmin;

  border: none;
  padding: 1rem;
  height: 13vmin;
  width: 17vmin;
  cursor: pointer;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-transform: uppercase;
  font-size: 2vmin;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--Score-Text);
}
nav button.score span {
  font-size: 5vmin;
  font-weight: 700;
  color: var(--Dark-Text);

  position: relative;
}
nav button.score span::after {
  content: "+1";
  position: absolute;
  right: -3vmin;
  bottom: -1vmin;
  color: rgb(39, 121, 14);

  font-size: 2.5vmin;
  opacity: 0;
}
nav button.score span.add::after {
  animation: score 1.8s ease-in-out infinite;
}
@keyframes score {
  0% {
    transform: translateY(0);
    opacity: 0;
    right: -3vmin;
    bottom: -1vmin;
  }
  10% {
    opacity: 1;
  }
  98% {
    transform: translateY(-80%);
  }
  100% {
    transform: translateY(-90%);
    opacity: 1;
    right: -3vmin;
    bottom: -1vmin;
  }
}
/* Nav End */

/* Main Start */
main {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 20vmin;
}
main section#action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
main section#action img {
  width: 50vmin;
}
main section#action button.action {
  position: absolute;
  border-radius: 50%;
  width: 20vmin;
  height: 20vmin;

  display: flex;
  align-items: center;
  justify-content: center;

  box-sizing: content-box;
  border: 3vmin solid #ff0;

  cursor: pointer;
}
main section#action button.action:disabled {
  background: #fff;
}
main section#action button.action:hover {
  scale: 1.04;
}

main section#action button img {
  width: 10vmin;
  transition: 0s;
}
main section#action button#paper {
  top: -10vmin;
  left: -10vmin;
  border-color: var(--Paper-Gradient1);
  box-shadow: inset 0 0.5vmin 0 0.5vmin rgba(165, 163, 163, 0.414),
    0 0.5vmin 0 0.6vmin var(--Paper-Gradient2);
}
main section#action button#scissor {
  top: -10vmin;
  right: -10vmin;
  border-color: var(--Scissors-Gradient1);
  box-shadow: inset 0 0.5vmin 0 0.5vmin rgba(165, 163, 163, 0.414),
    0 0.5vmin 0 0.6vmin var(--Scissors-Gradient2);
}
main section#action button#rock {
  bottom: 0.8vmin;
  left: 50%;
  transform: translateX(-50%);

  border-color: var(--Rock-Gradient1);
  box-shadow: inset 0 0.5vmin 0 0.5vmin rgba(165, 163, 163, 0.414),
    0 0.5vmin 0 0.6vmin var(--Rock-Gradient2);
}
main section#action button#rock:hover {
  transform: translate(-50%, -4%);
}
main section#action button.hide {
  display: none !important;
}
main section#action button#lizard {
  left: -5vmin;
  bottom: -12vmin;
  border-color: var(--Lizard-Gradient1);
  box-shadow: inset 0 0.5vmin 0 0.5vmin rgba(165, 163, 163, 0.414),
    0 0.5vmin 0 0.6vmin var(--Lizard-Gradient2);
}
main section#action button#spock {
  top: 3vmin;
  left: -12vmin;

  border-color: var(--Spock-Gradient1);
  box-shadow: inset 0 0.5vmin 0 0.5vmin rgba(165, 163, 163, 0.414),
    0 0.5vmin 0 0.6vmin var(--Spock-Gradient2);
}
section#action.advance button#paper {
  top: 3vmin;
  right: -12vmin;
  left: auto;
}
section#action.advance button#scissor {
  top: -16vmin;
  left: 50%;
  transform: translateX(-50%);
}
section#action.advance button#scissor:hover {
  transform: translate(-50%, -4%);
}
section#action.advance button#rock {
  left: auto;
  right: -5vmin;
  bottom: -12vmin;
  transform: translate(0, 0);
}

/* Main End */

/* Bottom Controller */
section.controller {
  display: flex;
  justify-content: space-between;
  align-items: center;

  position: fixed;
  bottom: 3vmin;
  padding-inline: 2.7vmin;
  width: 100vw;
}
section.controller div {
  display: flex;
  gap: 0.6rem;
}
section.controller button {
  cursor: pointer;

  color: #fff;
  background: transparent;
  border: 2px solid var(--Header-Outline);
  border-radius: 5px;

  display: flex;
  align-items: center;
  justify-content: center;

  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.2rem 1rem;

  font-size: 3vmin;
}
section.controller div button#rules {
  cursor: help;
}
section.controller button:disabled {
  cursor: not-allowed;

  opacity: 0.4;
}
section.controller button:hover {
  background: #ffffff2a;
}

/* Rules Start */
main section#rules {
  position: fixed;
  top: 0;
  left: 0;

  z-index: 8;

  width: 100vw;

  height: 100vh;
  height: 100dvh;

  display: flex;
  align-items: center;
  justify-content: center;
}
main section#rules .close-rules {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: -1;

  background: #000000a9;
}
main section#rules div.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: #fff;
  padding: 1rem;
  border-radius: 10px;

  animation: popup 0.2s linear alternate;
  opacity: 1;
  transform: translateY(0%);
  display: block;
}
main section#rules div div.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
main section#rules div div.header h1 {
  color: var(--Dark-Text);
  text-transform: uppercase;
  letter-spacing: 1px;

  font-size: 4vmin;
}
main section#rules div div.header img {
  cursor: pointer;

  width: 4vmin;
}
main section#rules div img.rules-img {
  width: 50vmin;
  margin-top: 5vmin;
}

main section#rules.hide {
  visibility: hidden;
}
main section#rules.hide div.wrapper {
  animation: popup-hide 0.2s linear alternate;
  opacity: 0;
  transform: translateY(100%);
  display: none;
}
main section#rules.hide div.close-rules {
  background: none;
  display: none;
}

/* House */
main section#action button.house {
  position: absolute;
  border-radius: 50%;
  width: 20vmin;
  height: 20vmin;

  display: flex;
  align-items: center;
  justify-content: center;

  box-sizing: border-box;
  border: 3vmin solid rgba(49, 49, 11, 0);
  background: #00000039;
  cursor: progress;

  top: 10%;
  right: -5%;
  transform: translateY(3vmin);
  scale: 0;
}
main section#action button.house.animate {
  animation: house 1.5s linear alternate;
}
main section#action button.house::before,
main section#action button.action.show::before {
  content: "You Picked";

  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  font-size: 2.5vmin;
  color: #fff;

  top: -70%;
  position: absolute;
  text-wrap: nowrap;
}
main section#action button.house::before {
  content: "The House Picked";
  top: -125%;
}
main section#action button.house.animate::before {
  animation: house-reverse 1.5s linear alternate;
}
main section#action button.house.show::before {
  top: -70%;
}
@keyframes house {
  0%,
  100% {
    transform: translateY(0);
  }
  20% {
    transform: translateY(1vmin);
  }
  40% {
    transform: translateY(-1vmin);
  }
  60% {
    transform: translateY(1vmin);
  }
  80% {
    transform: translateY(-1vmin);
  }
}
@keyframes house-reverse {
  0%,
  100% {
    top: -125%;
  }
  20% {
    top: calc(-100% - 1vmin);
  }
  40% {
    top: calc(-100% + 1vmin);
  }
  60% {
    top: calc(-100% - 1vmin);
  }
  80% {
    top: calc(-100% + 1vmin);
  }
}
/* House */

/* Winner Popup Start */
.winner-popup {
  position: absolute;
  top: 20%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  scale: 1;
}
.winner-popup h2 {
  text-transform: uppercase;
  color: #fff;
  font-size: 5.05vmin;
  font-weight: 600;
  letter-spacing: 1px;
}
.winner-popup button {
  padding: 1.5vmin 5vmin;
  border-radius: 1vmin;
  font-size: 2vmin;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(200, 2, 2, 0.816);
  margin-top: 2vmin;
  font-weight: 700;

  border: none;
  cursor: pointer;
}
.winner-popup.hide {
  scale: 0;
}
/* Winner Popup End */

@keyframes popup {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0%);
  }
}

@keyframes popup-hide {
  from {
    opacity: 1;
    transform: translateY(0%);
    display: block;
  }
  to {
    opacity: 0;
    transform: translateY(100%);
    display: none;
  }
}
/* Rules End */

/* Winner Animation */
button.action span,
button.house span {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  top: 0;
  left: 0;
}
button.action.winner,
button.house.winner {
  animation: winner 1.5s linear alternate;
  position: relative;
}
button.action.winner::after,
button.house.winner::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  top: 0;
  left: 0;

  animation: winner 1.5s linear alternate;
  animation-delay: 0.2s;
}
button.action.winner span,
button.house.winner span {
  animation: winner 1.5s linear alternate;
  animation-delay: 0.6s;
}

@keyframes winner {
  0% {
    box-shadow: 0 0 0 0 var(--Animation);
  }
  90% {
    box-shadow: 0 0 0 20vmin var(--Animation);
  }
  100% {
    box-shadow: 0 0 0 20vmin #00000000;
  }
}

@media screen and (width > 700px) {
  section#action.advance {
    scale: 0.8;
    margin-top: -8vmin;
  }
}
@media screen and (width < 700px) {
  main section#action {
    position: fixed;
    top: 50%;
    transform: translateY(-30%);
  }

  main section#rules.hide div.wrapper {
    width: 0;
    height: 0;
    border-radius: 50%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    display: flex;
    visibility: hidden;
    opacity: 0;
  }
  main section#rules div.wrapper {
    transition: 1s all !important;
    border-radius: 50%;

    width: 100vw;
    height: 100vh;
    height: 100dvh;
    top: 0 !important;
    left: 0 !important;
    transform: 0 !important;
    border-radius: 0;
    opacity: 1;
  }
  main section#rules img.rules-img {
    position: relative;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  main section#rules .close-rules {
    display: none;
  }
}
