/* ahorcado.css */
.ahorcado-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100vh - 120px);
  padding: 20px;
}

.ahorcado-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.ahorcado-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  width: 100%;
  max-width: 800px;
  position: relative;
}

/* Animations */
@keyframes ahorcado-shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
  20%, 40%, 60%, 80% { transform: translateX(8px); }
}
.ahorcado-shake-active {
  animation: ahorcado-shake 0.6s ease-in-out;
}

/* Hangman Drawing */
.hangman-drawing {
  position: relative;
  width: 150px;
  height: 200px;
}

.hangman-part {
  display: none;
  position: absolute;
  background-color: #f8fafc;
}
.hangman-part.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* Base */
.hangman-base { width: 100px; height: 5px; bottom: 0; left: 25px; }
/* Pole */
.hangman-pole { width: 5px; height: 180px; bottom: 0; left: 70px; }
/* Top */
.hangman-top { width: 60px; height: 5px; top: 15px; left: 70px; }
/* Rope */
.hangman-rope { width: 5px; height: 25px; top: 15px; left: 125px; }
/* Head */
.hangman-head {
  width: 30px; height: 30px; border-radius: 50%;
  border: 4px solid #f8fafc; background: transparent;
  top: 40px; left: 112px;
}
/* Body */
.hangman-body { width: 4px; height: 50px; top: 70px; left: 125px; }
/* Left Arm */
.hangman-arm-l { width: 30px; height: 4px; top: 85px; left: 95px; transform: rotate(45deg); }
/* Right Arm */
.hangman-arm-r { width: 30px; height: 4px; top: 85px; left: 129px; transform: rotate(-45deg); }
/* Left Leg */
.hangman-leg-l { width: 35px; height: 4px; top: 125px; left: 98px; transform: rotate(45deg); }
/* Right Leg */
.hangman-leg-r { width: 35px; height: 4px; top: 125px; left: 121px; transform: rotate(-45deg); }

/* Clue Box */
.ahorcado-clue-box {
  background: rgba(56, 189, 248, 0.1);
  border-left: 4px solid #38bdf8;
  padding: 15px 20px;
  border-radius: 0 8px 8px 0;
  width: 100%;
  text-align: center;
}
.ahorcado-clue-title {
  color: #38bdf8;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: bold;
  margin-bottom: 5px;
}
.ahorcado-clue-text {
  color: #f1f5f9;
  font-size: 1.2rem;
  line-height: 1.4;
}

/* Word Box */
.ahorcado-word {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.ahorcado-letter-slot {
  width: 40px;
  height: 50px;
  border-bottom: 4px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: transparent; /* hidden until revealed */
  text-transform: uppercase;
  transition: border-color 0.3s, color 0.3s;
}
.ahorcado-letter-slot.revealed {
  color: #f8fafc;
  border-bottom-color: #38bdf8;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Keyboard */
.ahorcado-keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 600px;
}
.ahorcado-keyboard-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}
.ahorcado-key {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}
.ahorcado-key:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  transform: translateY(-2px);
}
.ahorcado-key:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.ahorcado-key.correct {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
  transform: none !important;
}
.ahorcado-key.incorrect {
  background: rgba(244, 63, 94, 0.2) !important;
  border-color: #f43f5e !important;
  color: #f43f5e !important;
  transform: none !important;
}

/* End Game Modal */
.ahorcado-end-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  z-index: 10;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.4s ease-out forwards;
}

.ahorcado-icon-win {
  color: #10b981;
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  animation: scaleUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ahorcado-icon-lose {
  color: #f43f5e;
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  animation: scaleUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Responsive Mobile Styles */
@media (max-width: 600px) {
  .ahorcado-container {
    padding: 10px;
  }
  
  .ahorcado-main {
    padding: 20px 10px;
    gap: 15px;
  }

  .ahorcado-clue-box {
    padding: 12px 10px;
  }
  
  .ahorcado-clue-text {
    font-size: 0.95rem;
  }

  .ahorcado-word {
    gap: 4px;
  }

  .ahorcado-letter-slot {
    width: 22px;
    height: 32px;
    font-size: 1.1rem;
    border-bottom-width: 3px;
  }

  .ahorcado-keyboard {
    gap: 6px;
  }
  
  .ahorcado-keyboard-row {
    gap: 4px;
  }

  .ahorcado-key {
    width: 28px;
    height: 36px;
    font-size: 0.85rem;
    border-radius: 4px;
    padding: 0;
  }
  
  .ahorcado-icon-win, .ahorcado-icon-lose {
    width: 60px;
    height: 60px;
  }
  
  .ahorcado-end-modal h2 {
    font-size: 1.8rem !important;
  }
  
  .hangman-drawing {
    transform: scale(0.75);
    margin: -20px 0;
  }
}
@media (max-width: 360px) {
  .ahorcado-key {
    width: 24px;
    height: 34px;
    font-size: 0.75rem;
  }
  .ahorcado-keyboard-row {
    gap: 2px;
  }
}
