.content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-heading { 
    text-align: center;
    padding-bottom: 20px;
}

.section-heading img { 
    display: block;
    margin: 0 auto;
}

h3 {
    text-align: center;
    font-weight: bold !important;
    color: #000000;
    margin: 10px 0 5px 0;
    font-size: 20px !important;
}

.events-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.event-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.event-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.event-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

/* === TRẠNG THÁI ĐÈ LÊN ẢNH - GÓC PHẢI TRÊN === */
.event-status {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 13px;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 20px;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    text-align: center;
}

/* MÀU THEO YÊU CẦU ANH */
.status-sắp-diễn-ra {
    background: #83ff49 !important;
    color: #ff0000 !important;
}

.status-đang-diễn-ra {
    background: #fffb00 !important;
    color: #ff0000 !important;
}

.status-đã-diễn-ra {
    background: #ff0000 !important;
    color: #ffffff !important;
}

/* Nội dung bên dưới */
.event-content {
    padding: 5px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    margin: 0 0 0px;
    font-size: 17px;
    font-weight: bold;
    color: #333;
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.event-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding: 0 15px 15px;
}

.btn-register,
.btn-select {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-register { background: #628cffff; color: white; }
.btn-register:hover { background: #4a78e0; }
.btn-select   { background: #ffb783; color: #333; }
.btn-select:hover { background: #ff8c4d; color: white; }

.no-events {
    text-align: center;
    color: #999;
    font-size: 18px;
    padding: 40px;
    grid-column: 1 / -1;
}

/* === BỘ LỌC Offline / School === */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 0px 0 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 28px;
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #628cffff;
    border-radius: 30px;
    background: white;
    color: #628cffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #628cffff;
    color: white;
}

.filter-btn.active {
    background: #628cffff;
    color: white;
    box-shadow: 0 4px 12px rgba(98, 140, 255, 0.4);
}

/* ============================================================= */
/* RESPONSIVE: 2 cột đến 520px → 1 cột khi < 520px (điện thoại dọc) */
/* ============================================================= */
@media (max-width: 789px) {
    .container { padding: 00px 10px 10px; }
    .page-title { font-size: 22px; margin-bottom: 10px; }

    .event-img { height: 160px; }
    .event-title { font-size: 15px; }
    .event-status { font-size: 11px; padding: 5px 9px; top: 8px; right: 8px; }

    .btn-register,
    .btn-select {
        font-size: 13px;
        padding: 8px;
        gap: 4px;
    }
    .btn-register i,
    .btn-select i { font-size: 12px; }
}

@media (max-width: 550px) {
    .event-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .filter-bar {
        gap: 10px;
    }
    .filter-btn {
        padding: 9px 20px;
        font-size: 14px;
    }
}

/* CSS ĐƯỜNG ĐUA */
/* Club CTA Full-width - Vạch đích đứng full height */
.club-cta-fullwidth {
    width: 100%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    padding: 0px 0 0px;
    margin: 0px 0 0px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    height: 100px;
    min-height: 100px;
}

.club-cta-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

/* Vạch đích đứng full height container, caro trắng đen */
.finish-line-vertical {
    position: absolute;
    right: 200px; /* Cách nút một chút */
    top: 0;
    bottom: 0;
    width: 30px;
    height: 100px;
    background: repeating-linear-gradient(
        45deg,
        #fff,
        #fff 5px,
        #000 5px,
        #000 15px
    );
    border-left: 1px solid #fff;
    border-right: 1px solid #fff;
    box-shadow: -4px 0 15px rgba(0,0,0,0.3), 4px 0 15px rgba(0,0,0,0.3);
    z-index: 2;
}

/* Pháo hoa khi bé đầu về đích */
.fireworks {
    position: absolute;
    right: 140px; /* Gần vạch đích */
    top: 50%;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    pointer-events: none;
    opacity: 0;
    z-index: 4;
}

.fireworks.active {
    animation: fireworksExplode 1.5s ease-out forwards;
}

@keyframes fireworksExplode {
    0%   { opacity: 0; transform: translateY(-50%) scale(0.5); }
    30%  { opacity: 1; transform: translateY(-50%) scale(1.3); }
    100% { opacity: 0; transform: translateY(-50%) scale(2); }
}

/* 6 cậu bé chạy - kích thước nhỏ, đè lên vạch đích */
/* 6 cậu bé chạy - animation kép: ngang + nhún lên xuống */
.boy-running {
    position: absolute;
    width: 50px;           /* kích thước bé, có thể chỉnh nhỏ hơn nếu cần */
    height: auto;
    z-index: 3;
    pointer-events: none;
    left: -80px;           /* bắt đầu ngoài màn hình bên trái */
}

/* Animation chạy ngang (giữ logic về đích và quay đầu) */
@keyframes runHorizontal {
    0%   { left: -80px; transform: scaleX(1); opacity: 1; }
    88%  { left: calc(100% - 240px); transform: scaleX(1); opacity: 1; }
    92%  { left: calc(100% - 240px); transform: scaleX(-1); opacity: 0; } /* ẩn khi về đích */
    100% { left: -80px; transform: scaleX(-1); opacity: 0; } /* reset */
}

/* Animation nhún lên xuống (sóng sine nhẹ nhàng) */
@keyframes bobUpDown {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }  /* độ cao nhún, chỉnh số này để mạnh/yếu hơn */
}

@keyframes sway {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(4deg); }
    75%      { transform: rotate(-4deg); }
}

.boy-running {
    animation: 
        runHorizontal 11s infinite linear,
        bobUpDown 1.6s infinite ease-in-out,
        sway 3.2s infinite ease-in-out;   /* lắc nhẹ */
}

/* Áp dụng cho từng bé - thời gian chạy ngang khác nhau + thời gian nhún hơi lệch pha cho tự nhiên */
.boy1 {
    top: 5px;
    animation: 
        runHorizontal 11s infinite linear,
        bobUpDown 1.6s infinite ease-in-out;
}

.boy2 {
    top: 10px;
    animation: 
        runHorizontal 10s infinite linear,
        bobUpDown 1.8s infinite ease-in-out;
}

.boy3 {
    top: 20px;
    animation: 
        runHorizontal 8s infinite linear,
        bobUpDown 1.4s infinite ease-in-out;
}

.boy4 {
    top: 30px;
    animation: 
        runHorizontal 14s infinite linear,
        bobUpDown 2.0s infinite ease-in-out;
}

.boy5 {
    top: 40px;
    animation: 
        runHorizontal 9s infinite linear,
        bobUpDown 1.7s infinite ease-in-out;
}

.boy6 {
    top: 50px;
    animation: 
        runHorizontal 12s infinite linear,
        bobUpDown 1.9s infinite ease-in-out;
}



/* Nút CTA - nằm giữa theo chiều dọc, cách mép phải 30px */
.club-cta-btn-desktop {
    font-size: 1.3rem;
    padding: 10px 35px;
    z-index: 3;
    white-space: nowrap;
    position: absolute;
    color: #ffffff;
    top: 50%;
    right: 0px;
    transform: translateY(-50%);
}

/* Responsive - gộp tất cả cùng breakpoint vào 1 khối */
@media (max-width: 992px) {
    .boy-running { width: 50px; }
    .finish-line-vertical { width: 70px; right: 140px; }
    .club-cta-btn { font-size: 1.2rem; padding: 9px 30px; }

    .boy-running { width: 48px; }
    .finish-line-vertical { 
        width: 60px; 
        right: 160px; 
    }
    .club-cta-btn { 
        font-size: 1.2rem; 
        padding: 9px 30px; 
        right: 30px; 
    }
}

@media (max-width: 768px) {
    .club-cta-fullwidth {
        height: 90px;
        min-height: 90px;
    }
    .finish-line-vertical { width: 60px; right: 120px; }
    .boy-running { width: 45px; }
    .club-cta-btn { font-size: 1.1rem; padding: 8px 25px; }

    /* Giữ nguyên đường đua + bé chạy, chỉ giảm kích thước nhẹ */
    .finish-line-vertical {
        width: 50px;
        right: 0;                           /* SÁT LỀ PHẢI luôn */
        border-left: 2px solid #fff;
        border-right: none;
    }
    .boy-running {
        width: 45px;
    }
    .boy1 { top: 4px; }
    .boy2 { top: 9px; }
    .boy3 { top: 18px; }
    .boy4 { top: 27px; }
    .boy5 { top: 36px; }
    .boy6 { top: 45px; }

    /* Giảm thời gian hoàn thành animation runHorizontal ~30% so với desktop */
    .boy1 {
        animation: 
            runHorizontal 7.7s infinite linear,   /* từ 11s → 7.7s (giảm 30%) */
            bobUpDown 1.6s infinite ease-in-out;
    }
    .boy2 {
        animation: 
            runHorizontal 7s infinite linear,     /* từ 10s → 7s */
            bobUpDown 1.8s infinite ease-in-out;
    }
    .boy3 {
        animation: 
            runHorizontal 5.6s infinite linear,   /* từ 8s → 5.6s */
            bobUpDown 1.4s infinite ease-in-out;
    }
    .boy4 {
        animation: 
            runHorizontal 9.8s infinite linear,   /* từ 14s → 9.8s */
            bobUpDown 2.0s infinite ease-in-out;
    }
    .boy5 {
        animation: 
            runHorizontal 6.3s infinite linear,   /* từ 9s → 6.3s */
            bobUpDown 1.7s infinite ease-in-out;
    }
    .boy6 {
        animation: 
            runHorizontal 8.4s infinite linear,   /* từ 12s → 8.4s */
            bobUpDown 1.9s infinite ease-in-out;
    }

    /* Điểm kết thúc của bé phải sát vạch đích (right: 0 + width vạch 50px → offset ~70px) */
    @keyframes runHorizontal {
        0%   { left: -80px; transform: scaleX(1); opacity: 1; }
        88%  { left: calc(100% - 40px); transform: scaleX(1); opacity: 1; }  /* sửa để dừng sát vạch */
        92%  { left: calc(100% - 40px); transform: scaleX(-1); opacity: 0; }
        100% { left: -80px; transform: scaleX(-1); opacity: 0; }
    }

    /* Ẩn nút desktop, hiển thị nút mobile (tách riêng ngoài banner) */
    .club-cta-btn-desktop {
        display: none;
    }
}

@media (max-width: 480px) {
    .club-cta-fullwidth {
        height: 80px;
        min-height: 80px;
    }
    .club-cta-inner { justify-content: center; }
    .boy-running { width: 40px; }
    .finish-line-vertical {
        width: 40px;
        right: 0;
    }
    .boy-running {
        width: 42px;
    }

    /* Mobile nhỏ: giữ offset sát vạch */
    @keyframes runHorizontal {
        0%   { left: -80px; transform: scaleX(1); opacity: 1; }
        88%  { left: calc(100% - 40px); transform: scaleX(1); opacity: 1; }  
        92%  { left: calc(100% - 40px); transform: scaleX(-1); opacity: 0; }
        100% { left: -80px; transform: scaleX(-1); opacity: 0; }
    }
}

/* Desktop: hiển thị nút desktop, ẩn nút mobile */
@media (min-width: 769px) {
    .club-cta-btn-desktop {
        display: block;
    }
}

/* Fix row rỗng hoặc row chỉ 1 card không chiếm chỗ thừa */
.event-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    min-height: 0; /* ngăn row giữ chiều cao thừa */
}

.event-row:empty,
.event-row:has(.event-card:not(:visible)) {
    display: none; /* ẩn row nếu rỗng hoặc tất cả card ẩn */
    height: 0;
    margin: 0;
    padding: 0;
}

/* Nếu row chỉ còn 1 card → vẫn giữ 2 cột nhưng card chiếm full nếu cần (tùy chọn) */
@media (max-width: 550px) {
    .event-row {
        grid-template-columns: 1fr;
    }
}