.match-item.elgadwl {
    max-width: 100%;
    width: 98%;
    margin: 10px auto;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 3px;
}

.box-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #05224d;
    color: white;
    border-radius: 8px;
    padding: 15px;
    min-height: 75px;
    flex-wrap: wrap;
}

.boxstitle {
    font-size: 20px;
    margin: 0;
    flex: 1;
    text-align: right;
}

.matches-table {
    display: none;
    background: white;
    padding: 15px;
    margin-top: 10px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.matches-table.active {
    display: block !important;
}

main {
    min-height: 400px;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .box-title {
        flex-direction: column;
        text-align: center;
        min-height: 105px;
    }
    .boxstitle {
        text-align: center;
        margin-bottom: 10px;
    }
}

/* table style */
#linkmatch {
    text-decoration: none;
}

.match-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    contain: layout style;
}

/* تثبيت الحاوية الأساسية للمباراة بارتفاع قسري صارم لمنع أي قفزة (Ultimate CLS Fix) */
.match-item {
    background: #f4f4f4;
    color: #000;
    border-radius: 12px;
    padding: 12px 15px;
    height: 95px !important;
    min-height: 95px !important;
    max-height: 95px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    contain: strict; /* عزل هندسي تام للعنصر يمنع أي تأثير خارجي أو داخلي على الـ body */
}

/* طبقة الـ Blur عند الـ Hover */
.match-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

/* زر التشغيل (Play Icon) */
.match-item::before {
    content: "▶";
    position: absolute;
    font-size: 40px;
    font-weight: bold;
    color: white;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    filter: drop-shadow(0 0 4px #000);
    z-index: 2;
}

.match-item:hover::after {
    opacity: 1;
}

.match-item:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* تثبيت مساحة الفريق بدقة */
.team {
    text-align: center;
    width: 28%;
    height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.team-img {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    object-fit: cover;
    border-radius: 50%;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.team-name {
    margin-top: 4px;
    font-weight: bold;
    font-size: 12px;
    height: 16px;
    line-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100px;
}

.center-box {
    width: 40%;
    height: 70px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.match-time {
    font-size: 13px;
    font-weight: bold;
    height: 16px;
    line-height: 16px;
}

.score {
    font-size: 20px;
    font-weight: bold;
}

.league {
    margin-top: 2px;
    font-size: 11px;
    color: #555;
    height: 15px;
    line-height: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.match-item:hover .team-img {
    filter: brightness(0.8);
}

.statumatch {
    padding: 1px 8px;
    margin-top: 2px;
    border-radius: 4px;
    font-size: 11px;
    display: inline-block;
    font-weight: 600;
    height: 18px;
    line-height: 16px;
}

/* ألوان الحالات */
.not-started { background: #777; color: #fff; }
.soon { background: #27ae60; color: #fff; }
.playing { background: #e74c3c; color: #fff; }
.finished { background: #2c3e50; color: #fff; }