:root{
    --primary :#05224d;
    --bodycolor :#f0ffff;
    --white : #fff;
    --black : #000;
}
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* تثبيت الصفحة ومنع أي انزياح كلي (Ultimate CLS Fix) */
html {
    scroll-behavior: smooth;
    background-color: var(--bodycolor);
    min-height: 100vh;
}

body{
    background-color: var(--bodycolor);
    font-family: "Noto Kufi Arabic", sans-serif;
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    contain: layout style;
}

/* عزل وتثبيت الجدول بطريقة منع انزياح body نهائياً */
#allmatch {
    width: 98%;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    contain: layout style paint;
    min-height: 600px;
}

/* إجبار جميع الخطوط على استخدام font-display: swap لتفادي مشكل PageSpeed */
@supports (font-display: swap) {
  @font-face {
    font-family: "Font Awesome 6 Free";
    font-display: swap;
  }
  @font-face {
    font-family: "Font Awesome 6 Brands";
    font-display: swap;
  }
}

h1{
    display: none;
}

/* تثبيت الـ Header لمنع أي انزياح في أعلى الصفحة (CLS Fix) */
header {
    width: 100%;
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    flex-shrink: 0;
    display: block;
    contain: layout size style paint;
}

nav{
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 70px;
    min-height: 70px;
    background-color: var(--primary);
    color: #fff;
    padding: 4px 12px;
    align-items: center;
}

/* menu icon style */
#menuicon{
    background-color: var(--bodycolor);
    border-radius: 3px;
    cursor: pointer;
    display: none;
    width: 33px;
    height: 33px;
    border: none;
}
#menuicon i{
    color: var(--primary);
    font-weight: bold;
    font-size: 23px;
}

/* -------------------------------- */
/* style menu content */
#menu ul{
    display: flex;
}
#menu{
    margin-left: auto;
    margin-right: 12px;
}

#menu ul a {
    position: relative;
    text-decoration: none;
    color: var(--white);
    margin: 8px 12px auto;
}

#menu ul a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.5s ease 0.3s;
}

#menu ul a:hover::after {
    width: 100%;
}

#menu ul li{
    list-style: none;
}

/* logo container & image style (CLS Fix) */
#logo {
    display: flex;
    align-items: center;
    width: 150px;
    height: 45px;
    min-width: 150px;
    min-height: 45px;
    contain: layout size style paint;
}

#logo img{
    width: 150px;
    height: 45px;
    min-width: 150px;
    min-height: 45px;
    object-fit: contain;
    aspect-ratio: 150 / 45;
    cursor: pointer;
}

/* ----------------- */
/* social icon style */
#social ul{
    display: flex;
    align-items: center;
}
#social ul li{
    list-style: none;
    margin: 3px;
}
#social ul li a i{
    color: var(--white);
    font-size: 28px;
    display: block;
}

#social ul li a {
    text-decoration: none;
}
#social ul li a i:hover{
    color: var(--bodycolor);
}

/* ------------------------ Main & Dynamic Content (CLS Fix) -------------------------- */
main {
    min-height: 400px;
    flex-grow: 1;
    display: block;
    contain: layout style;
}

/* ------------------------ menu phone style -------------------------- */
header #phonemenu{
    width: 100%;
    height: 100vh;
    background: var(--primary);
    text-align: center;
    display: none;
    padding: 29px 8px;
}
header #phonemenu ul{
    margin-top: -30px;
}
header #phonemenu ul a{
    text-decoration: none;
    color: var(--black);
}
header #phonemenu ul li{
    list-style: none;
    background: var(--bodycolor);
    padding: 12px 20px;
    margin-top: 30px;
    border-radius: 8px;
}

/* ------------------ responsive ------------------------- */
@media only screen and (max-width: 924px) {
    #menuicon{display: block;}
    #menu{display: none;}
}
@media only screen and (max-width: 430px) {
    #social ul li a i{
        font-size: 22px;
    }
}

/* عزل تام لكل عنصر مباراة لمنع انتقال أي انزياح للـ body (CLS Isolation) */
.match-item {
    min-height: 95px;
    contain: layout size style paint !important;
    content-visibility: auto;
    contain-intrinsic-size: auto 95px;
}

/* تثبيت مساحة الأيقونات والصور داخل المباريات لمنع قفزة الـ woff2 */
.match-item img, 
.match-item i, 
.match-item svg {
    flex-shrink: 0;
}