* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Play", sans-serif;
  background-color: #0a0e16;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  margin: 20px auto;
  max-width: 1000px;
  width: 95%;
  background-color: rgba(28, 38, 53, 0.85);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(58, 58, 58, 0.5);
  border: 1px solid #2c3e50;
  position: relative;
  overflow: hidden;
}

hr {
  border: none;
  height: 1px;
  background-image: linear-gradient(
    to right,
    transparent,
    #5596d6,
    transparent
  );
  margin: 15px 0;
  opacity: 0.7;
}

/* Game Info Section */
.game-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 10px 0;
}

.game-info .game-name {
  flex: 1;
  min-width: 200px;
  font-size: 28px;
  font-weight: 700;
  color: #2d80d3;
  text-shadow: 0 0 10px rgba(85, 150, 214, 0.5);
  letter-spacing: 0.5px;
}

.game-info .category {
  flex: 1;
  min-width: 200px;
  text-align: right;
  font-size: 18px;
  color: #fff;
}

.game-info .category span {
  text-transform: capitalize;
  color: #ff9248;
  font-weight: bold;
  background-color: rgba(44, 62, 80, 0.8);
  padding: 6px 18px;
  border-radius: 20px;
  border: 1px solid #3c546b;
  box-shadow: 0 0 10px rgba(255, 146, 72, 0.2);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}

/* Hangman Drawing Section */
.hangman-draw {
  flex: 1;
  min-width: 300px;
  background: linear-gradient(135deg, #162030 0%, #0d1420 100%);
  padding: 20px;
  height: 324px;
  border-radius: 15px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
  border: 1px solid #2c3e50;
}

.hangman-draw .the-stand {
  position: absolute;
  width: 140px;
  height: 10px;
  background: linear-gradient(to right, #464d58, #5d6b82, #4b5563);
  bottom: 20px;
  left: 50%;
  transform: translateX(-65px);
  display: none;
}

.hangman-draw .the-hang::before,
.hangman-draw .the-hang::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 250px;
  background: linear-gradient(to top, #4b5563, #5d6b82, #4b5563);
  bottom: 20px;
  left: 50%;
  transform: translateX(-65px);
  display: none;
}

.hangman-draw .the-hang::after {
  width: 115px;
  height: 10px;
  bottom: 245px;
  left: 50%;
  transform: translateX(-65px);
}

.hangman-draw .the-rope {
  width: 8px;
  height: 50px;
  background: linear-gradient(to bottom, #7f8c8d, #5d6b82);
  position: absolute;
  left: 50%;
  top: 77px;
  display: none;
}

/* Hangman Head */
.hangman-draw .the-man .head {
  width: 40px;
  height: 40px;
  background: linear-gradient(45deg, #1c1c1c, #2c3747);
  position: absolute;
  left: calc(50% - 16px);
  bottom: 160px;
  border-radius: 50%;
  display: none;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

.hangman-draw .the-man .head::before,
.hangman-draw .the-man .head::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  background-color: white;
  border-radius: 50%;
  top: 15px;
  left: 8px;
  box-shadow: 0 0 3px #fff, 0 0 5px rgba(255, 255, 255, 0.5);
  animation: blink 2s infinite;
}

.hangman-draw .the-man .head::after {
  top: 15px;
  left: 25px;
}

@keyframes blink {
  0%,
  96%,
  98% {
    transform: scaleY(1);
  }
  97%,
  99% {
    transform: scaleY(0.1);
  }
  100% {
    transform: scaleY(1);
  }
}

/* Hangman Body */
.hangman-draw .the-man .body {
  position: absolute;
  width: 6px;
  height: 80px;
  background: linear-gradient(to bottom, #1c1c1c, #2c3747);
  bottom: 80px;
  left: calc(50% - -1px);
  display: none;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

/* Hangman Hands */
.hangman-draw .the-man .hands {
  display: none;
}

.hangman-draw .the-man .hands::before,
.hangman-draw .the-man .hands::after {
  content: "";
  width: 40px;
  height: 6px;
  background: #19324d;
  position: absolute;
  bottom: 140px;
  left: calc(50% - 37px);
  transform: rotate(30deg);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.hangman-draw .the-man .hands::after {
  left: calc(50% - -5px);
  transform: rotate(-30deg);
}

/* Hangman Legs */
.hangman-draw .the-man .legs {
  display: none;
}

.hangman-draw .the-man .legs::before,
.hangman-draw .the-man .legs::after {
  content: "";
  width: 40px;
  height: 6px;
  background: #19324d;
  position: absolute;
  bottom: 70px;
  left: calc(50% - -3px);
  transform: rotate(30deg);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.hangman-draw .the-man .legs::after {
  left: calc(50% - 35px);
  transform: rotate(-30deg);
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* Wrong Guess Animations */
.hangman-draw.wrong-1 .the-stand {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-2 .the-hang::before {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-3 .the-hang::after {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-4 .the-rope {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-5 .head {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-6 .body {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-7 .hands {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-8 .legs {
  display: block;
  animation: fadeIn 0.5s forwards;
}

.hangman-draw.wrong-9 .head::before,
.hangman-draw.wrong-9 .head::after {
  animation: none;
  content: "X";
  color: red;
  top: 10px;
  box-shadow: none;
  background: none;
}

.hangman-draw.wrong-9 .head {
  left: calc(55% - 16px);
  transition: 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Letters Section */
.letters {
  flex: 1;
  min-width: 300px;
  padding: 20px;
  text-align: center;
  border-radius: 15px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 0, 0, 0.3);
  border: 1px solid #2c3e50;
  position: relative;
}

.letters .letter-box {
  width: 50px;
  height: 50px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(to bottom, #34495e, #2c3e50);
  color: #e6e9f0;
  font-size: 32px;
  margin: 5px;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s ease-in-out;
  border: 1px solid #3c546b;
}

.letters .letter-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1c2635, 0 0 15px rgba(85, 150, 214, 0.3);
  background: linear-gradient(to bottom, #3c5876, #34495e);
  text-shadow: 0 0 5px #5596d6;
  color: #fff;
}

.finished {
  pointer-events: none;
  border-color: #e00a0a;
  background: black;
  transition: 0.2s ease-in-out;
}
.finished.win {
  background: #0417018f;
  border-color: #00ff00;
}
.letters .letter-box.clicked-lose,
.letters-guess span.clicked-lose {
  opacity: 0.5;
  pointer-events: none;
  border-color: red;
}
.letters .letter-box.clicked-win,
.letters-guess span.clicked-win {
  border: 2px solid #05f405;
  opacity: 0.5;
  pointer-events: none;
}
/* Letters Guess Section */
.letters-guess {
  margin: 20px auto;
  padding: 25px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 104px;
  border-radius: 15px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 0, 0, 0.3);
  border: 1px solid #2c3e50;
}
.letters-guess span {
  width: 55px;
  height: 55px;
  font-size: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  font-weight: bold;
  background: linear-gradient(to bottom, #3c5876, #2c3e50);
  border-radius: 8px;
  border-bottom: 3px solid #5596d6;
  transition: all 0.3s;
  color: #e6e9f0;
}
.letters-guess span.with-space {
  background: none;
  border-bottom: none;
  box-shadow: none;
  position: relative;
}
.letters-guess span.with-space::before {
  content: "";
  width: 20px;
  height: 3px;
  background: linear-gradient(to right, #3c5876, #5596d6, #3c5876);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.7;
}
/*-----*/
.popup {
  position: fixed;
  background: rgba(28, 38, 53, 0.95);
  padding: 40px 20px;
  width: 90%;
  max-width: 500px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 30px;
  color: #e6e9f0;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(85, 150, 214, 0.2);
  z-index: 100;
  animation: popIn 0.5s forwards;
  border: 1px solid #3c546b;
  backdrop-filter: blur(5px);
}

.popup.win {
  background: rgba(39, 174, 96, 0.2);
  border: 1px solid #2ecc71;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(46, 204, 113, 0.3);
}

.popup.lose {
  background: rgba(192, 57, 43, 0.2);
  background-image: radial-gradient(
    circle at center,
    rgba(231, 76, 60, 0.2),
    transparent 80%
  );
  border: 1px solid #e74c3c;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(231, 76, 60, 0.3);
}
/* Footer section */
.footer {
  text-align: center;
  margin-top: 20px;
  color: #e6e9f0;
}
.footer span {
  color: #5596d6;
  font-weight: bold;
  font-size: larger;
  margin: 10px;
}
/* Responsive*/
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }
  .hangman-draw {
    min-width: 100%;
  }

  .letters {
    min-width: 100%;
  }

  .letters .letter-box {
    width: 40px;
    height: 40px;
  }

  .letters-guess span {
    width: 45px;
    height: 45px;
  }

  .popup {
    font-size: 24px;
    padding: 20px;
  }
}
