/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Fondo general */
.cuerpo-game {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1f4f81 0%, #27ae60 100%);
  min-height: 100vh;
  padding: 20px;
  color: #222;
}

/* Contenedor principal */
.game-container {
  max-width: 1100px;
  margin: 0 auto;
  background-color: #ffffffee;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Encabezado */
.game-header {
  padding: 20px;
  text-align: center;
  background: #1f4f81;
  color: white;
}
.game-header h1 {
  font-size: 2.2em;
  margin-bottom: 15px;
  font-weight: bold;
  letter-spacing: 1.5px;
}

/* Puntajes */
.score-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.score-item {
  border: 2px solid #27ae60;
  padding: 8px 15px;
  border-radius: 8px;
  background: #f4f6f9;
}
.score-label {
  font-weight: bold;
  color: #1f4f81;
  margin-right: 5px;
}
.total-score {
  font-size: 1.2em;
  font-weight: bold;
  color: #27ae60;
}

/* Selector de categoría */
.category-selector {
  padding: 20px;
  text-align: center;
  background-color: #fafafa;
}
.category-selector h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #333;
}
.category.Buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Área de juego */
.game-area {
  padding: 30px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
  align-items: start;
}
.word-info {
  text-align: center;
}
.current-category {
  font-size: 1.1em;
  font-weight: bold;
  margin-bottom: 15px;
  color: #1f4f81;
}
.word-display {
  font-size: 2.5em;
  font-weight: bold;
  letter-spacing: 0.2em;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
}
.hangman-container {
  text-align: center;
}
#hangmanSvg {
  border: 3px solid #ccc;
  background-color: #fff;
  margin-bottom: 15px;
  border-radius: 8px;
}
.attempts-counter {
  font-size: 1.1em;
  font-weight: bold;
  color: #e63946;
}

/* Controles */
.game-controls {
  padding: 25px;
  background-color: #fafafa;
}

/* Botón de pista */
.hint-area {
  text-align: center;
  margin-bottom: 20px;
}
.hint-button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}
.hint-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.hint-button:disabled {
  background-color: #bbb;
  cursor: not-allowed;
}
.hintDisplay {
  margin-top: 12px;
  padding: 12px;
  background-color: #1f4f81;
  border-radius: 8px;
  font-style: italic;
  font-size: 1em;
  color: #fff;
  display: none;
}
.hintDisplay.show {
  display: block;
}

/* Teclado */
.keyboard {
  margin-top: 20px;
}
.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 6px;
}
.key {
  width: 45px;
  height: 45px;
  border: 2px solid #1f4f81;
  border-radius: 6px;
  background-color: #fff;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1f4f81;
}
.key:hover {
  background: #27ae60;
  color: #fff;
  transform: scale(1.05);
}

/* Botones de acción */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.action-button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #27ae60 0%, #1f4f81 100%);
  color: white;
  font-size: 1em;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 130px;
}
.action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.action-button.secundary {
  background: linear-gradient(135deg, #e63946 0%, #9e2a2b 100%);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.resultTitle {
  margin-bottom: 12px;
  color: #1f4f81;
}
.result-stats {
  margin: 15px 0;
  padding: 12px;
  background: #ecf0f1;
  border-radius: 6px;
  font-size: 0.9em;
}

/* Estadísticas */
.stats-container {
  padding: 25px;
  background: #f4f6f9;
}
.title-stats {
  text-align: center;
  margin-bottom: 15px;
  color: #1f4f81;
}
.category-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 15px;
}
