/* Hangman Game Styles */
/* Base Styles */
body.page-template-template-hangman-game {
  font-family: 'Arial', sans-serif;
  background-color: #1a202c;
  background: linear-gradient(to bottom, #1f2937, #2d3748, #000000);
  color: #f7fafc;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.container {
  width: 100%;
  max-width: 670px;
  padding: 0rem 2rem;
  background-color: #2d3748;
  border-radius: 0.75rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  position: relative;
}

/* Header Styles */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 2px solid #4a5568;
  margin-bottom: 1.5rem;
}

.title-container {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

h1.gameH1 {
  font-size: 1.8rem;
  margin: 0;
  color: #fff;
}

.category {
  font-size: 1.2rem;
  color: #a0aec0;
}

.header-icons {
  display: flex;
  gap: 0.8rem;
}

.icon-btn {
  background: none;
  border: none;
  color: #f7fafc;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}

.icon-btn:hover {
  color: #4299e1;
}

.icon-btn.active {
  color: #4299e1;
}

.fa-volume-up, .fa-volume-mute {
  vertical-align: middle;
}

#muteButton.active {
  color: #4299e1 !important;
}

.hidden {
  visibility: hidden;
}

/* Main Game Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hangman-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

#hangman-svg {
  stroke: #f7fafc;
  stroke-width: 6;
  stroke-linecap: round;
  max-width: 200px;
  justify-self: left;
}

.stats-timer {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #4a5568;
  padding: 1.5rem;
  border-radius: 0.5rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
}

.hint-btn {
  background: #4299e1;
  color: white;
  padding: 0.8rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}

.hint-btn:disabled {
  background: #2b6cb0;
  cursor: not-allowed;
}

.popup-text  {
  color: #2d3748;
}
.popup-link {
  color: #4299e1;
}
.popup-link:hover {
  color: #286291;
}


/* Visible Game Elements */
.word-display {
  font-size: 2.2rem;
  margin: 1rem 0;
  font-weight: bold;
  text-align: center;
  min-height: 120px;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .7rem;
}

.guessed-letters {
  font-size: 1.2rem;
  color: #a0aec0;
  min-height: 2rem;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem .9rem;
  padding: .2rem 0;
  border-radius: 5px;
  background-color: #384356;
}

.word-container {
  display: inline-flex;
  letter-spacing: 0.5rem;
}

.word-space {
  display: inline-block;
  width: 0rem;
}

.letter-space {
  display: inline-block;
  width: .2rem;
}

/* Updated Keyboard Styles (Old style + correct color) */
.keyboard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
  justify-content: center;
  max-width: 100%;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
}

.keyboard button {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  background-color: #4a5568;
  color: #f7fafc;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 60px;
}

.keyboard button.correct {
  background-color: #68d391 !important;
}

.keyboard button.incorrect {
  background-color: #a0aec0 !important;
  opacity: 0.6;
}

.keyboard button:hover:not(:disabled) {
  background-color: #718096;
}

.keyboard button:disabled {
  cursor: not-allowed;
  box-shadow: none;
}

/* Popup Overlay */
#resultPopup,
#hintPopup,
#statsPopup,
#helpPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  width: 90%;
  max-width: 600px;
  position: relative;
  color: #2d3748;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 0 0.5rem;
  font-size: 2rem;
  cursor: pointer;
  color: #2d3748;
}

.popup-hidden {
  display: none !important;
}

:is(#resultPopup, #hintPopup, #statsPopup, #helpPopup):not(.popup-hidden) {
  display: flex;
}

/* Result Popup Specific */
.result-body {
  text-align: center;
}

.emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.result-title {
  font-size: 2rem;
  margin: 1rem 0;
  color: #2d3748;
}

.correct-answer {
  font-size: 1.2rem;
  margin: 1rem 0;
  color: #2d3748;
}

.word-description {
  color: #4a5568;
  margin: 1.5rem 0;
}

.learn-more {
  display: block;
  color: #4299e1;
  text-decoration: none;
  margin: 1rem 0;
}

.learn-more:hover {
  text-decoration: underline;
  cursor: pointer;
  color:#1f2937;
}

.social-share {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.share-btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  color: white;
  background-color: #1559ed;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
}

.x-social { 
  background: #000000;
  color: white !important;
}
.facebook { background: #1877f2; }

/* Stats Popup */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.stat-box {
  background: #d1d5d7;
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  display: block;
  color: #2d3748;
}

.stat-label {
  font-size: 0.9rem;
  color: #4a5568;
}

.popup-content .return-btn {
  background: #48bb78;
  margin-bottom: 1rem;
}

.popup-content .return-btn:hover {
  background: #38a169;
}

.disabled-game {
  opacity: 0.6;
  pointer-events: none;
}

/* Countdown styles */
.countdown-container {
  margin: 1.5rem 0;
  font-size: 1.1rem;
  color: #4a5568;
  text-align: center;
}

#dailyCountdown {
  font-weight: bold;
  color: #2d3748;
  font-size: 1.3rem;
  margin-left: 0.5rem;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Add to stats-timer */
.stat-item #timer {
  font-weight: bold;
  transition: color 0.3s;
  animation: none; /* Reset default */
}

.stat-item #timer.low-time {
  color: #e53e3e !important;
  animation: pulse 1s infinite;
}

/* Add to responsive section */
@media (max-width: 768px) {
  .stat-item {
      font-size: 1rem;
  }

  .stat-item #timer.low-time {
      animation: pulse 1.2s infinite;
  }
}

/* Footer Menu */
.footer-menu {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: .5rem;
  padding: 1rem 0;
  border-top: 1px solid #4a5568;
  font-size: 0.9rem;
}

.footer-link {
  color: #a0aec0;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #f7fafc;
}

/* Add stats note styling */
.stats-note {
  text-align: center;
  color: #4a5568;
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
    max-height: none;
  }

  .hangman-section {
    gap: 1rem;
  }

  #hangman-svg {
    max-width: 150px;
  }

  .guessed-letters {
    margin: 1rem 0rem 0.5rem;
  }

  .keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    max-width: 100%;
  }


  .keyboard button {
    max-width: 45px;
    font-size: 0.7rem;
    box-sizing: border-box;
    padding: 0.25rem;
    width: calc(100% / 10); /* Default to 10 buttons width */
  }

  .keyboard-row:nth-child(3) {
    justify-content: center; /* keep the 3rd row centered */
    max-width: calc(10 * (45px + 0.125rem));
    margin: 0 auto;
  }

  .keyboard-row:nth-child(3) button {
    width: calc(100% / 10); /* Adjust for 8 buttons */
  }

  .word-display {
    font-size: 1.5rem;
    letter-spacing: 0.3rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .category {
    font-size: 1rem;
  }

  .stats-timer {
    padding: 1.5rem;
  }

  .popup-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .game-header {
    padding: 0.5rem 0;
  }

  .title-container {
    gap: 0.25rem;
    flex-direction: column;
  }

  .footer-menu {
    align-items: center;
    gap: 1.2rem;
  }

  .guessed-letters {
    margin: 1rem 0rem 0.5rem;
  }
}