/* Kontener zewnętrzny dla responsywności */
.hubx-race-wrapper {
    display: inline-flex;
    justify-content: center;
    width: auto;
    margin: 15px;
}

/* Główny Box */
.hubx-race-card {
    display: block;
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    text-decoration: none !important;
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1); /* Bardziej płynna animacja */
    overflow: hidden;
    color: inherit;
    
    /* WYMIARY */
    width: 100%; 
    max-width: 220px; /* Węższe boxy */
    margin: 0 auto 30px;
    
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

/* EFEKT HOVER */
.hubx-race-card:hover {
    border-bottom: 3px solid #e64522; /* 3px pomarańczowa rampa na dole */
    box-shadow: 0 8px 25px rgba(230, 69, 34, 0.4);
    transform: translateY(-3px);
}

.hubx-race-card:hover .hubx-race-title {
    color: #e64522; /* Zmiana koloru tytułu po najechaniu */
}

/* EFEKT LOSOWEGO PODSKOKU (dodawany przez JS) */
.hubx-race-card.random-jump {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35); /* Ciemniejszy szary cień */
    transform: translateY(-8px) scale(1.04); /* Ciut wyżej i delikatne powiększenie */
    /* Brak pomarańczowej ramki i zmiany koloru tekstu */
}

/* Zdjęcie */
.hubx-card-image-wrapper {
    width: 100%;
    height: 220px; /* Nieco niższe przy tej szerokości */
    background: #fff;
    position: relative;
    overflow: hidden;
}

.hubx-card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: top center; /* Wyrównanie do góry */
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
    /* Domyślny clip-path */
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%);
}

.hubx-race-card:hover .hubx-card-image {
    transform: scale(1.08);
}

/* Treść */
.hubx-card-content {
    background: #fff;
    padding: 0 10px 25px;
    text-align: center;
    position: relative;
    z-index: 5;
    margin-top: -25px; /* Wciągnięcie pod góry */
}

/* Przycisk */
.hubx-fake-button {
    display: inline-block;
    background-color: #e64522;
    color: #fff;
    padding: 10px 15px;
    border-radius: 20px;
    
    /* FONT */
    font-family: 'Montserrat', sans-serif;
    font-weight: 700; /* Bold */
    font-size: 13px;
    
    text-transform: uppercase;
    position: relative;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(230, 69, 34, 0.2);
    transition: transform 0.3s ease;
}

/* Animacja skakania tylko po najechaniu na kartę */
.hubx-race-card:hover .hubx-fake-button {
    animation: bounce-subtle 1.5s infinite ease-in-out;
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Dziubek */
.hubx-fake-button::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #e64522 transparent transparent transparent;
}

/* Tytuł */
.hubx-race-title {
    /* FONT */
    font-family: 'Montserrat', sans-serif;
    font-weight: 900; /* Black */
    
    font-size: 32px; /* Dopasowane do szerokości 269px */
    text-transform: uppercase;
    margin: 0;
    color: #000;
    line-height: 1;
    transition: color 0.3s ease; /* Płynna zmiana koloru */
}

/* Kontener dla wielu boxów (dodane dla responsywności 1280px) */
.hubx-races-container {
    display: flex;
    flex-wrap: nowrap; /* Wymusza jedną linię */
    justify-content: center;
    gap: 15px; /* Mniejszy odstęp żeby się zmieściły */
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px; /* Marginesy na mniejszych ekranach */
    overflow-x: auto; /* Pozwala na przewijanie jeśli się nie zmieszczą na małych ekranach */
    padding-bottom: 20px; /* Miejsce na pasek przewijania */
}

.hubx-races-container .hubx-race-wrapper {
    width: auto; /* Pozwala boxom układać się obok siebie */
    flex: 0 0 auto; /* Nie rośnie, nie maleje, zachowuje swoją szerokość */
    max-width: 220px;
    margin: 0; /* Usuwa marginesy z wrappera, bo używamy gap w kontenerze */
}

/* Mobile responsive */
@media (max-width: 768px) {
    .hubx-races-container {
        flex-direction: column; /* Jeden pod drugim na mniejszych ekranach */
        align-items: center;
        overflow-x: visible;
        padding-bottom: 0;
    }
    
    .hubx-races-container .hubx-race-wrapper {
        width: 100%;
        max-width: 300px; /* Trochę szersze na mobile dla lepszego wyglądu */
    }
}

@media (max-width: 480px) {
    .hubx-race-card {
        max-width: 100%; /* Na telefonie na całą szerokość */
    }
    .hubx-card-image-wrapper {
        height: 250px;
    }
    .hubx-races-container .hubx-race-wrapper {
        max-width: 100%;
    }
}
