/* Game specific styles for Hangman */

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.back-btn {
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform 0.3s ease;
}

.back-btn:hover {
  transform: translateX(-5px);
  color: var(--primary);
}

.game-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-bottom: 3rem;
  position: relative;
}

.game-info {
  background-color: var(--surface);
  padding: 2rem;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.1);
}

.stat-item i {
  font-size: 1.2rem;
  color: var(--primary);
}

.settings {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings h3 {
  margin-bottom: 0.5rem;
}

.category-buttons,
.difficulty-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-btn,
.difficulty-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border: none;
  padding: 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  display: flex;
  align-items: center;
}

.category-btn::before,
.difficulty-btn::before {
  content: '';
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  margin-right: 0.8rem;
  transition: all 0.3s ease;
}

.category-btn.active,
.difficulty-btn.active {
  background-color: rgba(127, 90, 240, 0.2);
}

.category-btn.active::before,
.difficulty-btn.active::before {
  background-color: var(--primary);
  border-color: var(--primary);
}

.hint-container {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 10px;
}

.hint-container h3 {
  margin-bottom: 0.5rem;
}

#hint-text {
  font-style: italic;
  margin-bottom: 1rem;
  min-height: 3rem;
}

.action-btn {
  background-color: var(--accent);
  color: var(--text);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: auto;
}

.action-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 137, 6, 0.4);
}

.action-btn:disabled {
  background-color: rgba(255, 137, 6, 0.4);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.gameplay-area {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hangman-display {
  background-color: var(--surface);
  border-radius: 15px;
  padding: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

#hangman-svg {
  width: 100%;
  max-width: 300px;
  height: auto;
}

.hangman-part {
  stroke: var(--text);
  stroke-width: 4;
  fill: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hangman-part.show {
  opacity: 1;
}

.face-part {
  stroke: var(--text);
  stroke-width: 2;
}

.word-display {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}

#word-container {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.letter-box {
  width: 2.5rem;
  height: 3.5rem;
  background-color: var(--surface);
  border-radius: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8rem;
  font-weight: bold;
  text-transform: uppercase;
  position: relative;
}

.letter-box::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 10%;
  width: 80%;
  height: 3px;
  background-color: var(--text);
  opacity: 0.5;
}

.letter-box.space {
  background-color: transparent;
}

.letter-box.space::after {
  display: none;
}

.letter-box.reveal {
  animation: reveal 0.5s ease forwards;
}

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.key-btn {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--surface);
  border: none;
  border-radius: 5px;
  color: var(--text);
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.key-btn:hover {
  background-color: var(--primary);
  transform: translateY(-3px);
}

.key-btn.correct {
  background-color: var(--secondary);
  color: white;
}

.key-btn.incorrect {
  background-color: #e74c3c;
  color: white;
  text-decoration: line-through;
}

.key-btn:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

#message-container {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  min-height: 2rem;
  color: var(--secondary);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(22, 22, 26, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay-content {
  text-align: center;
  padding: 2rem;
  background-color: var(--surface);
  border-radius: 15px;
  max-width: 90%;
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.overlay-content h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

#game-result.win {
  color: var(--secondary);
}

#game-result.lose {
  color: #e74c3c;
}

#correct-word {
  font-weight: bold;
  color: var(--primary);
}

#new-high-score {
  color: var(--secondary);
  font-weight: bold;
  display: none;
}

/* Media Queries */
@media (max-width: 768px) {
  .game-container {
      grid-template-columns: 1fr;
  }
  
  .game-info {
      order: 2;
  }
  
  .gameplay-area {
      order: 1;
  }
  
  .key-btn {
      width: 2rem;
      height: 2rem;
      font-size: 0.9rem;
  }
}

/* Animations */
@keyframes reveal {
  0% {
      transform: scale(0.5);
      opacity: 0;
  }
  70% {
      transform: scale(1.2);
  }
  100% {
      transform: scale(1);
      opacity: 1;
  }
}

@keyframes shake {
  0%, 100% {
      transform: translateX(0);
  }
  25% {
      transform: translateX(-5px);
  }
  50% {
      transform: translateX(5px);
  }
  75% {
      transform: translateX(-5px);
  }
}

@keyframes pulse {
  0% {
      transform: scale(1);
  }
  50% {
      transform: scale(1.05);
  }
  100% {
      transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
      opacity: 0;
  }
  to {
      opacity: 1;
  }
}