body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom, #0f172a, #020617);
    overflow: hidden;
    color: white;
    text-align: center;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

h2 {
    font-size: clamp(24px, 3vw, 42px);

    color: #38bdf8;

    text-shadow:
        0 0 15px #38bdf8;

    margin:
        8px 0 12px;
}

.race-track {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    border-radius: 25px;
    border: 3px solid #38bdf8;
    background:
        linear-gradient(to bottom,
            #111827,
            #1e293b);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
}

.track-lines {
    position: absolute;
    width: 200%;
    height: 100%;
    background-image:
        repeating-linear-gradient(to right,
            transparent 0px,
            transparent 40px,
            rgba(255, 255, 255, 0.05) 40px,
            rgba(255, 255, 255, 0.05) 80px);

    animation: trackMove 2s linear infinite;
}

@keyframes trackMove {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-80px);
    }
}

.racer {
    position: absolute;
    width: 220px;
    height: 220px;
    left: 0;
    transition: left 0.8s ease;
    animation: bikeBounce 1s infinite alternate;
}

@keyframes bikeBounce {
    from {
        transform: translateY(0px);
    }

    to {
        transform: translateY(-5px);
    }
}

.top {
    top: 30px;
}

.bottom {
    bottom: 30px;
}

#racer1 {
    background-image: url('https://raw.githubusercontent.com/viniciusdmorais/bikepoints/refs/heads/main/assets/img/ciclista1.png');
    /*background-image: url('../img/ciclista1.png');*/
    background-size: contain;
    background-repeat: no-repeat;
}

#racer2 {
    background-image: url('https://raw.githubusercontent.com/viniciusdmorais/bikepoints/refs/heads/main/assets/img/ciclista2.png');
    /*background-image: url('../img/ciclista2.png');*/
    background-size: contain;
    background-repeat: no-repeat;
}

.finish-line {
    position: absolute;
    right: 30px;
    top: 0;
    width: 15px;
    height: 100%;
    background:
        repeating-linear-gradient(white 0px,
            white 20px,
            black 20px,
            black 40px);
}

.scores {
    margin-top: 25px;
}

.locked {
    opacity: 0.3;
    pointer-events: none;
}

input,
button {
    padding: 12px;
    border-radius: 12px;
    border: none;
    margin: 5px;
    font-size: 16px;
}

button {
    background: #38bdf8;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

button:hover {
    transform: scale(1.05);
    background: #0ea5e9;
}

.score-display {
    display: flex;

    justify-content: center;

    gap: 14px;

    margin-top: 10px;

    flex-wrap: wrap;
}

.player-card {
    background:
        rgba(255, 255, 255, 0.08);

    padding:
        clamp(8px, 1vw, 14px) clamp(18px, 2vw, 28px);

    border-radius: 20px;

    backdrop-filter: blur(8px);

    box-shadow:
        0 0 15px rgba(255, 255, 255, 0.1);
}

.winner-banner {
    margin-top: 12px;

    font-size:
        clamp(24px, 4vw, 48px);

    font-weight: bold;

    animation:
        pulse 1s infinite;
}

.hidden {
    display: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

/* vento */

.wind {
    position: absolute;
    width: 300px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    animation: windMove 4s linear infinite;
}

.wind2 {
    top: 30%;
    animation-duration: 6s;
}

.wind3 {
    top: 70%;
    animation-duration: 5s;
}

@keyframes windMove {
    from {
        transform: translateX(-400px);
    }

    to {
        transform: translateX(1600px);
    }
}

/* ========================= */
/* RESPONSIVIDADE MOBILE */
/* ========================= */

@media (max-width: 768px) {

    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .container {
        width: min(1400px, 96vw);
        height: 100vh;

        margin: auto;

        padding: 10px;

        box-sizing: border-box;

        display: flex;
        flex-direction: column;

        justify-content: center;
        align-items: center;
    }

    h1 {
        font-size: 22px;
        margin-top: 10px;
    }

    h2 {
        font-size: 26px;
        margin: 10px 0;
    }

    .password-box {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: center;
        margin-bottom: 10px;
    }

    .password-box input,
    .password-box button {
        width: 90%;
        max-width: 320px;
    }

    .race-track {
        position: relative;

        width: 100%;

        height: clamp(260px, 52vh, 520px);

        overflow: hidden;

        border-radius: 25px;

        border: 3px solid #38bdf8;

        background:
            linear-gradient(to bottom,
                #111827,
                #1e293b);

        box-shadow:
            0 0 30px rgba(56, 189, 248, 0.5);
    }

    .racer {
        position: absolute;

        width: clamp(110px, 14vw, 220px);
        height: clamp(110px, 14vw, 220px);

        left: 0;

        transition:
            left 0.8s ease;

        animation:
            bikeBounce 1s infinite alternate;
    }

    .top {
        top: 35px;
    }

    .bottom {
        bottom: 35px;
    }

    .finish-line {
        right: 15px;
        width: 10px;
    }

    .score-display {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-top: 14px;
    }

    .player-card {
        width: 90%;
        max-width: 320px;
        padding: 10px;
    }

    .scores {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-top: 14px;
    }

    .scores input,
    .scores button {
        width: 90%;
        max-width: 320px;
    }

    .winner-banner {
        font-size: 26px;
        padding: 10px;
    }
}

@media (max-width: 480px) {

    h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 22px;
    }

    .race-track {
        height: 300px;
    }

    .racer {
        width: 105px;
        height: 105px;
    }

    .top {
        top: 42px;
    }

    .bottom {
        bottom: 42px;
    }

    .player-card h3 {
        font-size: 17px;
    }

    .player-card span {
        font-size: 22px;
    }

    input,
    button {
        font-size: 15px;
        padding: 10px;
    }
}