/* General Styles */
body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f0f0;
    position: relative;
    transition: background-color 0.5s ease, background 0.5s ease; /* Add transition for background changes */
}

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

h1 {
    color: #2f2bb2;
    font-size: 2em;
    margin-top: 0;
    margin-bottom: 10px;
}

h2 {
    color: #2f2bb2;
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
}

p {
    line-height: 1.6;
    color: #555;
}

ul {
    margin: 10px 0;
    padding-left: 20px;
}
li {
    line-height: 1.6;
    color: #555;
}

.version {
    font-size: .7em;
    color: #a6a6a6;
}

button {
    padding: 40px 20px;
    margin: 5px;
    font-size: 14px;
	font-weight: bold;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
	background-color: rgb(46, 204, 113);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Navigation Buttons (Back to Home, Instructions) */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
}

.back-button a {
    display: inline-block;
    padding: 10px 20px;
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.back-button a:hover {
    background-color: #0056b3;
}

/* Race Control UI Elements */
.settings {
    margin-bottom: 20px;
}

.settings label {
    font-size: 18px;
    margin-right: 10px;
    color: #333;
}

.settings select {
    padding: 5px 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
}

.start {
    padding: 10px 20px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    background-color: #28a745;
    border: none;
    border-radius: 5px;
    margin-left: 10px;
}

.start:hover {
    background-color: #218838;
}

.timer {
    font-size: 48px;
    font-weight: bold;
    margin: 20px 0;
    color: #333;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.controls button {
    padding: 40px 20px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 5px;
    min-width: 120px;
    width: 120px;
}

/* Checkerboard pattern for race end */
.checkerboard {
    background: 
        linear-gradient(45deg, black 25%, transparent 25%, transparent 75%, black 75%, black),
        linear-gradient(45deg, black 25%, white 25%, white 75%, black 75%, black);
    background-size: 200px 200px; /* Size of the checkerboard squares */
    background-position: 0 0, 100px 100px; /* Offset for the second gradient to create checkerboard */
}

#yellowFlag {
    background-color: #f1c40f;
}

#yellowFlag:hover {
    background-color: #dab10e;
}

#redFlag {
    background-color: #e74c3c;
}

#redFlag:hover {
    background-color: #c0392b;
}

#restart {
    background-color: #6c757d;
}

#restart:hover {
    background-color: #5a6268;
}

/* Voice Selector */
.voice-selector {
    margin: 20px auto;
    text-align: center;
    font-family: Arial, sans-serif;
}

.voice-selector label {
    font-size: 18px;
    margin-right: 10px;
    color: #333;
}

.voice-selector select {
    padding: 5px 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
}

/* Flag Count Display */
#flagCountDisplay {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    max-width: 300px;
    margin: 20px auto;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

#flagCountDisplay h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

#flagCountDisplay p {
    margin: 5px 0;
    font-size: 16px;
    color: #555;
}

/* Audio Unlock Modal */
#audioUnlockModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#audioUnlockModal div {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    max-width: 80%;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
}

#audioUnlockModal h2 {
    margin: 0 0 15px 0;
    font-family: Arial, sans-serif;
    color: #333;
}

#audioUnlockModal p {
    margin: 0 0 20px 0;
    font-family: Arial, sans-serif;
    color: #555;
}

#unlockAudioButton {
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#unlockAudioButton:hover {
    background-color: #0056b3;
}

/* Firefox Recommendation Message */
#firefoxRecommendation {
    display: none;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 10px;
    margin: 10px 0;
    text-align: center;
    border-radius: 5px;
    font-family: Arial, sans-serif;
    max-width: 90%;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

#firefoxRecommendation p {
    margin: 0;
}

#dismissRecommendation {
    margin-top: 5px;
    padding: 5px 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#dismissRecommendation:hover {
    background-color: #0056b3;
}

/* Visual Notifications for Audio Fallback */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    10% { opacity: 1; transform: translateY(0); }
    90% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

.visual-notification {
    background-color: #fff;
    border: 2px solid #007bff;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    margin: 10px auto;
    text-align: center;
    max-width: 300px;
    animation: fadeInOut 3s forwards;
}

#visualNotificationContainer {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

/* Footer */
.footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    margin-top: 30px;
    font-size: 14px;
    color: #666;
}

.footer a {
    color: #007bff;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}