/* ══ Shared Match Card Styles ════════════════════════════════════════════ */
.match-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px 22px 18px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .07);
    text-decoration: none;
    color: #111827;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
    display: block;
}

.match-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}

.match-finished {
    filter: grayscale(80%);
    opacity: 0.8;
    background-color: #f8fafc;
}

.match-live {
    border-color: #ef4444;
}


@keyframes liveStripe {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.card-header-badges {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}

.comp-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.01em;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-time-badge {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    color: #fff;
}

.badge-upcoming {
    background: #2563eb;
}

.badge-live {
    background: #dc2626;
    animation: pulseBg 1.8s ease-in-out infinite;
}

.badge-finished {
    background: #16a34a;
}

@keyframes pulseBg {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.75;
    }
}

.teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.team {
    min-width: 0;
    /* Crucial for text ellipsis inside grid/flex */
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}

.team span {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.team-home {
    justify-content: flex-start;
    text-align: left;
}

.team-away {
    justify-content: flex-end;
    text-align: right;
}

.flag {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    object-fit: contain;
    padding: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.vs {
    text-align: center;
    color: #ef4444;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.05em;
    padding: 0 8px;
    white-space: nowrap;
}

.match-score {
    text-align: center;
    color: #0f172a;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    padding: 0 8px;
    white-space: nowrap;
}

/* ══ Responsive ══════════════════════════════════════════════════════════ */

/* For smaller tablets / large phones */
@media (max-width: 768px) {
    .match-card {
        padding: 16px 14px;
        border-radius: 16px;
    }

    .card-header-badges {
        margin-bottom: 12px;
    }

    .flag {
        width: 44px;
        height: 44px;
        padding: 3px;
    }

    .team {
        gap: 8px;
        font-size: 14px;
    }

    .vs {
        font-size: 12px;
        padding: 0 6px;
    }

    .match-score {
        font-size: 16px;
        padding: 0 6px;
    }
}

/* For typical phones down to very small screens */
@media (max-width: 480px) {
    .match-card {
        padding: 12px 10px;
        border-radius: 14px;
    }

    .card-header-badges {
        margin-bottom: 10px;
        gap: 6px;
    }

    .comp-badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    .match-time-badge {
        font-size: 10px;
        padding: 3px 8px;
    }

    .teams {
        gap: 4px;
    }

    .team {
        gap: 6px;
        font-size: 13px;
        /* Fluid enough to shrink if needed, but base 13px is readable */
    }

    .flag {
        width: 36px;
        height: 36px;
        border-radius: 6px;
        padding: 2px;
    }

    .vs {
        font-size: 11px;
        padding: 0 4px;
    }

    .match-score {
        font-size: 14px;
        padding: 0 4px;
        letter-spacing: 0;
    }
}

/* Fluid fallback for extremely small screens (320px - 360px) */
@media (max-width: 360px) {
    .match-card {
        padding: 10px 8px;
    }

    .teams {
        gap: 3px;
    }

    .team {
        font-size: 12px;
        gap: 4px;
    }

    .flag {
        width: 30px;
        height: 30px;
        border-radius: 5px;
    }

    .vs {
        font-size: 10px;
        padding: 0 3px;
    }

    .match-score {
        font-size: 13px;
        padding: 0 3px;
    }
}