body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

.dark-mode {
    background-color: #333;
    color: #f0f0f0;
}

.dark-mode .container {
    background-color: #444;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.dark-mode .text-display {
    border-color: #666;
}

.dark-mode .text-input {
    background-color: #555;
    border-color: #666;
    color: #f0f0f0;
}

.dark-mode .restart-btn {
    background-color: #0056b3;
}

.dark-mode .restart-btn:hover {
    background-color: #007bff;
}

.dark-mode .stat p {
    color: #ccc;
}

.container {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 80%;
    max-width: 800px;
    text-align: center;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.settings {
    display: flex;
    align-items: center;
}

#difficulty {
    margin-right: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
}

.dark-mode-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

h1 {
    margin: 0;
}

.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.progress-bar {
    height: 10px;
    background-color: #007bff;
    width: 0%;
    border-radius: 5px;
    transition: width 0.1s ease-in-out;
}

.text-display {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    line-height: 1.5;
    border: 1px solid #ccc;
    padding: 1rem;
    border-radius: 5px;
    text-align: left;
}

.text-input {
    width: 100%;
    padding: 0.5rem;
    font-size: 1.2rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    resize: none;
}

.stats {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
}

.stat {
    text-align: center;
}

.stat p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}

.stat span {
    font-size: 1.5rem;
    font-weight: bold;
}

.restart-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.restart-btn:hover {
    background-color: #0056b3;
}

.correct {
    color: green;
}

.leaderboard {
    margin-top: 2rem;
}

.leaderboard h2 {
    margin-bottom: 1rem;
}

#highScores {
    list-style-type: none;
    padding: 0;
}

#highScores li {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

