body {
    font-family: 'Consolas', monospace; /* Monospace font is good for typing games */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #34495e; /* Dark background */
    color: #ecf0f1;
}

#game-container {
    background-color: #2c3e50;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 800px;
    width: 90%;
}

h1 {
    color: #f1c40f; /* Yellow */
    margin-bottom: 20px;
}

/* --- Race Track Area --- */
#race-track {
    width: 100%;
    height: 120px;
    background-color: #7f8c8d; /* Grey track */
    border: 3px solid #f1c40f;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative; /* Necessary for absolute positioning of racers */
    overflow: hidden;
}

.racer {
    position: absolute;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
    color: white;
    transition: left 0.5s ease; /* Smooth movement transition */
    min-width: 100px; /* Consistent size */
    text-align: left;
    left: 0%; /* Initial position */
}

#player-racer {
    top: 5px;
    background-color: #2980b9; /* Blue for player */
    z-index: 10;
}

#opponent-racer {
    bottom: 5px;
    background-color: #e74c3c; /* Red for opponent */
}

/* --- Text Display and Input --- */
#text-display-box {
    background-color: #ecf0f1;
    color: #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;
    min-height: 80px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

#target-text {
    margin: 0;
    line-height: 1.5;
    font-size: 1.1em;
    word-wrap: break-word;
}

/* Styles for the text being typed */
.correct {
    color: #27ae60; /* Green */
}

.incorrect {
    background-color: #e74c3c; /* Red highlight */
    color: white;
}

#typing-input {
    width: 98%;
    padding: 10px;
    font-size: 1.2em;
    border: 2px solid #3498db;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

/* --- Status and Controls --- */
#status-area {
    min-height: 20px;
    margin-bottom: 20px;
}

#message {
    font-weight: 500;
    color: #bdc3c7;
}

#start-button {
    padding: 12px 25px;
    font-size: 1.2em;
    font-weight: bold;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#start-button:hover {
    background-color: #2980b9;
}