/* ============================================
   ROADMAP HIGHWAY - ESTILO $RDY CARTOON BRUTAL
   ============================================ */

.roadmap-highway {
    position: relative;
    min-height: 360vh;
    background: linear-gradient(180deg, #f5deb3 0%, #f0d9a8 50%, #f5deb3 100%);
    padding: 0 5%;
    overflow: hidden;
}

.roadmap-highway::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='6.5' numOctaves='8' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   BORDER FRAMES - LEFT & RIGHT
   ============================================ */
.roadmap-border-left,
.roadmap-border-right {
    position: absolute;
    top: 0;
    width: 35vw;
    min-width: 450px;
    max-width: 700px;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 0;
}

.roadmap-border-left {
    left: -8vw;
    background-image: url('webp/roadmap-border-left.webp');
    background-position: left top;
}

.roadmap-border-right {
    right: 0;
    background-image: url('webp/roadmap-border-right.webp');
    background-position: right top;
}

/* ============================================
   DECORATIVE BLOBS (LARANJA PASTEL)
   ============================================ */
.highway-blobs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    background: #FFB366;
    opacity: 0.4;
    filter: blur(40px);
}

.blob-1 {
    width: 20.83vw;
    height: 37.04vh;
    top: 10%;
    left: 5%;
}

.blob-2 {
    width: 15.63vw;
    height: 27.78vh;
    top: 40%;
    right: 8%;
}

.blob-3 {
    width: 18.75vw;
    height: 33.33vh;
    bottom: 20%;
    left: 10%;
}

.blob-4 {
    width: 13.54vw;
    height: 24.07vh;
    top: 70%;
    right: 15%;
}

/* ============================================
   SOLID DECORATIVE SHAPES (MARROM ESCURO)
   LARGE splash shapes like reference image
   ============================================ */
.highway-solid-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.solid-shape {
    position: absolute;
    background: #8B4513;
    opacity: 0.6;
}

/* Left side - Organic blob shapes */
.shape-1 {
    width: 30vw;
    height: 40vh;
    top: 3%;
    left: -15%;
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    transform: rotate(-25deg);
}

.shape-2 {
    width: 28vw;
    height: 38vh;
    top: 35%;
    left: -14%;
    border-radius: 48% 52% 38% 62% / 65% 42% 58% 35%;
    transform: rotate(15deg);
}

.shape-3 {
    width: 32vw;
    height: 42vh;
    bottom: 8%;
    left: -16%;
    border-radius: 42% 58% 70% 30% / 45% 60% 40% 55%;
    transform: rotate(-40deg);
}

/* Right side - Organic blob shapes */
.shape-4 {
    width: 34vw;
    height: 44vh;
    top: 0%;
    right: -17%;
    border-radius: 73% 27% 44% 56% / 49% 62% 38% 51%;
    transform: rotate(30deg);
}

.shape-5 {
    width: 32vw;
    height: 42vh;
    top: 38%;
    right: -16%;
    border-radius: 38% 62% 58% 42% / 53% 37% 63% 47%;
    transform: rotate(-20deg);
}

.shape-6 {
    width: 36vw;
    height: 46vh;
    bottom: 5%;
    right: -18%;
    border-radius: 57% 43% 35% 65% / 68% 45% 55% 32%;
    transform: rotate(45deg);
}

/* ============================================
   HEADER
   ============================================ */
.highway-header {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-bottom: 0;
    padding-top: 0;
}

.highway-subtitle {
    font-family: 'Fredoka One', cursive;
    font-size: 1.2rem;
    color: #654321;
    margin-top: 1rem;
    text-shadow:
        2px 2px 0 #fff,
        -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff;
}

/* ============================================
   HIGHWAY PATH CONTAINER
   ============================================ */
.highway-path-container {
    position: relative;
    width: 100%;
    max-width: 60vw;
    height: 310vh;
    margin: 0 auto;
    z-index: 5;
    transform: scale(0.75);
    transform-origin: center center;
}

/* ============================================
   SVG ROAD
   ============================================ */
.highway-road {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* SMOOTH rendering - no pixelation */
    image-rendering: auto;
    shape-rendering: auto;
}

.road-asphalt {
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.4));
}

.road-dashes {
    opacity: 0.95;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.6));
}

/* ============================================
   RENDY VEHICLE (SCROLL-DRIVEN)
   ============================================ */
.rendy-vehicle {
    position: absolute;
    width: 15vw;
    height: 15vw;
    min-width: 120px;
    min-height: 120px;
    max-width: 220px;
    max-height: 220px;
    z-index: 100;
    /* Position controlled by JS - no initial values */
    will-change: transform, left, top;
}

.rendy-illustration {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
    animation: rendyBounce 0.8s ease-in-out infinite;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

@keyframes rendyBounce {
    0%, 100% { transform: translateY(0) scaleY(1); }
    50% { transform: translateY(-4px) scaleY(1.02); }
}

.vehicle-trail {
    position: absolute;
    bottom: -1.39vw;
    left: 50%;
    transform: translateX(-50%);
    width: 3.47vw;
    height: 2.08vw;
    min-width: 30px;
    min-height: 20px;
    background: radial-gradient(ellipse, rgba(139, 69, 19, 0.5) 0%, rgba(139, 69, 19, 0.2) 50%, transparent 80%);
    border-radius: 50%;
    animation: trailFade 1s ease-in-out infinite;
    filter: blur(3px);
}

@keyframes trailFade {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.7; transform: translateX(-50%) scale(1.3); }
}

/* ============================================
   CHECKPOINTS (PINS + CARDS)
   ============================================ */
.highway-checkpoint {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 2vw;
    z-index: 50;
    opacity: 1;
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.highway-checkpoint.active {
    transform: scale(1.05);
}

.highway-checkpoint.completed {
    transform: scale(1);
}

/* Positioning checkpoints - STARTS TOP LEFT, GOES DOWN (MIRRORED) */
.checkpoint-q1 { left: -28%; top: 2%; }    /* y=150 - Q1 START (topo esquerda) */
.checkpoint-q2 { right: -28%; top: 24%; }  /* y=780 - Q2 primeira curva direita */
.checkpoint-q3 { left: -28%; top: 42%; }   /* y=1350 - Q3 segunda curva esquerda */
.checkpoint-q4 { right: -28%; top: 60%; }  /* y=1920 - Q4 terceira curva direita */
.checkpoint-q5 { left: -28%; top: 78%; }   /* y=2496 - Q5 quarta curva esquerda */
.checkpoint-q6 { right: -28%; top: 94%; }  /* y=3008 - Q6 FINISH (fundo direita) */

/* Reverse card direction for right-side checkpoints */
.checkpoint-q2,
.checkpoint-q4,
.checkpoint-q6 {
    flex-direction: row-reverse;
}

/* ============================================
   PIN (LOCATION MARKER)
   ============================================ */
.checkpoint-pin {
    position: relative;
    flex-shrink: 0;
}

.pin-circle {
    width: 4.17vw;
    height: 4.17vw;
    min-width: 60px;
    min-height: 60px;
    max-width: 70px;
    max-height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFB366 0%, #FF8C42 100%);
    border: 4px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 6px 0 #654321,
        0 10px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.highway-checkpoint:not(.active):not(.completed) .pin-circle {
    filter: grayscale(50%);
}

.highway-checkpoint.active .pin-circle {
    filter: grayscale(0%);
    transform: scale(1.15);
    box-shadow:
        0 8px 0 #654321,
        0 12px 30px rgba(255, 140, 66, 0.6),
        0 0 40px rgba(255, 179, 102, 0.5);
    animation: pinPulse 2s ease-in-out infinite;
}

@keyframes pinPulse {
    0%, 100% { transform: scale(1.15); }
    50% { transform: scale(1.2); }
}

.highway-checkpoint.completed .pin-circle {
    filter: grayscale(0%);
}

.pin-number {
    font-family: 'Luckiest Guy', cursive;
    font-size: 2rem;
    color: #000;
    text-shadow:
        2px 2px 0 rgba(255, 255, 255, 0.4),
        -1px -1px 0 rgba(0, 0, 0, 0.2);
}

.pin-stem {
    display: none;
}

/* ============================================
   CHECKPOINT CARD
   ============================================ */
.checkpoint-card {
    background: #fff;
    border: 4px solid #000;
    border-radius: 20px;
    padding: 1.8rem 2.2rem;
    min-width: 24vw;
    max-width: 28vw;
    box-shadow:
        0 6px 0 #000,
        0 10px 25px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.highway-checkpoint:not(.active):not(.completed) .checkpoint-card {
    filter: grayscale(50%);
}

.highway-checkpoint.active .checkpoint-card {
    filter: grayscale(0%);
    box-shadow:
        0 8px 0 #000,
        0 12px 35px rgba(255, 179, 102, 0.5),
        0 0 50px rgba(255, 140, 66, 0.3);
    transform: translateY(-5px);
}

.highway-checkpoint.completed .checkpoint-card {
    filter: grayscale(0%);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.3rem;
    padding-bottom: 1.2rem;
    border-bottom: 3px solid #f5deb3;
    gap: 1rem;
}

.card-header h3 {
    font-family: 'Luckiest Guy', cursive;
    font-size: 1.8rem;
    color: #000;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quarter-badge {
    background: linear-gradient(135deg, #FFB366 0%, #FF8C42 100%);
    color: #000;
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    padding: 0.6rem 1.3rem;
    border: 3px solid #000;
    border-radius: 12px;
    box-shadow: 0 4px 0 #654321;
    font-weight: bold;
}

.card-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-items li {
    font-family: 'Fredoka One', cursive;
    font-size: 1.3rem;
    color: #654321;
    margin: 0.9rem 0;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.card-items li::before {
    content: '▸';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    color: #FF8C42;
    font-weight: bold;
}

/* ============================================
   ROAD MARKERS (MARCADORES NA ESTRADA)
   ============================================ */
.road-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.road-marker {
    position: absolute;
    width: 15px;
    height: 60px;
    background: linear-gradient(180deg, #654321 0%, #8B4513 100%);
    border: 3px solid #000;
    border-radius: 8px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.road-marker::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 25px;
    background: #FFD700;
    border: 3px solid #000;
    border-radius: 50%;
    box-shadow: 0 3px 0 #654321;
}

/* ============================================
   FINISH LINE (LINHA DE CHEGADA)
   ============================================ */
.finish-line {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 80px;
    z-index: 150;
}

.finish-banner {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    border: 4px solid #000;
    border-radius: 20px;
    padding: 1rem 2rem;
    text-align: center;
    box-shadow:
        0 6px 0 #000,
        0 10px 25px rgba(0, 0, 0, 0.3);
    animation: finishPulse 2s ease-in-out infinite;
}

.finish-banner h3 {
    font-family: 'Luckiest Guy', cursive;
    font-size: 2rem;
    color: #000;
    margin: 0;
    text-shadow:
        2px 2px 0 #fff,
        -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff;
}

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

.finish-checkered {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 30px;
    background: repeating-linear-gradient(
        45deg,
        #000,
        #000 15px,
        #fff 15px,
        #fff 30px
    );
    border: 3px solid #000;
    border-radius: 5px;
    box-shadow: 0 4px 0 #654321;
}

.finish-stars {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    z-index: 100;
}

.finish-star {
    font-size: 2rem;
    animation: starTwinkle 1.5s ease-in-out infinite;
}

.finish-star:nth-child(2) {
    animation-delay: 0.3s;
}

.finish-star:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes starTwinkle {
    0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
    50% { opacity: 0.6; transform: scale(1.2) rotate(180deg); }
}

/* ============================================
   PROGRESS INDICATOR
   ============================================ */
.highway-progress {
    display: none;
}

.progress-label {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    text-align: center;
    color: #654321;
    margin-bottom: 1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.progress-track {
    width: 100%;
    height: 30px;
    background: #f5deb3;
    border: 3px solid #000;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.15);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FFB366 0%, #FF8C42 50%, #FFB366 100%);
    width: 0%;
    transition: width 0.5s ease-out;
    position: relative;
    border-right: 3px solid #000;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-family: 'Luckiest Guy', cursive;
    font-size: 1.8rem;
    text-align: center;
    color: #FF8C42;
    margin-top: 0.8rem;
    text-shadow:
        2px 2px 0 #fff,
        -1px -1px 0 #fff,
        2px -1px 0 #fff,
        -1px 2px 0 #fff,
        0 0 10px rgba(255, 140, 66, 0.3);
}

/* ============================================
   RESPONSIVE (MOBILE)
   ============================================ */
@media (max-width: 1024px) {
    .roadmap-highway,
    .roadmap-highway.roadmap-section,
    section.roadmap-highway {
        min-height: 160vh;
        padding: 1rem 0 0 0;
        overflow: visible !important;
        overflow-x: visible !important;
        max-width: none !important;
        margin-bottom: -5rem;
    }

    /* Esconder molduras no mobile */
    .roadmap-border-left,
    .roadmap-border-right {
        display: none;
    }

    /* Esconder blobs no mobile */
    .highway-blobs {
        display: none;
    }

    /* Shapes marrons - mostrar parcialmente nas laterais */
    .highway-solid-shapes {
        display: block;
        opacity: 0.4;
    }

    .solid-shape {
        transform: scale(0.6);
    }

    .highway-header {
        margin-bottom: 2rem;
        margin-top: -5rem;
        padding-top: 0;
    }

    .highway-header .section-title {
        margin-bottom: 1.5rem;
    }

    .highway-subtitle {
        font-size: 0.7rem;
        margin-top: 0.3rem;
    }

    .highway-path-container {
        max-width: 100vw;
        width: 100%;
        height: 180vh;
        transform: scale(0.85) scaleY(1.15);
        transform-origin: top center;
        overflow: visible !important;
    }

    .rendy-vehicle {
        width: 70px;
        height: 70px;
        min-width: 60px;
        min-height: 60px;
    }

    /* Remover qualquer corte nas laterais */
    .highway-road,
    .highway-road svg {
        overflow: visible !important;
    }

    .highway-checkpoint {
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.2rem;
    }

    /* Pins menores no mobile */
    .checkpoint-pin {
        display: block;
    }

    .pin-circle {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-width: 2px;
        box-shadow: 0 3px 0 #654321;
        /* Removido scaleY para evitar distorcao na animacao */
    }

    .pin-number {
        font-size: 1.1rem;
    }

    /* Desativar animacao de pulse no mobile para evitar distorcao */
    .highway-checkpoint.active .pin-circle {
        animation: none !important;
        transform: scale(1.1) !important;
    }

    /* Cards centralizados e compactos */
    .checkpoint-q1,
    .checkpoint-q2,
    .checkpoint-q3,
    .checkpoint-q4,
    .checkpoint-q5,
    .checkpoint-q6 {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
    }

    /* Manter centralizado mesmo quando active/completed - SEM scale para evitar distorcao */
    .highway-checkpoint.active,
    .highway-checkpoint.completed {
        transform: translateX(-50%) !important;
    }

    .highway-checkpoint:not(.active):not(.completed) {
        transform: translateX(-50%) !important;
    }

    .checkpoint-q1 { top: 10%; }
    .checkpoint-q2 { top: 26%; }
    .checkpoint-q3 { top: 40%; }
    .checkpoint-q4 { top: 54%; }
    .checkpoint-q5 { top: 68%; }
    .checkpoint-q6 { top: 82%; }

    .checkpoint-card {
        min-width: 65vw;
        max-width: 75vw;
        padding: 0.6rem 0.8rem;
        border-width: 2px;
        border-radius: 10px;
        box-shadow: 0 3px 0 #000;
    }

    .card-header {
        margin-bottom: 0.35rem;
        padding-bottom: 0.35rem;
        border-bottom-width: 2px;
        gap: 0.4rem;
    }

    .card-header h3 {
        font-size: 0.7rem;
    }

    .quarter-badge {
        font-size: 0.5rem;
        padding: 0.15rem 0.4rem;
        border-width: 2px;
        border-radius: 5px;
        box-shadow: 0 2px 0 #654321;
    }

    .card-items li {
        font-size: 0.55rem;
        margin: 0.15rem 0;
        padding-left: 0.7rem;
        line-height: 1.25;
    }

    .card-items li::before {
        font-size: 0.6rem;
    }

    .highway-progress {
        max-width: 85vw;
        padding: 1rem 1.5rem;
    }

    .progress-label {
        font-size: 0.9rem;
    }

    .progress-percentage {
        font-size: 1.2rem;
    }

    .finish-line {
        width: 250px;
        height: 60px;
    }

    .finish-banner h3 {
        font-size: 1.5rem;
    }

    .finish-checkered {
        width: 200px;
        height: 25px;
    }

    .finish-star {
        font-size: 1.5rem;
    }

    .road-marker {
        width: 12px;
        height: 45px;
    }

    .road-marker::before {
        width: 20px;
        height: 20px;
    }
}
