.timingHeader {
    color: black;
    padding: 20px;
    font-size: 16px;
    position: relative;
}

.racerRowStacked .positionContainer {
    position: absolute;
    top: 0;
    left: 5;
    width: 40px;
    height: 100%;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center
}

#race-header {
    transition: background-color 0.5s ease, height 0.5s ease;
}
.racerRowStacked {
    position: relative;
    width: 100%; 
    height: 80px;
    background-color: #000;
    border-bottom: 1px solid #afafaf;
    color: #fff;
    overflow: hidden
}

.racerRowStacked .racerRowItem {
    position: absolute
}

.racerRowStacked .row1 {
    top: 2px
}

.racerRowStacked .row2 {
    top: 30px;
    width: 80%;
}

.racerRowStacked .row3 {
    top: 50px;
    width: 80%;
}

.racerRowStacked .additionalData {
    position: absolute;
    right: 10px;
    width: 40%;
    height: 25px;
    overflow: hidden;
    text-align: right;
    font-size: 14px;
}

.racerRowStacked .racerName {
    font-size: 18px;
    white-space: nowrap
}

.racerRowStacked .position {
    font-size: 18px;
    font-weight: bold;
}

.racerRowStacked .racerCategory {
    margin-left: 10px;
    color: #ccc
}

.racerRowStacked .lapsLabel {
    left: 0;
    width: 40px;
    font-size: 14px;
    white-space: nowrap
}

.racerRowStacked .lapsValue {
    left: 0;
    width: 35px;
    font-size: 14px;
    white-space: nowrap;
    font-weight: bold;
}

.racerRowStacked .lastTimeLabel {
    left: 65px;
    width: 60px;
    font-size: 14px;
    white-space: nowrap
}

.racerRowStacked .lastTimeValue {
    left: 70px;
    width: 80px;
    font-size: 14px;
    white-space: nowrap;
    font-weight: bold;
}

.racerRowStacked .bestLapLabel {
    left: 280px;
    width: 55px;
    white-space: nowrap;
    font-size: 14px;
}

.racerRowStacked .bestLapValue {
    left: 280px;
    width: 35px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: bold;
}

.racerRowStacked .bestTimeLabel {
    left: 450px;
    width: 65px;
    white-space: nowrap;
    font-size: 14px;
}

.racerRowStacked .bestTimeValue {
    left: 450px;
    width: 60px;
    font-size: 14px;
    white-space: nowrap;
    font-weight: bold;
}

.racerRowStacked .diffLabel,.racerRowStacked .diffValue {
    left: 260px;
    width: 60px;
    text-align: right;
    white-space: nowrap;
    font-size: 14px;
}

.racerRowStacked .gapLabel,.racerRowStacked .gapValue {
    left: 480px;
    width: 60px;
    text-align: right;
    white-space: nowrap;
    font-size: 14px;
}

/* Make the leaderboard scrollable on mobile */
@media (max-width: 700px) {
    #race-leaderboard {
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        max-width: 100%; 
    }

    .racerRowStacked {
        overflow-x: auto; 
    }
}

/* Flashing effect for "Last Lap" */
.flash-white {
    background-color: white;
    color: black;
    animation: flash 3s ease-in-out;
}

@keyframes flash {
    0% { background-color: white; color: black; }
    50% { background-color: green; color: white; } 
    100% { background-color: white; color: black; }
}

#race-header.checker-flag-animation {
    background: url('https://graftonspeedway.com.au/wp-content/uploads/2024/12/checkerflagwavingflag.gif') no-repeat center center;
    background-size: contain; /* Scale the flag to fit inside the header */
    animation: waveFlag 5s ease-in-out forwards; /* Adjust duration */
    position: relative;
    overflow: hidden; /* Prevent overflow outside the header */
}


