
  :root {
    --bg:     #0f1419;
    --card:   #161b22;
    --card2:  #1c2128;
    --deep:   #0d1117;
    --text:   #e8eaed;
    --muted:  #7d8590;
    --line:   #21262d;
    --accent: #2f81f7;
    --green:  #3fb950;
    --red:    #f85149;
  }
  [data-theme="light"] {
    --bg:     #ffffff;
    --card:   #f6f8fa;
    --card2:  #eaeef2;
    --deep:   #eaeef2;
    --text:   #1f2328;
    --muted:  #59636e;
    --line:   #d1d9e0;
    --accent: #0969da;
    --green:  #1a7f37;
    --red:    #cf222e;
  }
  html { background: var(--bg); }
  .themebtn {
    background: var(--card); color: var(--muted);
    border: 1px solid var(--line); padding: 6px 12px;
    border-radius: 8px; font-size: 15px; cursor: pointer;
    font-family: inherit; line-height: 1;
  }
  .themebtn:hover { background: var(--card2); color: var(--text); }
  .backbtn { background: var(--card); color: var(--muted);
             border: 1px solid var(--line); padding: 6px 14px;
             border-radius: 8px; font-size: 13px; cursor: pointer;
             font-family: inherit; }
  .backbtn { min-height: 44px; min-width: 44px; }
  .backbtn:hover { background: var(--card2); color: var(--text); }

  * { margin:0; padding:0; box-sizing:border-box; }
  body { font-family:"Segoe UI",Tahoma,sans-serif; background:var(--bg);
         color:var(--text); padding:24px 16px; line-height:1.6; }
  .wrap { max-width:760px; margin:0 auto; }
  .topbar { display:flex; align-items:center;
            justify-content:space-between; margin-bottom:14px; }
  .back { display:inline-block; color:var(--accent); text-decoration:none;
          font-size:14px; }
  .back:hover { text-decoration:underline; }
  .lang { background:var(--card); color:var(--muted); border:1px solid var(--line);
          padding:6px 14px; border-radius:8px; font-size:13px;
          text-decoration:none; font-family:inherit; }
  .lang:hover { background:var(--card2); color:var(--text); }
  .meta-top { text-align:center; color:var(--muted); font-size:13px;
              margin-bottom:12px; }
  .head { background:var(--card); border-radius:12px; padding:24px 16px;
          display:grid; grid-template-columns:1fr auto 1fr;
          align-items:center; gap:12px; }
  .team { display:flex; flex-direction:column; align-items:center;
          gap:10px; min-width:0; text-decoration:none; color:var(--text); }
  .team img { width:60px; height:60px; object-fit:contain; }
  .team span { font-size:15px; text-align:center; }
  .team:hover span { color:var(--accent); }
  .kick { display:block; font-size:15px; font-weight:600;
          color:var(--text); margin-top:6px; }
  .big { font-size:29px; font-weight:700; letter-spacing:2px;
         white-space:nowrap; }
  /* عدّ تنازلي (10 أكتوبر): الوقت كبير بـ.score والتاريخ/العدّاد تحته بـ.kick (matchtime.py: data-cd) */
  .big.cd { font-size:24px; letter-spacing:1px; }
  .big.cd .kick { font-size:13px; font-weight:600; letter-spacing:1px; font-variant-numeric:tabular-nums;
                  color:var(--muted); text-align:center; unicode-bidi:isolate; }
  .big.cd .kick.dt { font-size:13px; letter-spacing:0; color:var(--muted); }
  .big.soon { font-size:15px; font-weight:600; letter-spacing:0;
              color:var(--accent); white-space:normal; text-align:center; }
  /* المواجهات المباشرة */
  .h2h { background:var(--card); border-radius:12px; padding:16px; }
  .h2hn { text-align:center; color:var(--muted); font-size:13px;
          margin-bottom:12px; }
  .h2hbar { display:flex; height:34px; border-radius:8px;
            overflow:hidden; font-size:13px; font-weight:700; }
  .h2hbar span { display:flex; align-items:center;
                 justify-content:center; color:#fff; min-width:22px; }
  .h2hbar .w { background:#2ea043; }
  .h2hbar .d { background:#484f58; }
  .h2hbar .l { background:#8957e5; }
  .h2hleg { display:flex; margin-top:7px; font-size:12px;
            color:var(--muted); }
  .h2hleg span { flex:1; text-align:center; }
  .h2hleg span:first-child { text-align:start; }
  .h2hleg span:last-child { text-align:end; }
  .h2hlist { margin-top:14px; }
  .h2hlist a { display:flex; align-items:center;
               justify-content:space-between; padding:10px 4px;
               border-top:1px solid var(--line); text-decoration:none;
               color:var(--text); }
  .h2hlist a:hover { background:var(--card2); }
  .h2hlist a.hidden { display:none; }
  .hd { color:var(--muted); font-size:12px; }
  .hm { display:flex; align-items:center; gap:9px; font-size:14px; }
  .hm img { width:21px; height:21px; object-fit:contain; }
  .h2hmore { width:100%; margin-top:10px; background:var(--card2);
             color:var(--accent); border:1px solid var(--line);
             border-radius:9px; padding:10px; font-size:13px;
             cursor:pointer; font-family:inherit; min-height:44px; }

  .fixed { background:var(--card2); border:1px solid var(--accent);
           border-radius:10px; padding:14px 16px; margin-top:12px;
           font-size:13px; }
  .fixed b { color:var(--accent); }
  .fixed .row { color:var(--muted); margin-top:4px; }
  h2 { font-size:16px; margin:26px 0 10px; padding-inline-start:10px;
       border-inline-start:3px solid var(--accent); }
  .goals { background:var(--card); border-radius:10px; padding:6px; }
  /* خط الأحداث (12 أكتوبر): [مضيف] دقيقة [ضيف] — عمود المضيف أول عمود فيتبع اتجاه الصفحة (يمين بالعربي ويسار بالإنجليزي) */
  .min { color:var(--accent); font-weight:700; text-align:center; }
  .who { min-width:0; overflow-wrap:anywhere; }
  .kind { color:var(--muted); font-size:12px; }
  .who.cancelled { text-decoration:line-through; opacity:.6; }
  .ev { display:grid; grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr); align-items:center;
        column-gap:6px; padding:10px 8px; border-bottom:1px solid var(--line); font-size:14px; }
  .ev:last-child { border-bottom:none; }
  .evc { display:flex; align-items:center; gap:6px; min-width:0; }
  .ev.h .evc.on { justify-content:flex-end; text-align:end; }
  .ev.a .evc.on { justify-content:flex-start; text-align:start; }
  .evt { display:flex; flex-direction:column; min-width:0; }
  .ic { font-size:13px; flex:none; }
  .out { color:var(--red); font-size:12px; }
  .in { color:var(--green); font-size:12px; }
  .vtabs { display:flex; gap:8px; margin:26px 0 10px; }
  .vtab { background:var(--card); color:var(--muted); border:1px solid var(--line);
          padding:8px 16px; border-radius:8px; cursor:pointer;
          font-family:inherit; font-size:14px; min-height:44px; }
  .vtab:hover { background:var(--card2); color:var(--text); }
  .vtab.on { background:var(--accent); color:var(--bg); border-color:var(--accent); }
  .minor.off { display:none; }
  /* تبويبات الصفحة (12 أكتوبر): شريط تحت الرأس، لوحة واحدة ظاهرة، عنوان اللوحة الأول مخفي بصرياً (يبقى للفهرسة وبلا JS) */
  .mtabs { display:flex; gap:2px; margin:14px 0 2px; overflow-x:auto; border-bottom:1px solid var(--line);
           scrollbar-width:none; }
  .mtabs::-webkit-scrollbar { display:none; }
  .mtab { flex:1 1 auto; background:none; border:none; border-bottom:2px solid transparent; margin-bottom:-1px;
          color:var(--muted); padding:10px 6px; font-family:inherit; font-size:13px; font-weight:600;
          cursor:pointer; white-space:nowrap; min-height:44px; }
  .mtab:hover { color:var(--text); }
  .mtab.on { color:var(--text); border-bottom-color:var(--accent); }
  .mp { display:none; }
  .mp.on { display:block; }
  .mp > h2:first-child { display:none; }
  .mp > .vtabs { margin-top:12px; }
  .mp > .goals, .mp > .empty, .mp > .lu, .mp > .h2h, .lgt { margin-top:12px; }
  /* ترتيب الدوري داخل التبويب: الفريقان مظلَّلان */
  .lgt { width:100%; border-collapse:collapse; background:var(--card); border-radius:10px; overflow:hidden;
         table-layout:fixed; }
  .lgt th, .lgt td { padding:9px 2px; text-align:center; font-size:13px; }
  .lgt th { background:var(--card2); color:var(--muted); font-size:12px; }
  .lgt th.r { text-align:start; padding-inline-start:6px; }
  .lgt tr { border-bottom:1px solid var(--line); }
  .lgt tr:last-child { border-bottom:none; }
  .lgt .ps { width:26px; color:var(--muted); }
  .lgt td:nth-child(7) { direction:ltr; unicode-bidi:isolate; }   /* فارق الأهداف +8 لا 8+ بالعربي */
  .lgt th:nth-child(n+3), .lgt td:nth-child(n+3) { width:32px; }
  .lgt td.tm { text-align:start; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .lgt td.tm img { width:20px; height:20px; object-fit:contain; vertical-align:middle; margin-inline-end:6px; }
  .lgt td.tm a { color:var(--text); text-decoration:none; vertical-align:middle; }
  .lgt .pt { font-weight:700; color:var(--accent); }
  .lgt tr.top .ps { color:var(--green); font-weight:700; }
  .lgt tr.bottom .ps { color:var(--red); }
  .lgt tr.hl { background:rgba(47,129,247,.16); }
  .lgt tr.hl td.tm a { font-weight:700; }
  .st { display:grid; grid-template-columns:52px 1fr 52px;
        align-items:center; gap:10px; padding:9px 12px;
        border-bottom:1px solid var(--line); font-size:13px; }
  .st:last-child { border-bottom:none; }
  .st .v { font-weight:700; }
  .st .v.a { text-align:start; }
  .st .v.b { text-align:end; }
  .st .mid { text-align:center; }
  .st .lbl { color:var(--muted); font-size:12px; display:block; }
  .bar { display:flex; height:5px; border-radius:3px;
         overflow:hidden; background:var(--line); margin-top:3px; }
  .bar i { display:block; height:100%; }
  .bar .x { background:var(--accent); }
  .bar .y { background:var(--muted); }
  .empty { background:var(--card); border-radius:10px; padding:20px;
           text-align:center; color:var(--muted); font-size:13px; }
  footer { text-align:center; color:var(--muted); font-size:12px;
           margin-top:36px; line-height:1.9; }

  /* نجمة + جرس بشريط التطبيق العلوي (13 أكتوبر): دائريّان 44×44 بنفس إطار .topbtn؛ الجرس مخفي حتى تكشفه البوّابة */
  .mact { width:44px; height:44px; flex:0 0 44px; border-radius:12px; padding:0; cursor:pointer;
          display:inline-flex; align-items:center; justify-content:center;
          background:var(--card); color:var(--muted); border:1px solid var(--line); }
  .mact[hidden] { display:none; }
  .mact:hover { background:var(--card2); color:var(--text); }
  .mact svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8;
              stroke-linecap:round; stroke-linejoin:round; }
  .mact[aria-pressed="true"] { color:var(--accent); border-color:var(--accent); }
  .mact[aria-pressed="true"] svg { fill:currentColor; }
  .mact:disabled { opacity:.55; cursor:default; }
  .pushmsg { color:var(--muted); font-size:13px; margin:0 0 10px; padding-inline:4px; }
  .pushmsg[hidden] { display:none; }

  .lu { margin-top:10px; }
  .luteam { background:var(--card); border:1px solid var(--line);
            border-radius:12px; padding:14px; margin-bottom:14px; }
  .luhead { display:flex; justify-content:space-between;
            align-items:center; gap:10px; margin-bottom:12px;
            flex-wrap:wrap; }
  .luname { display:flex; align-items:center; gap:8px;
            font-size:15px; font-weight:600; }
  .luname img { width:22px; height:22px; object-fit:contain; }
  .luform { color:var(--muted); font-size:13px; }
  .lucoach { color:var(--muted); font-size:12px; margin-top:2px; }

  .pitch { direction:ltr; background:var(--deep);
           border:1px solid var(--line); border-radius:10px;
           padding:14px 6px; display:flex; flex-direction:column-reverse;
           gap:10px; position:relative; overflow:hidden; }
  .pitch::before { content:""; position:absolute; left:8%; right:8%;
                   top:50%; border-top:1px dashed var(--line); }
  .prow { display:flex; justify-content:space-around;
          align-items:flex-start; gap:2px; position:relative; }

  .pp { display:flex; flex-direction:column; align-items:center;
        gap:3px; width:19%; min-width:44px; }
  .shirt { position:relative; width:32px; height:32px;
           border-radius:50%; background:var(--card2);
           border:1px solid var(--line); display:flex;
           align-items:center; justify-content:center;
           font-size:13px; font-weight:600; color:var(--text); }
  .rate { position:absolute; top:-11px; right:-12px; font-size:12px;
          padding:1px 4px; border-radius:5px; color:#fff;
          line-height:1.3; font-weight:600; }
  .rate.g { background:var(--green); }
  .rate.m { background:var(--muted); }
  .rate.b { background:var(--red); }
  .cap { position:absolute; bottom:-4px; left:-6px; font-size:12px;
         background:var(--accent); color:#fff; border-radius:4px;
         padding:0 3px; }
  .pn { font-size:12px; color:var(--muted); text-align:center;
        line-height:1.25; word-break:break-word; }

  .subs { margin-top:12px; }
  .subs h4 { font-size:12px; color:var(--muted); margin-bottom:6px;
             font-weight:600; }
  .sublist { display:flex; flex-wrap:wrap; gap:6px; }
  .sub { background:var(--card2); border:1px solid var(--line);
         border-radius:7px; padding:4px 9px; font-size:12px;
         display:flex; align-items:center; gap:5px; }
  .sub .num { color:var(--muted); font-size:12px; }
  .sub .r { font-size:12px; padding:0 4px; border-radius:4px;
            color:#fff; }
  .sub .r.g { background:var(--green); }
  .sub .r.m { background:var(--muted); }
  .sub .r.b { background:var(--red); }

  .lulist { display:flex; flex-wrap:wrap; gap:6px; }

  /* لوحة تفاصيل اللاعب */
  .pp, .sub.cl { cursor:pointer; }
  .pp:hover .shirt, .sub.cl:hover { border-color:var(--accent); }
  .stovl { position:fixed; inset:0; background:rgba(0,0,0,.72);
           display:none; align-items:center; justify-content:center;
           z-index:960; padding:18px; }
  .stovl.on { display:flex; }
  .stbox { background:var(--card); border:1px solid var(--line);
           border-radius:16px; width:100%; max-width:440px;
           max-height:82vh; overflow-y:auto; padding:18px; }
  .sthead { display:flex; align-items:center; gap:10px;
            margin-bottom:4px; }
  .sthead .nm { font-size:16px; font-weight:600; flex:1;
                min-width:0; }
  .stsub { color:var(--muted); font-size:12px; margin-bottom:14px; }
  .stsec { margin-bottom:12px; }
  .stsec h4 { font-size:12px; color:var(--muted); font-weight:600;
              margin-bottom:5px; letter-spacing:.3px; }
  .strow { display:flex; justify-content:space-between;
           padding:6px 2px; border-bottom:1px solid var(--line);
           font-size:13px; }
  .stsec .strow:last-child { border-bottom:none; }
  .strow .v { font-weight:600; }
  .stclose { display:block; width:100%; margin-top:8px;
             background:var(--card2); color:var(--text);
             border:1px solid var(--line); border-radius:10px;
             padding:11px; font-size:14px; cursor:pointer;
             font-family:inherit; }
  .stnone { color:var(--muted); font-size:13px; padding:10px 0; }
  .lunote { color:var(--muted); font-size:12px; margin-bottom:8px; }

  /* ملعب واحد للفريقين (12 أكتوبر، نمط FotMob بلا صور): المضيف بالنصف العلوي والضيف بالسفلي، اللاعبون بمواقع grid؛ يظهر فقط حين
     للفريقين خطة + 11 grid، وإلا تبقى القوائم/الملاعب القديمة كما كانت. */
  .fpitch { --pitch:#1f4d31; --pl:rgba(255,255,255,.4); direction:ltr; position:relative; width:100%;
            aspect-ratio:2/3; border-radius:12px; overflow:hidden; background:var(--pitch);
            margin:10px 0 14px; border:1px solid var(--line); }
  :root[data-theme="light"] .fpitch { --pitch:#4a9a64; --pl:rgba(255,255,255,.75); }
  .fpitch svg { position:absolute; inset:0; width:100%; height:100%; }
  .fpitch svg * { fill:none; stroke:var(--pl); stroke-width:1.2; vector-effect:non-scaling-stroke; }
  .fpt { position:absolute; inset-inline-start:8px; display:flex; align-items:center; gap:6px; z-index:3;
         background:rgba(0,0,0,.45); color:#fff; border-radius:12px; padding:3px 9px 3px 4px; font-size:12px;
         font-weight:600; max-width:80%; }
  .fpt img { width:18px; height:18px; object-fit:contain; background:#fff; border-radius:50%; padding:1px; }
  .fpt span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; direction:auto; }
  .fpt.top { top:8px; }
  .fpt.bot { bottom:8px; }
  .fp { position:absolute; transform:translate(-50%,-50%); width:68px; display:flex; flex-direction:column;
        align-items:center; z-index:2; }
  .fs { position:relative; width:30px; height:30px; border-radius:50%; display:flex; align-items:center;
        justify-content:center; font-size:12px; font-weight:700; color:#fff;
        border:2px solid rgba(255,255,255,.9); box-shadow:0 1px 3px rgba(0,0,0,.45); }
  .fs.h { background:#2f81f7; }
  .fs.a { background:#d29922; color:#1a1300; }
  .fn { margin-top:2px; font-size:10px; line-height:1.15; color:#fff; text-align:center; max-width:68px;
        text-shadow:0 1px 2px rgba(0,0,0,.8); display:-webkit-box; -webkit-line-clamp:2;
        -webkit-box-orient:vertical; overflow:hidden; direction:auto; unicode-bidi:plaintext; }
  .fi { position:absolute; font-size:10px; line-height:1; background:rgba(0,0,0,.65); border-radius:8px;
        padding:1px 2px; color:#fff; }
  .fi.c { top:-5px; left:-6px; font-weight:800; font-size:9px; background:#d29922; color:#1a1300; }
  .fi.g { top:-6px; right:-8px; }
  .fi.k { bottom:-4px; right:-8px; }
  .fi.o { bottom:-4px; left:-8px; color:#f85149; }
  .fi.r { bottom:-4px; left:50%; transform:translateX(-50%); font-size:9px; font-weight:700; }
  .fp[data-p] { cursor:pointer; }

  /* فورمة الفريقين (14 أكتوبر): عمودان بترتيب DOM (المضيف أولاً = جهة المضيف بالعربي والإنجليزي)، آخر 5 نتائج، الأحدث بالأعلى */
  .tfcard { background:var(--card); border-radius:12px; padding:12px 10px 8px; margin-top:16px; }
  .tfcard h3 { font-size:14px; text-align:center; margin-bottom:8px; color:var(--text); }
  .tfcols { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
  .tfh { text-align:center; color:var(--muted); font-size:12px; margin-bottom:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .tfr { display:flex; align-items:center; justify-content:center; gap:6px; min-height:44px; text-decoration:none; color:var(--text); }
  .tfr img, .tfr .tfnl { width:22px; height:22px; flex:0 0 22px; object-fit:contain; }
  .tfpw { display:inline-flex; flex-direction:column; align-items:center; gap:2px; }
  .tfp { min-width:48px; text-align:center; padding:2px 8px; border-radius:6px; font-size:13px; font-weight:700; color:#fff; white-space:nowrap; }
  .tfp.w { background:#17803a; } .tfp.d { background:#6b7280; } .tfp.l { background:#c62828; }
  .tfmk { width:18px; height:3px; border-radius:2px; background:var(--accent); }

  /* جرس التنبيهات + رابط «تعديل» تحته + الورقة السفلية بأنواع التنبيه (13 أكتوبر، 3E) */
  .bellbtn { flex:0 0 auto; width:44px; height:44px; border-radius:50%; padding:0; cursor:pointer;
             display:inline-flex; align-items:center; justify-content:center;
             background:transparent; color:var(--muted); border:1px solid var(--line); }
  .bellbtn[hidden] { display:none; }
  .bellbtn svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8;
                 stroke-linecap:round; stroke-linejoin:round; }
  .bellbtn[aria-pressed="true"] { background:var(--accent); border-color:var(--accent); color:#fff; }
  .bellbtn[aria-pressed="true"] svg { fill:currentColor; }
  .bellbtn:disabled { opacity:.55; cursor:default; }
  .pushmsg { color:var(--muted); font-size:13px; margin:0 0 14px; padding-inline:4px; }
  .pushmsg[hidden] { display:none; }
  /* ⚠️ (14 أكتوبر) الغلاف بحجم الجرس الثابت 44×44 و«تعديل» مطلق تحته: ظهوره/اختفاؤه لا يغيّر مكان الجرس أبداً (كان بالتدفق
     العادي فيكبر الغلاف ويرتفع الجرس عن النجمة والترس). الغلاف بلا جرس ظاهر (غير مدعوم) يختفي كي لا يحجز فراغاً. */
  .pbwrap { position:relative; display:inline-flex; align-items:center; justify-content:center;
            width:44px; height:44px; flex:0 0 44px; }
  .pbwrap:not(:has(.bellbtn:not([hidden]), .mact:not([hidden]))) { display:none; }
  .pbedit { position:absolute; top:100%; left:50%; transform:translateX(-50%); z-index:3;
            white-space:nowrap; background:none; border:none; padding:0 4px; margin-top:1px; color:var(--accent); font:inherit;
            font-size:11px; line-height:1.2; cursor:pointer; text-decoration:underline; }
  .pbedit[hidden] { display:none; }
  /* الصفوف تحجز مكان «تعديل» تحت الجرس دائماً (لا قفزة عند التفعيل) */
  .appbar:has(.pbwrap), .hdract:has(.pbwrap) { padding-bottom:14px; }
  .psheet { position:fixed; inset:0; z-index:960; display:none; align-items:flex-end; justify-content:center;
            background:rgba(0,0,0,.55); }
  .psheet.on { display:flex; }
  .pbox { background:var(--card); color:var(--text); width:100%; max-width:480px; border-radius:16px 16px 0 0;
          padding:18px 16px 22px; border:1px solid var(--line); border-bottom:none; max-height:80vh; overflow:auto; }
  .pbox h3 { font-size:16px; margin:0 0 4px; }
  .pbox .psub { color:var(--muted); font-size:13px; margin-bottom:10px; }
  .prow { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:46px;
          border-bottom:1px solid var(--line); font-size:15px; cursor:pointer; }
  .prow:last-of-type { border-bottom:none; }
  .prow input { width:22px; height:22px; accent-color:var(--accent); flex:0 0 auto; }
  .pdone { margin-top:14px; width:100%; min-height:44px; border-radius:12px; border:none; background:var(--accent); color:#fff;
           font:inherit; font-size:15px; font-weight:700; cursor:pointer; }
