body{font-family:'Poppins',sans-serif;background-color:#f5f5f5;margin:0;padding:0;box-sizing:border-box}h1,h2{text-align:center;color:#333}.season-selector{margin:20px auto;width:90%;max-width:500px;background-color:#fff;border-radius:10px;padding:10px;box-shadow:0 5px 15px rgba(0,0,0,0.1)}label{font-size:18px;margin-bottom:10px;display:block;color:#555}select{width:100%;padding:12px;border-radius:8px;border:1px solid #ddd;font-size:16px;background-color:#f9f9f9;overflow:hidden}.event-list{display:flex;flex-wrap:wrap;justify-content:center;gap:20px;padding:20px}.event-item{background-color:#fff;border-radius:12px;box-shadow:0 10px 20px rgba(0,0,0,0.1);width:100%;max-width:320px;transition:transform 0.3s ease-in-out,box-shadow 0.3s ease-in-out;overflow:hidden;opacity:0;transform:translateY(20px);transition:opacity 0.5s ease,transform 0.5s ease}.event-item:hover{transform:translateY(-10px);box-shadow:0 20px 30px rgba(0,0,0,0.2)}.event-item img{width:100%;height:auto}.event-content{padding:15px;display:flex;align-items:center}.event-content .col-3{flex:0 0 30%;max-width:30%}.event-content .col-9{flex:0 0 70%;max-width:70%}.event-content h3{font-size:20px;color:#333;margin:0}.event-content p{font-size:14px;color:#555;margin:10px 0}.event-content .details{display:flex;justify-content:space-between;font-size:14px;color:#888}.racecourse-logo{text-align:center;margin-bottom:15px}.racecourse-logo img{max-height:70px;max-width:100%;object-fit:contain}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@media(max-width:768px){.event-list{flex-direction:column;align-items:center}.season-selector{width:95%}}@media(max-width:500px){.event-item{max-width:100%}h1{font-size:24px}h2{font-size:18px}}.event-item.visible{opacity:1;transform:translateY(0)}.race-count{font-size:1.5em;color:#007bff}.season-selector option{opacity:0;transform:translateX(-20px);transition:opacity 0.3s ease,transform 0.3s ease}.season-selector select:focus option{opacity:1;transform:translateX(0)}

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination button {
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}

.pagination button:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
    background-color: #007bff;
    color: #fff;
}

.pagination span {
    font-size: 1.2rem;
    font-weight: 600;
    color: #007bff;
}

#scrollToTop {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s ease, visibility 0.9s ease, transform 0.9s ease;
}

#scrollToTop:hover {
    background-color: #0056b3;
    transform: scale(1.2) rotate(360deg);
}

#scrollToTop:active {
    animation: bounce 0.3s ease;
}

@keyframes bounce {
    0% {
        transform: scale(1) translateY(0);
    }
    50% {
        transform: scale(1.1) translateY(-5px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

/* --- Event card polish: richer entrance, hover shine, live status pulse,
   and the horse/track fallback icon (shown when a racecourse has no logo
   or its logo fails to load). These are intentionally NOT gated behind
   prefers-reduced-motion — they're small, purposeful UI motion, not
   decorative chrome, and should always be visible. --- */

.event-item {
    position: relative;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.event-item.visible {
    transform: translateY(0) scale(1);
}

.event-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
    pointer-events: none;
    z-index: 2;
}

.event-item:hover::before {
    left: 130%;
}

.status-badge.status-upcoming {
    color: orange;
}

.status-badge.status-finished,
.status-badge.status-live {
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    padding: 5px;
    border-radius: 5px;
    display: inline-block;
}

.status-badge.status-finished {
    color: green;
    background-color: #d4edda;
}

.status-badge.status-live {
    color: red;
    background-color: #f8d7da;
    animation: liveBlink 1.4s ease-in-out infinite;
}

@keyframes liveBlink {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 rgba(220, 53, 69, 0);
    }
    50% {
        opacity: 0.78;
        box-shadow: 0 0 8px rgba(220, 53, 69, 0.5);
    }
}

.racecourse-fallback {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 42px;
}

.racecourse-fallback-flag {
    transform-origin: 14px 2px;
    animation: flagWave 1.6s ease-in-out infinite;
}

@keyframes flagWave {
    0%, 100% {
        transform: skewY(-8deg);
    }
    50% {
        transform: skewY(-2deg);
    }
}

.racecourse-fallback-horse {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 1.1rem;
    color: #212529;
    animation: horseBob 1.2s ease-in-out infinite;
}

@keyframes horseBob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}
