* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.container {
  background: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.3);
  text-align: center;
  max-width: 700px;
  width: 95%;
  backdrop-filter: blur(10px);
}

h1 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.difficulty-warning {
  background: #ffeaa7;
  color: #d63031;
  padding: 0.8rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-weight: bold;
  border: 2px solid #fab1a0;
}

.category-selector {
  margin: 1.5rem 0;
  padding: 1.2rem;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  border-radius: 15px;
  color: white;
}

.category-selector label {
  font-weight: bold;
  margin-right: 0.8rem;
  font-size: 1.1rem;
}

.category-selector select {
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  background: white;
  color: #333;
  font-weight: bold;
  cursor: pointer;
}

.game-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1.2rem;
  background: #f8f9fa;
  border-radius: 15px;
  font-weight: bold;
}

#hint-definition {
  font-weight: bold;
  color: #e74c3c;
  font-style: italic;
  background: #ffeaa7;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}

#current-category {
  font-weight: bold;
  color: #9b59b6;
  background: #e8f8f5;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
}

.hangman-container {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #2d3436;
  border-radius: 15px;
  display: inline-block;
}

#hangman-canvas {
  border: 3px solid #636e72;
  border-radius: 10px;
  background: #dfe6e9;
}

.word-display {
  font-size: 2.2rem;
  letter-spacing: 0.8rem;
  margin: 2rem 0;
  font-weight: bold;
  color: #2d3436;
  font-family: 'Courier New', monospace;
  min-height: 60px;
}

.letter-display {
  display: inline-block;
  min-width: 40px;
  text-align: center;
}

.space-indicator {
  color: #74b9ff;
  font-weight: bold;
  margin: 0 1rem;
  font-size: 1.5rem;
}

.keyboard {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0.6rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: #dfe6e9;
  border-radius: 15px;
}

.letter {
  padding: 1rem;
  font-size: 1.3rem;
  border: none;
  background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  color: white;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

.letter:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.letter:active {
  transform: translateY(1px);
}

.controls {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.controls button {
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
}

#new-game {
  background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

#hint {
  background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

#change-category {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
}

.controls button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.message {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 1.5rem 0;
  min-height: 3rem;
  padding: 1rem;
  border-radius: 10px;
}

.win { 
  background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
  color: white;
}

.lose { 
  background: linear-gradient(135deg, #fab1a0 0%, #e17055 100%);
  color: white;
}

.stats {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #2d3436;
  color: white;
  border-radius: 10px;
  font-weight: bold;
}

@media (max-width: 768px) {
  .keyboard {
      grid-template-columns: repeat(7, 1fr);
  }
  
  .word-display {
      font-size: 1.8rem;
      letter-spacing: 0.5rem;
  }
  
  .game-info {
      grid-template-columns: 1fr 1fr;
  }
  
  .controls {
      flex-direction: column;
  }
}