/* --- DARK MODE BASE STYLES --- */
body {
    /* Darker background for the entire page */
    background-color: #1e1e1e; 
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: #f0f0f0; /* Light text color */
}

.container {
    /* Primary container color (dark gray/black) */
    background-color: #252526; 
    padding: 30px;
    border-radius: 12px;
    /* Soft shadow on the dark background */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); 
    width: 90%;
    max-width: 800px;
    text-align: center;
}

h1 {
    color: #8be9fd; /* Light blue/cyan for the main title */
    margin-bottom: 20px;
}

/* --- TEXT DISPLAY AREA --- */
#target-text {
    font-size: 1.2em;
    padding: 20px;
    /* Darker background for the text box */
    background-color: #3c3c3c; 
    border: 1px solid #555;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.5;
    color: #f0f0f0; /* Ensure text remains light */
}

/* --- INPUT AREA --- */
#input-area {
    width: 95%;
    padding: 15px;
    font-size: 1.1em;
    /* Dark background and light text for the input */
    background-color: #1e1e1e;
    color: #f0f0f0;
    border: 2px solid #555;
    border-radius: 8px;
    box-sizing: border-box; 
    resize: none; 
}

/* --- BUTTONS --- */
.controls button {
    padding: 10px 20px;
    margin: 15px 5px 0;
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    transition: background-color 0.3s;
}

#start-button {
    background-color: #007bff; /* Keep a bright primary color */
    color: white;
}

#start-button:hover {
    background-color: #0056b3;
}

#reset-button {
    background-color: #dc3545; /* Keep a clear contrast color */
    color: white;
}

#reset-button:hover {
    background-color: #c82333;
}

/* --- RESULTS AREA --- */
.results {
    margin-top: 25px;
    padding: 15px;
    border: 1px dashed #555; /* Lighter dashed border for contrast */
    border-radius: 8px;
    text-align: left;
}

.results h2 {
    margin-top: 0;
    color: #8be9fd; /* Use the same accent color as the header */
}

.results strong {
    font-size: 1.1em;
    color: #f0f0f0;
}

/* --- LIVE HIGHLIGHTING STYLES --- */

/* Ensures the text display area has the same styling as the input */
.target-display {
    font-size: 1.2em;
    padding: 20px;
    background-color: #3c3c3c; 
    border: 1px solid #555;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.5;
    color: #f0f0f0; /* Default color for untyped text */
    /* Use a monospace font for consistent character spacing */
    font-family: monospace, sans-serif; 
}

/* Correctly typed characters */
.target-display .correct {
    color: #4CAF50; /* Bright Green */
}

/* Incorrectly typed characters */
.target-display .incorrect {
    color: #FF5722; /* Bright Red/Orange */
    text-decoration: underline wavy #FF5722; /* Optional: Wavy underline for errors */
    font-weight: bold;
}

/* Untyped characters */
.target-display .untyped {
    color: #777; /* Subdued gray */
}