
/* ===============================================
   Stage 9: Dodge Game Styles
   =============================================== */
.dodge-highway {
    position: absolute;
    width: 140px;
    height: 100%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
    border-radius: 10px;
    overflow: hidden;
}

.dodge-highway::before,
.dodge-highway::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 200%;
    top: -100%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(46, 204, 113, 0.4) 0px,
        rgba(46, 204, 113, 0.4) 40px,
        transparent 40px,
        transparent 60px
    );
    animation: lane-move 0.7s linear infinite;
    z-index: 0;
}

.dodge-highway::before {
    left: 5px;
}

.dodge-highway::after {
    right: 5px;
}

.dodge-lane {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
}

.dodge-lane::before {
    content: '';
    position: absolute;
    right: 0;
    top: -100%;
    width: 2px;
    height: 200%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.5) 0px,
        rgba(255, 255, 255, 0.5) 30px,
        transparent 30px,
        transparent 50px
    );
    animation: lane-move 0.7s linear infinite;
}

@keyframes lane-move {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(50px);
    }
}

.collision-bang {
    position: absolute;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 59, 48, 0.9) 0%, rgba(255, 149, 0, 0.6) 50%, transparent 80%);
    pointer-events: none;
    z-index: 10;
    animation: bang-effect 0.3s ease-out forwards;
}

@keyframes bang-effect {
    0% {
        transform: translate(-50%, -50%) scale(0.3);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.dodge-lane:last-of-type {
    left: 50%;
}

.dodge-lane:last-of-type::before {
    display: none;
}

.dodge-marker {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 215, 0, 0.6);
    z-index: 1;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.player-car {
    position: absolute;
    top: 92%;
    width: 28px;
    height: 50px;
    background: linear-gradient(180deg, #3498db 0%, #2980b9 100%);
    border-radius: 8px 8px 4px 4px;
    transition: left 0.3s ease;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.player-car::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.player-car::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 8px;
    bottom: 8px;
    width: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.incoming-car {
    position: absolute;
    width: 28px;
    height: 50px;
    border-radius: 8px 8px 4px 4px;
    transition: left 0.1s ease, top 0.016s linear, background 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
}

/* Inactive state - gray, not yet activated */
.incoming-car-inactive {
    background: linear-gradient(180deg, #7f8c8d 0%, #95a5a6 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* Active state - red with pulsing glow (all cars after activation) */
.incoming-car-active {
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    animation: pulse-active 1s ease-in-out infinite;
}

/* Pulsing glow animation for activated cars */
@keyframes pulse-active {
    0%, 100% {
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.8), 0 0 25px rgba(231, 76, 60, 0.5);
    }
    50% {
        box-shadow: 0 0 25px rgba(231, 76, 60, 1), 0 0 40px rgba(231, 76, 60, 0.7);
    }
}

.incoming-car::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 8px;
    bottom: 8px;
    width: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.incoming-car::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 8px;
    bottom: 8px;
    width: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.dodge-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    z-index: 5;
    pointer-events: none;
}

.dodge-tap-zone {
    flex: 1;
    position: relative;
    pointer-events: auto;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}

.dodge-tap-left {
    justify-content: flex-start;
    padding-left: 30px;
}

.dodge-tap-right {
    justify-content: flex-end;
    padding-right: 30px;
}

.dodge-arrow {
    width: 0;
    height: 0;
    border-style: solid;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.dodge-tap-left .dodge-arrow {
    border-width: 25px 35px 25px 0;
    border-color: transparent rgba(255, 255, 255, 0.7) transparent transparent;
}

.dodge-tap-right .dodge-arrow {
    border-width: 25px 0 25px 35px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.7);
}

.dodge-tap-zone:active .dodge-arrow {
    opacity: 1;
    transform: scale(1.2);
}

[data-theme="dark"] .dodge-highway {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .dodge-lane {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .dodge-highway {
        background: linear-gradient(to right, #1a1a2e 0%, #16213e 100%);
    }
    
    :root:not([data-theme="light"]) .dodge-lane {
        border-bottom-color: rgba(255, 255, 255, 0.2);
    }
}

