/*///////////////////////////////Reset/////*/

*,
*::after,
::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  list-style: none;
}

/*/ //////////////////////////////Variables/////*/

:root {
  --radial-gradient: radial-gradient(
    circle at 24.1% 68.8%,
    rgb(7, 7, 7) 0%,
    rgb(0, 0, 0) 99.4%
  );
  --radial-gradient-tools: radial-gradient(
    circle at 35% 65%,
    rgb(5, 5, 7) 0%,
    rgb(51, 58, 66) 99.4%
  );
  --linear-gradient-main: linear-gradient(to bottom right, #050507, #333a42);

  --clr-pink: rgb(254, 139, 153);
  --clr-pink-dark: rgb(255, 109, 126);
  --clr-grey: rgb(137, 148, 160);
  --clr-grey-2: rgb(101, 105, 111);
  --clr-grey-3: rgb(134, 145, 156);
  --clr-grey-4: rgb(228, 234, 237);
  --clr-grey-5: rgb(51, 58, 66);
  --clr-red: rgb(171, 1, 1);
  --clr-pink-dark: rgb(167, 40, 55);

  --clr-primary: rgb(227, 49, 29);
  --clr-primary-dark: rgb(62, 1, 1);

  --clr-grey-dark: rgb(54, 46, 45);
  --clr-grey-light-1: #aaaca1;
  --clr-grey-light-2: #7c8685;

  --clr-light: rgb(249, 237, 249);
  --clr-white: #fff;

  --clr-black: #050507;
  --clr-black-1: #111111;

  --button-shadow-hover: 0 8px 25px rgb(227, 49, 29, 08);
  --button-shadow-active: 0 5px 10px rgb(227, 49, 29, 0.6);
  --box-shadow: 0 10px 20px rgb(227, 49, 29, 08);
  --box-shadow-main: 0 10px 20px rgb(17, 17, 17, 07);

  --opacity: 0.8;
}

/*///////////////////////////////Animations/////*/

@keyframes appearing {
  0% {
    opacity: 0;
  }

  10% {
    opacity: 0.1;
  }

  20% {
    opacity: 0.2;
  }

  40% {
    opacity: 0.4;
  }

  60% {
    opacity: 0.6;
  }

  80% {
    opacity: 0.8;
  }

  100% {
    opacity: 1;
  }
}

@keyframes moveInButton {
  0% {
    opacity: 0;
    transform: translatey(60px);
  }

  100% {
    opacity: 0.9;
    transform: translate(0);
  }
}

@keyframes scaling {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
    top: 19%;
    left: 37%;
  }

  70% {
    transform: scale(1.2);
    top: 19%;
    left: 37%;
  }

  100% {
    transform: scale(0.9);
    top: 19%;
    left: 37%;
  }
}

@keyframes pulsing-title {
  0% {
    transform: scale(0.9);
  }

  70% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(0.9);
  }
}

@keyframes pulsing-chance {
  0% {
    transform: scale(0.9) translateX(-50%);
  }

  70% {
    transform: scale(1) translateX(-50%);
  }

  100% {
    transform: scale(0.9) translateX(-50%);
  }
}
@keyframes color {
  0% {
    background-image: linear-gradient(
      to bottom right,
      var(--clr-grey),
      var(--clr-grey-2)
    );
  }
  50% {
    background-image: linear-gradient(
      to bottom right,
      var(--clr-pink),
      var(--clr-pink-dark)
    );
  }
  100% {
    background-image: linear-gradient(
      to bottom right,
      var(--clr-grey),
      var(--clr-grey-2)
    );
  }
}

/*/ //////////////////////////General styling/////////////////// */

html {
  font-size: 62.5%;
}

body {
  font-family: "Playpen Sans", "lato";
  font-size: 1.5rem;
  line-height: 1.6;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
}

/*//////////////////////////////// Headings Styling ////////////*/

.heading {
  font-family: "Creepster", "lato";
  text-transform: uppercase;
  background-image: linear-gradient(
    to bottom,
    var(--clr-primary),
    var(--clr-primary-dark)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke-width: 0.7px;
  -webkit-text-stroke-color: var(--clr-light);
}

.heading--primary {
  display: inline-block;
  font-size: 6rem;
  font-weight: 600;
  letter-spacing: 2rem;
  margin-bottom: 0.7rem;
}

.heading--secondary {
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.6rem;
  margin-bottom: 4rem;
  backface-visibility: hidden;
}

.appearing {
  animation: appearing 4s ease-in;
}

/*/ /////////////////////////////Buttons Styling//////////////////*/

a.btn:link,
a.btn:visited {
  text-decoration: none;
  padding: 0.5rem 2.5rem;
  border-radius: 100px;
  font-size: 1.8rem;
  font-weight: bold;
  text-transform: capitalize;
  background-color: var(--clr-black-1);
}

.btn__homepage {
  display: block;
  width: 35%;
  margin: 0 auto;
  position: relative;
  backface-visibility: hidden;
  animation: moveInButton 3s ease;
  transition: all 0.2s;
  color: var(--clr-primary);
  opacity: 0.9;
}

.btn__homepage:last-child {
  margin-top: 2.5rem;
}

.btn__homepage:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px var(--clr-primary);
}

.btn__homepage:active {
  outline: none;
  transform: translateY(-1px);
}

.btn-close.btn-close:link,
.btn-close.btn-close:visited {
  display: inline-block;
  padding: 0 0.5rem;
  border-radius: 2px;
  color: var(--clr-primary);
  text-transform: capitalize;
  position: absolute;
  top: 2.5rem;
  right: 2.5rem;
  font-size: 2.5rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  transition: all 0.2s;
}

.btn-close.btn-close:hover,
.btn-translate.btn-translate:hover {
  opacity: 0.8;
}

.btn-translate.btn-translate {
  display: inline-block;
  padding: 0.3rem 0.5rem;
  border-radius: 2px;
  position: absolute;
  top: 2.6rem;
  left: 2.5rem;
  background-color: var(--clr-black-1);
  color: var(--clr-primary);
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.btn-act {
  position: absolute;
  border-radius: 100px;
  border: none;
  padding: 0.8rem 4rem;
  background-color: var(--clr-pink);
  cursor: pointer;
  text-transform: uppercase;
  font-size: 1.5rem;
  color: var(--clr-grey-5);
  box-shadow: 0 10px 20px var(--clr-primary-dark);
  transition: all 0.2s;
}
.btn-shoot,
.btn-reset {
  top: 87%;

  left: 50%;
  transform: translateX(-50%);
}

.btn-roll {
  top: 77%;
  left: 50%;
  transform: translateX(-50%);
}

.btn-reset {
  padding: 0.8rem 2rem;
}
.btn-act:hover {
  transform: translate(-50%, -1px);
  box-shadow: 0 10px 20px var(--clr-primary);
}

/*//////////////////Intro PAGE styling//////////////////////////*/

.game__container-opening {
  width: 100vw;
  height: 100vh;
  background-image: radial-gradient(
      circle at 24.1% 68.8%,
      rgb(7, 7, 7, 0.3) 0%,
      rgb(0, 0, 0, 0.3) 99.4%
    ),
    url("/img/gun.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  position: relative;
  text-align: center;
}

/*/ ////////////////////// Game Homepage styles///////////////////*/

.game__container-opening > * {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.game__homepage {
  padding: 4rem;
}

.homepage__popup {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem;
  background-color: var(--clr-black);
  width: 50%;
  height: 80vh;
  border-radius: 5px;
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  box-shadow: var(--box-shadow);
  transition: all 0.3s;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  @supports (-webkit-backdrop-filter: blur(10px)) or
    (backdrop-filter: blur(10px)) {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
}
.homepage__popup:target {
  opacity: 1;
  visibility: visible;
}

.homepage__popup:target .popup__content {
  opacity: 1;
}

.popup__detail {
  color: var(--clr-grey-light-1);
  letter-spacing: 0.1rem;
  font-weight: 400;
}
.popup__detail--primary {
  display: block;
  font-family: "Creepster", "Montserrat";
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--clr-primary);
  text-align: center;
  margin-top: 3rem;
}

/*////////////////////// Main Page styles/////////////////////////////////////*/

.game__container-main {
  width: 100%;
  height: 100vh;
  border-radius: 5px;
  background-image: radial-gradient(
      circle at 24.1% 68.8%,
      rgb(7, 7, 7, 0.3) 0%,
      rgb(0, 0, 0, 0.3) 99.4%
    ),
    url("/img/gun.png");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
}

/*/ /////////////////////////////// Headings Styling ////////////*/

.player__title {
  font-size: 3rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--clr-red);
}

.player h3 {
  text-transform: uppercase;
  color: var(--clr-black-1);
  margin-bottom: 1.5rem;
}

/*////////////////////// Game Content styles//////////////////////*/

.game__content {
  width: 70%;
  max-width: 1200px;
  height: 50rem;
  display: flex;
  background-color: red;
  position: relative;
  border-radius: 5px;
  opacity: 0.9;
  animation: scaling 2s ease;
}

/*/ /////////////////////Timer////////////////////////////////////////*/

.timer__container {
  width: 17%;
  padding: 1.5rem 0;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background-image: radial-gradient(var(--clr-grey-5), var(--clr-black-1));
  border-bottom-right-radius: 50%;
  border-bottom-left-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.8;
}

.timer {
  font-size: 2rem;
  font-weight: 600;
  color: var(--clr-primary);
}

/*////////////////////// Player Container styles///////////////////*/

.player {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  width: 50%;
  background-image: linear-gradient(
    to bottom right,
    var(--clr-grey),
    var(--clr-grey-2)
  );
}

.player--active.player--active {
  background-color: #123b37;
  background-image: linear-gradient(
    to bottom right,
    var(--clr-grey-4),
    var(--clr-grey-3)
  );
}
.player--winner.player--winner {
  animation: color 2s ease-in infinite;
}

/*/ ///////////////////// Damage styles///////////////////*/

.damage__container {
  width: 50%;
}

.damage__bar {
  width: 100%;
  border: 1px solid var(--clr-primary);
  border-radius: 5px;
}

.damage__bar > * {
  background-image: linear-gradient(
    to right,
    var(--clr-primary),
    var(--clr-red)
  );

  border-radius: 5px;
  width: 100%;
}

.player-score {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.score {
  width: 60%;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score__text {
  font-weight: 600;
  border-bottom: 1px solid var(--clr-primary);
}

/*////////////////////// Game Tools styles///////////////////*/
.game__tools {
  width: 20rem;
  height: 20rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background-image: radial-gradient(var(--clr-grey-5), var(--clr-black-1));
  box-shadow: var(--box-shadow-main);
}

/*/ ///////////////////// Game Images styles//////////////////////*/

.dice {
  width: 4rem;
  position: absolute;
}

.dice--1 {
  top: 70%;
  left: 30%;
  transform: translate(-30%, -60%);
}

.dice--2 {
  top: 70%;
  left: 70%;
  transform: translate(-70%, -60%);
}

.gun {
  width: 9rem;
  position: absolute;
  top: 25%;
  left: 40%;
  transform: translate(-40%, -20%);
}

.rolling-chance {
  width: 5rem;
  height: 5rem;
  font-size: 1.8rem;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 16%;
  left: 49.9%;
  transform: translateX(-50%);
  border-radius: 50%;
  box-shadow: var(--box-shadow-main);
  background-color: var(--clr-pink);
  color: var(--clr-grey-5);
  opacity: 0.65;
  animation: pulsing-chance 2s infinite;
}

/* js style */

.hidden.hidden {
  display: none;
}

.starting-timer {
  width: 100%;
  height: 100vh;
  background-color: var(--clr-black);
  opacity: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-white);
  font-size: 5rem;
  font-weight: 700;
}

.ready-to-shoot {
  animation: pulse 2s infinite;
}

.btn-act:disabled {
  color: var(--clr-pink);
  background-color: var(--clr-grey-5);
}

.player--active h2 {
  animation: pulsing-title 2s infinite;
  color: var(--clr-primary);
  text-shadow: 4px 3px 0 #7a7a7a;
}

.player--active .player-score h3 {
  text-shadow: 1px 0px 1px #cccccc, 0px 1px 1px #eeeeee, 2px 1px 1px #cccccc,
    1px 2px 1px #eeeeee, 3px 2px 1px #cccccc, 2px 3px 1px #eeeeee,
    4px 3px 1px #cccccc, 3px 4px 1px #eeeeee, 5px 4px 1px #cccccc,
    4px 5px 1px #eeeeee, 6px 5px 1px #cccccc, 5px 6px 1px #eeeeee,
    7px 6px 1px #cccccc;
}

.player--active .score__text {
  animation: pulsing-title 2s infinite;
  text-shadow: 4px 4px 2px rgba(0, 0, 0, 0.6);
}

/* /////////////////////////////////////Media queries */

@media (max-width: 1328px) {
  /* تنظیمات تصاویر و ابزارها */
  .game__tools {
    width: 12rem;
    height: 12rem;
    top: 35%;
  }

  .dice {
    width: 2.5rem;
  }

  .gun {
    width: 6rem;
    top: 15%;
  }

  .rolling-chance {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.3rem;
    top: 10%;
  }

  /* تنظیمات نوار آسیب و امتیاز */
  .damage__container {
    width: 70%;
  }

  .score {
    width: 90%;
  }

  /* تنظیمات فاصله‌ها */
  .game__content {
    width: 90%;
    padding: 1rem;
  }

  .btn-shoot,
  .btn-reset {
    bottom: 6%;
  }
  .game__tools {
    top: 40%;
    transform: translate(-50%, -40%);
  }
}

@media (max-width: 1000px) {
  /* تنظیمات تصاویر و ابزارها */
  .game__tools {
    width: 12rem;
    height: 12rem;
    top: 40%;
    transform: translate(-50%, -40%);
  }

  .dice {
    width: 2.5rem;
  }

  .gun {
    width: 6rem;
    top: 15%;
  }

  .rolling-chance {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.3rem;
    top: 10%;
  }

  /* تنظیمات نوار آسیب و امتیاز */
  .damage__container {
    width: 60%;
  }

  .score {
    width: 90%;
  }

  /* تنظیمات فاصله‌ها */
  .game__content {
    width: 90%;
    padding: 1rem;
  }

  .btn-shoot,
  .btn-reset {
    bottom: 6%;
  }
}

@media (max-width: 748px) {
  /* تنظیمات تصاویر و ابزارها */
  .game__tools {
    width: 12rem;
    height: 12rem;
    top: 40%;
    transform: translate(-50%, -40%);
  }

  .dice {
    width: 2.5rem;
  }

  .gun {
    width: 5rem;
    top: 20%;
  }

  .rolling-chance {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.3rem;
    top: 10%;
  }

  /* تنظیمات نوار آسیب و امتیاز */
  .damage__container {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }



  .damage__bar > * {
    background-image: linear-gradient(
      to right,
      var(--clr-primary),
      var(--clr-red)
    );

   
  }

  .money{
   font-size: 1rem;
  }
  .score {
    width: 60%;
  }

  /* تنظیمات فاصله‌ها */
  .game__content {
    width: 90%;
    padding: 1rem;
  }

  .btn-shoot,
  .btn-reset {
    bottom: 6%;
  }
}

@media (max-width: 560px) {
  html {
    font-size: 45%;
  }

  body {
    font-size: 1.2rem;
  }

  .heading--primary {
    font-size: 3rem;
    letter-spacing: 0.8rem;
  }

  .heading--secondary {
    font-size: 1.8rem;
    letter-spacing: 0.3rem;
    margin-bottom: 1.5rem;
  }

  /* تنظیمات دکمه‌ها */
  .btn__homepage {
    width: 90%;
    font-size: 1.4rem;
    padding: 0.5rem 1.5rem;
  }

  .btn-act {
    padding: 0.5rem 2rem;
    font-size: 1.2rem;
  }

  /* تنظیمات پاپ‌آپ */
  .homepage__popup {
    width: 95%;
    padding: 2rem;
  }

  .popup__detail--primary {
    font-size: 1.8rem;
  }

  /* تنظیمات تایمر */
  .timer__container {
    width: 30%;
    padding: 0.8rem 0;
    top: 3%;
  }

  .timer {
    font-size: 1.6rem;
  }

  /* تنظیمات تصاویر و ابزارها */
  .game__tools {
    width: 12rem;
    height: 12rem;
    top: 35%;
  }

  .dice {
    width: 2.5rem;
  }

  .gun {
    width: 6rem;
    top: 15%;
  }

  .rolling-chance {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.3rem;
    top: 10%;
  }

  /* تنظیمات نوار آسیب و امتیاز */




  .player--active h2 {
    font-size: 2rem;
  }

  .player--active .player-score h3 {
    font-size: 1.6rem;
  }

  /* تنظیمات فاصله‌ها */
  .game__content {
    width: 95%;
    padding: 1rem;
  }

  .player {
    padding: 1rem 0;
  }

  .btn-shoot,
  .btn-reset {
    bottom: 6%;
  }

  .btn-roll {
    bottom: 15%;
  }
}

.btn-ai-turn {
  opacity: 0.2 !important;
  cursor: not-allowed !important;
  transform: translateX(-50%) scale(0.9) !important;
  transition: all 0.3s ease !important;
}
