/* Reset and base styles */
* {
  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: 20px;
}

.container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 40px;
  max-width: 600px;
  width: 100%;
  position: relative;
}

/* Language switcher */
.language-switcher {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.lang-btn {
  background: transparent;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 600;
  width: auto;
  margin: 0;
}

.lang-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.lang-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Typography */
h1 {
  color: #333;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5em;
}

h2 {
  color: #555;
  margin-bottom: 20px;
  font-size: 1.5em;
}

h3 {
  color: #555;
  margin-bottom: 15px;
  font-size: 1.2em;
}

/* Screen management */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* Buttons */
button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  margin-bottom: 10px;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button.secondary {
  background: #ccc;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.button-group button {
  flex: 1;
}

/* Form elements */
input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}

input:focus {
  outline: none;
  border-color: #667eea;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.form-group {
  margin-bottom: 20px;
}

/* Provider selection */
.provider-btn {
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.provider-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.provider-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #ccc;
  color: #ccc;
}

/* Player list */
.player-list {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

.player-item {
  background: white;
  padding: 10px;
  margin: 5px 0;
  border-radius: 6px;
  border-left: 4px solid #667eea;
}

/* Room code display */
.room-code {
  background: #f0f4ff;
  border: 2px dashed #667eea;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin: 20px 0;
}

.room-code h3 {
  color: #667eea;
  font-size: 2em;
  letter-spacing: 0.2em;
  margin-top: 10px;
}

/* Messages */
.error-message {
  background: #fee;
  border: 1px solid #fcc;
  color: #c33;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
  display: none;
}

.error-message.show {
  display: block;
}

.info-message {
  background: #e7f3ff;
  border: 1px solid #b3d9ff;
  color: #004085;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
}

/* History */
.history {
  max-height: 300px;
  overflow-y: auto;
  margin: 20px 0;
}

.history-item {
  background: white;
  padding: 12px;
  margin: 8px 0;
  border-radius: 6px;
  border-left: 4px solid #667eea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item.winner {
  border-left-color: #28a745;
  background: #f0fff4;
}

/* Similarity visualization */
.similarity-bar {
  background: #e0e0e0;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}

.similarity-fill {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  height: 100%;
  transition: width 0.3s;
}

/* Current comparison */
.current-comparison {
  background: #fff9e6;
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
}

.comparison-words {
  display: flex;
  justify-content: space-around;
  margin: 15px 0;
  font-size: 1.2em;
  font-weight: bold;
}

.comparison-result {
  font-size: 2em;
  color: #667eea;
  margin: 10px 0;
}

/* Game over screen */
.game-over {
  text-align: center;
  padding: 20px;
}

.winner-announcement {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  margin: 20px 0;
}

.winner-announcement h2 {
  color: white;
  font-size: 2.5em;
}

.secret-word {
  font-size: 3em;
  margin: 20px 0;
  color: #667eea;
  font-weight: bold;
}

/* Loading screen */
.loading {
  text-align: center;
  padding: 20px;
  color: #667eea;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility classes */
.small-text {
  font-size: 0.9em;
  color: #666;
  margin-top: 10px;
}

.hint {
  font-size: 0.9em;
  color: #666;
  margin: 10px 0;
}

.queue-info {
  background: #f0f4ff;
  border-radius: 6px;
  padding: 10px;
  margin: 10px 0;
  font-size: 0.9em;
  color: #555;
}

/* Responsive design */
@media (max-width: 600px) {
  .container {
    padding: 30px 20px;
  }

  h1 {
    font-size: 2em;
  }

  .language-switcher {
    top: 15px;
    right: 15px;
  }

  .comparison-words {
    font-size: 1em;
  }

  .secret-word {
    font-size: 2em;
  }
}
