.instructions {
  background-color: #e8f5e9;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  text-align: left;
}

.instructions h2 {
  color: #2e7d32;
  margin-top: 0;
}

.instructions ul {
  margin: 10px 0;
  padding-left: 20px;
}

.instructions li {
  margin: 5px 0;
  line-height: 1.4;
}

.word-display {
  font-size: 2em;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  border: 2px solid #eee;
  border-radius: 5px;
  position: relative;
}

.timer {
  position: absolute;
  top: -25px;
  right: 10px;
  font-size: 0.8em;
  color: #666;
}

.input-section {
  margin: 20px 0;
  text-align: center;
}

#userInput {
  padding: 10px;
  font-size: 1.2em;
  width: 300px;
  margin-right: 10px;
  border: 2px solid #ddd;
  border-radius: 5px;
}

button {
  padding: 10px 20px;
  font-size: 1.1em;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

button:hover:not(:disabled) {
  background-color: #45a049;
}

ul {
  text-align: left !important;
}
.stats {
  margin-top: 20px;
  padding: 15px;
  background-color: #f8f8f8;
  border-radius: 5px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stats span {
  font-size: 1.2em;
  font-weight: bold;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  min-width: 40px;
  text-align: center;
}

.start-button,
#startButton {
  margin: auto;
  display: flex;
  margin-top: 10px !important;
}

.level-select {
  margin: 20px 0;
}

.feedback {
  margin: 10px 0;
  padding: 10px;
  border-radius: 5px;
}

.feedback.correct {
  background-color: #dff0d8;
  color: #3c763d;
}

.feedback.incorrect {
  background-color: #f2dede;
  color: #a94442;
}

.progress-bar {
  width: 100%;
  height: 25px;
  background-color: #f0f0f0;
  border-radius: 12px;
  margin: 15px 0;
  overflow: hidden;
  border: 2px solid #ddd;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(45deg, #4caf50, #81c784);
  width: 100%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.progress-fill.warning {
  background: linear-gradient(45deg, #ff5252, #ff8a80);
}

.progress-label {
  position: absolute;
  width: 100%;
  text-align: center;
  color: white;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  line-height: 25px;
}

.level-indicator {
  position: absolute;
  top: -25px;
  left: 10px;
  font-size: 0.8em;
  color: #666;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.fade-animation {
  animation: fadeInOut 0.8s ease-in-out;
}

.attempts-warning {
  color: #d32f2f !important;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.game-result {
  background: #e8f5e9;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
  text-align: center;
  border: 2px solid #4caf50;
}

.game-result .score {
  font-size: 2em;
  color: #2e7d32;
  font-weight: bold;
  margin: 10px 0;
}

.game-result .level {
  font-size: 1.5em;
  color: #1976d2;
  margin: 5px 0;
}

.ranking-section {
  margin-top: 30px;
  padding: 20px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ranking-header {
  text-align: center;
  margin-bottom: 20px;
}

.ranking-header h2 {
  color: #333;
  margin: 0;
}

.ranking-header p {
  color: #666;
  margin: 5px 0 0 0;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.ranking-table th,
.ranking-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.ranking-table th {
  background-color: #f5f5f5;
  font-weight: bold;
  color: #333;
}

.ranking-table tr.top-three {
  background-color: #f8f8f8;
}

.ranking-table tr.top-three td:first-child {
  font-weight: bold;
  color: #4caf50;
}

.ranking-table tr:nth-child(1) td:first-child {
  color: #ffd700;
}

.ranking-table tr:nth-child(2) td:first-child {
  color: #c0c0c0;
}

.ranking-table tr:nth-child(3) td:first-child {
  color: #cd7f32;
}
