.f1-bar-container {
    width: 100%;
    max-width: 340px;
    margin: 18px auto 10px auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.f1-bar-bg {
    width: 100%;
    height: 22px;
    background: #eee;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    position: relative;
}

.f1-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff0303 0%, #ffe600 60%, #00c853 100%);
    border-radius: 12px;
    transition: width 0.7s cubic-bezier(.4, 2, .6, 1);
}

.f1-reflex-challenge-section {
    max-width: 500px;
    margin: 20px auto 0 auto;
    padding: 32px 24px;
    background: #FAE9D5;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
    text-align: center;
    position: relative;
    min-height: 420px;
    box-sizing: border-box;
}

#reflex-canvas {
    width: 100%;
    height: 100%;
    margin: 0;
    display: block;
}

/* Stop button (circular) */
.stop-btn {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #e51217;
    color: #fff;
    font-family: "Clash";
    font-weight: 900;
    font-size: 1.05rem;
    border: 0.1rem solid #eb464b;
    box-shadow: -0.1rem -0.1rem 0 #222, 0.1rem -0.1rem 0 #222, -0.1rem 0.1rem 0 #222, 0.1rem 0.1rem 0 #222, 0 0.6rem 0 #222, 0 1rem 0 rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}

.stop-btn::after {
    content: "";
    position: absolute;
    width: 70%;
    height: 28%;
    border-radius: 50%;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to top, rgba(255, 255, 255, 0.18), #ff8085);
    opacity: 0.9
}

.stop-btn:active {
    transform: scale(0.98);
}

.traffic-lights {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: calc(100% - 48px);
    max-width: 460px;
    display: flex;
    justify-content: space-between;
    margin: 0;
    gap: 22px;
    z-index: 2;
}

.traffic-light {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    background: #111;
    border-radius: 18px;
    padding: 16px 14px;
    box-shadow: 5px 10px 10px rgb(83, 83, 83);
}

.light-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.light {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #222;
    border: 3px solid #ffffff;
    transition: background 0.2s, box-shadow 0.2s;
}

.light.red {
    background: rgb(255, 0, 0);
    /* box-shadow: 0 0 12px #f44; */
}

.light.green {
    background: rgb(0, 255, 0);
    /* box-shadow: 0 0 16px #4f4; */
}

.timer {
    font-size: 2.2rem;
    font-weight: 600;
    margin: 18px 0 8px 0;
    color: #222;
}

.reflex-score-label {
    margin-top: 16px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(13, 16, 32, 0.55);
}

.reflex-score {
    margin-top: 6px;
    font-size: 4.1rem;
    font-weight: 900;
    line-height: 1;
    color: #0d1020;
}

.reflex-score-small {
    font-size: 2.2rem;
    opacity: 0.9;
}

.reflex-score-label-tight {
    margin-top: 12px;
}

/* Medium screens */
@media (max-width: 1000px) {

    .f1-reflex-challenge-section {
        max-width: 500px;
        margin: 10px auto 0 auto;
        padding: 32px 24px;
        height: 460px;
    }

    .traffic-lights {
        top: 45%;
        max-width: 460px;
        gap: 22px;
        width: calc(100% - 48px);
    }

    .traffic-light {
        padding: 16px 14px;
        border-radius: 18px;
    }

    .light {
        width: 44px;
        height: 44px;
    }

    .timer {
        font-size: 2.2rem;
    }

    .f1-bar-bg {
        height: 20px;
    }
}

@media (max-width: 800px) {

    .f1-reflex-challenge-section {
        max-width: 500px;
        margin: 10px auto 0 auto;
        padding: 32px 24px;
        height: 460px;
    }

    .reflex-score-small {
        font-size: 1.8rem;
    }

    .traffic-lights {
        top: 45%;
        max-width: 460px;
        gap: 22px;
        width: calc(100% - 48px);
    }

    .traffic-light {
        padding: 16px 14px;
        border-radius: 18px;
    }

    .light {
        width: 44px;
        height: 44px;
    }

    .timer {
        font-size: 2.2rem;
    }

    .stop-btn {
        width: 72px;
        height: 72px;
        font-size: 0.95rem
    }

    .f1-bar-bg {
        height: 15px;
    }
}

@media (max-width: 600px) {

    .f1-reflex-challenge-section {
        max-width: 90%;
        margin: 20px auto 0 auto;
        padding: 12px 14px;
    }

    .traffic-lights {
        left: 50%;
        top: 45%;
        max-width: 360px;
        gap: 12px;
        width: calc(100% - 48px);
    }

    .timer {
        font-size: 1.4rem;
        margin: 10px 0 6px 0;
    }

    .reflex-score {
        font-size: 2.3rem;
    }

    .reflex-score-small {
        font-size: 1.2rem;
    }

    .reflex-score-label {
        font-size: 0.8rem;
    }

    .stop-btn {
        width: 64px;
        height: 64px;
        font-size: 0.85rem
    }

    /* show only first 3 traffic lights on very small screens */
    .traffic-lights .traffic-light:nth-child(n+4) {
        display: none;
    }

    .f1-bar-bg {
        height: 10px;
    }
}