body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #f4f6f8;
  margin: 0;
  padding: 0;
}

nav {
  background: #2c3e50;
  padding: 10px 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav h1 {
  margin: 0;
  font-size: 22px;
}

nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a, nav ul li span {
  color: white;
  text-decoration: none;
  font-size: 16px;
}

.page-title {
  text-align: center;
  margin: 20px 0;
  color: #2c3e50;
}

.typing-container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.typing-text {
  font-size: 18px;
  color: #34495e;
  margin-bottom: 15px;
  text-align: center;
}

.typing-area {
  width: 100%;
  height: 120px;
  font-size: 16px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 20px;
  outline: none;
  resize: none;
  transition: border 0.3s;
}

.typing-area:focus {
  border-color: #3498db;
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 10px;
  background: #ecf0f1;
  border-radius: 8px;
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #7f8c8d;
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  color: #2c3e50;
}

/* Container for the text to be typed */
.text-container {
  font-family: 'monospace', sans-serif;
  font-size: 1.5rem;
  line-height: 1.8;
  letter-spacing: 1px;
  margin-bottom: 20px;
  cursor: text; /* Indicates this area is for typing */
  padding: 10px;
  border-radius: 5px;
  background-color: #f0f0f0;
  display: flex;
  flex-wrap: wrap; /* Allows text to wrap to the next line */
}

/* Base style for each character */
.text-container span {
  white-space: pre; /* Preserves spaces */
}

/* Style for the active character (our cursor) */
.text-container span.cursor {
  background-color: #007bff;
  color: white;
  border-radius: 2px;
  animation: blink 1s infinite;
}

/* Animation for the blinking cursor */
@keyframes blink {
  0%, 100% { background-color: #007bff; }
  50% { background-color: transparent; color: inherit; }
}

/* Style for correctly typed characters */
.text-container span.correct {
  color: #28a745;
}

/* Style for incorrectly typed characters */
.text-container span.incorrect {
  color: #dc3545;
  text-decoration: underline;
}

/* Hides the actual textarea */
.typing-area {
  position: absolute;
  top: -9999px;
  left: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
}

p {
    text-align: center;
}