/* Allgemeine Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at top left, #d72864 0%, #8c195f 50%, #6b1449 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}

h1 {
  color: #8c195f;
  text-align: center;
  margin-bottom: 20px;
}

p {
  text-align: center;
  margin-bottom: 10px;
}

/* Container */
.game-container,
.lobby-container {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.btn {
  padding: 12px 20px;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn.primary {
  background: #8c195f;
  color: white;
  text-align: center;
  display: block;
}

.btn.secondary {
  background: #f5f5f5;
  color: #8c195f;
  border: 2px solid #8c195f;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(140, 25, 95, 0.3);
}

/* Eingabefelder */
input {
  display: block;
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid #ccc;
}

/* Hangman Spiel */
.word-display {
  text-align: center;
  font-size: 2.5em;
  letter-spacing: 15px;
  margin: 20px 0;
}

.letters-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 8px;
  margin: 20px 0;
}

.letter-btn {
  padding: 12px;
  font-size: 1.2em;
  font-weight: bold;
  border: 2px solid #8c195f;
  background: white;
  color: #8c195f;
  border-radius: 8px;
  cursor: pointer;
}

.letter-btn.correct {
  background: #4caf50;
  color: white;
  border-color: #4caf50;
}

.letter-btn.wrong {
  background: #f44336;
  color: white;
  border-color: #f44336;
}

.message {
  text-align: center;
  font-weight: bold;
  min-height: 30px;
}

/* --- Chat Container --- */
#chat-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  max-height: 70vh;
  /* max. Höhe relativ zum Viewport */
  background-color: #1e1e1e;
  color: #fff;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  z-index: 1000;
  overflow: hidden;
}

/* Kleinere Bildschirme: Chat rutscht unter das Spiel und wird breiter */
@media (max-width: 992px) {
  #chat-container {
    position: relative;
    top: auto;
    right: auto;
    width: 90%;
    margin: 20px auto 0 auto;
  }
}

/* Chat Header */
#chat-header {
  padding: 15px;
  background-color: #8c195f;
  font-weight: bold;
  text-align: center;
  font-size: 1.1rem;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

/* Chat Messages */
#chat-messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #2a2a2a;
}

/* Einzelne Nachricht */
#chat-messages .message {
  background: #3a3a3a;
  padding: 8px 12px;
  border-radius: 10px;
  word-wrap: break-word;
}

#chat-messages .message .user {
  font-weight: bold;
  color: #ffb86c;
  margin-right: 5px;
}

/* Chat Formular */
#chat-form {
  display: flex;
  border-top: 1px solid #444;
  background-color: #2a2a2a;
}

#chat-input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 0;
  outline: none;
  background-color: #1e1e1e;
  color: #fff;
  font-size: 14px;
}

#chat-form button {
  padding: 0 20px;
  background-color: #8c195f;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: 0.3s;
}

#chat-form button:hover {
  background-color: #a22a7c;
}

/* Spielanleitung */
.instructions {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 12px;
  margin-top: 30px;
  text-align: left;
  border-left: 5px solid #8c195f;
}

.instructions h2 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 10px;
}

.instructions ol {
  padding-left: 20px;
  color: #555;
  line-height: 1.6;
}

.instructions li {
  margin-bottom: 5px;
}