body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
    padding: 0;
}

.header-container {
    background-color: #3f51b5;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
}

.header-container h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: bold;
}

.header-container h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: normal;
}

.game-container {
    width: 90%;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

#flashcard-container {
    margin-bottom: 20px;
}

#flashcard {
    padding: 30px;
    border: 2px solid #ccc;
    border-radius: 10px;
    background-color: #e3f2fd;
    margin-bottom: 20px;
}

.question {
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: bold;
    color: #1976d2;
}

.answers {
    text-align: left;
    display: inline-block;
}

.answer-option {
    display: block;
    margin-bottom: 15px;
    cursor: pointer;
    font-size: 1.2em;
}

.answer-option.correct {
    background-color: #a5d6a7;
}

.answer-option.incorrect {
    background-color: #ef9a9a;
}

#race-container {
    position: relative;
    width: 100%;
    height: 60px;
    border: 2px solid #000;
    overflow: hidden;
    margin-bottom: 20px;
    border-radius: 30px;
    background: #e0e0e0;
}

#timer-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: #f44336;
    z-index: 1;
    transition: width 0.1s linear;
}

#track {
    position: relative;
    width: 100%;
    height: 100%;
    background: none;
    transition: background 0.5s;
    z-index: 2;
}

#horse {
    position: absolute;
    top: 50%;
    left: 0;
    width: 70px;
    height: 70px;
    background: url('horse.gif') no-repeat center center;
    background-size: contain;
    transform: translateY(-50%);
    transition: left 0.5s;
    z-index: 3;
}

#percentage {
    font-size: 1.5em;
    margin-top: 10px;
    font-weight: bold;
    color: #ff9800;
}

#message {
    font-size: 1.5em;
    margin-top: 20px;
    font-weight: bold;
    color: #4caf50;
}

.button-container {
    display: flex;
    justify-content: center;
}

button {
    background-color: #1976d2;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 20px; /* Add space above the button */
}

button:hover {
    background-color: #0d47a1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    text-align: center;
    border-radius: 10px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

#instructionsModal .modal-content {
    text-align: left;
}

#instructionsModal h2 {
    text-align: center;
    color: #1976d2;
}

#instructionsModal ul {
    padding-left: 20px;
}

#startGameButton {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    font-size: 1.2em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#startGameButton:hover {
    background-color: #45a049;
}

/* Media Queries for Mobile */
@media (max-width: 600px) {
    .header-container h1 {
        font-size: 1.8em;
    }

    .header-container h2 {
        font-size: 1.2em;
    }

    .game-container {
        width: 95%;
        padding: 15px;
    }

    .question {
        font-size: 1em;
    }

    .answer-option {
        font-size: 0.9em;
    }

    #flashcard {
        padding: 20px;
    }

    #race-container {
        height: 40px;
    }

    #horse {
        width: 40px;
        height: 40px;
    }

    #percentage, #message {
        font-size: 1em;
    }

    button {
        padding: 10px 15px;
        font-size: 1em;
    }
}
