body {
    font-family: 'Inter', sans-serif;
    text-align: center;
    background-color: #222;
    background: url('/speedway-reflex/bg_track_pl_grudziadz.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/speedway-reflex/start_done_min.gif') center center / cover no-repeat;
    z-index: 2; /* Zmieniono z 999 na -1, aby tło było poniżej innych elementów */
    display: none; /* Domyślnie ukryty */
}

.header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 20px;
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    box-sizing: border-box;
}

#traffic-light {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid black; /* Czarna obwódka */
    transition: background-color 0.3s;
}

.orange-light {
    background-color: orange;
}

.red-light {
    background-color: red;
}

.green-light {
    background-color: green;
}

@keyframes blink {
    0%, 100% { background-color: orange; }
    50% { background-color: transparent; }
}

.times {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ncd, .oc {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    padding: 5px;
    font-weight: bold;
    width: 80px;
}

.ncd {
    background-color: black;
    color: white;
}

.oc {
    background-color: black;
    color: white;
}

.time-value {
    background-color: white;
    color: black;
    border: 1px solid black;
    margin-left: 5px;
    padding: 5px;
}

.track-container {
    position: relative;
    width: 100%;
    height: 75vh;
    overflow: hidden;
}

.track {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 100%;
    position: absolute;
    bottom: 25vh;
}

.lane {
    width: 100%;
    height: 7px;
    background-color: white;
    margin: 5px 0;
    position: relative;
}

#clutch {
    width: 90%; /* 90% szerokości */
    height: 80px;
    background: linear-gradient(to bottom, #e6e6e6, #ccc);
    color: black;
    border: none;
    font-size: 24px;
    position: absolute;
    bottom: 20px; /* Dodanie marginesu od dołu */
    left: 5%; /* wycentrowanie */
    transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    animation: wave 2s infinite;
}

#clutch.pressed {
    background-color: #aaa;
    transform: scale(0.8);
    animation: shake 0.1s infinite;
}

@keyframes wave {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2.5px); }
    75% { transform: translateX(2.5px); }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Wyższy z-index aby był nad tłem */
}

.modal-content {
    background: white;
    padding: 20px;
    text-align: center;
    border-radius: 10px;
}

.result-text {
    font-size: 48px;
    font-weight: bold;
    background-color: black;
    color: white;
    padding: 20px;
    margin: 10px;
    border-radius: 10px;
}

.result-text.red {
    font-size: 30px;
    background-color: red;
    color: white;
}

.modal-buttons {
    margin-top: 20px;
}

#instruction-modal .modal-content {
    width: 80%;
    max-width: 600px;
}

.retry-button {
    background-color: rgb(59, 59, 59);
    color: white;
    width: 100%;
    padding: 15px 30px;
    border: none;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
}

.exit-button {
    background-color: transparent;
    color: red;
    border: 2px solid red;
    padding: 10px 20px;
    width: 100%;
    margin-top: 5px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
}

.start-game-button {
    background-color: green;
    color: white;
    padding: 15px 30px;
    border: none;
    font-size: 18px;
    cursor: pointer;
    border-radius: 5px;
}
