/* ==========================================================================
   Koora Break — Entity pages (team / player / match)
   THEME BUILDER LAYER: change the variables below to restyle every entity
   page at once; each template is plain sectioned HTML you can reorder.
   ========================================================================== */
:root {
  --kb-accent: #a9ff03;       /* لون الهوية الأساسي */
  --kb-accent-dark: #7bc200;
  --kb-ink: #0a0a0a;          /* خلفية الهيرو الداكنة */
  --kb-card: #ffffff;
  --kb-line: #e8e8e8;
  --kb-text: #111827;
  --kb-muted: #6b7280;
  --kb-radius: 16px;
  --kb-font: 'Cairo', sans-serif;
}

.kb-page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; font-family: var(--kb-font); color: var(--kb-text); }
/* Footer clearance is provided by the theme's standard <main class="site-main
   mb-[65px] lg:mb-[385px]"> wrapper that entity templates now use (matches the
   rest of the site; the footer's phone/CTA pop up into that reserved space). */

/* ---------- Hero ---------- */
.kb-hero { position: relative; background: var(--kb-ink); color: #fff; border-radius: var(--kb-radius); padding: 32px 28px; display: flex; align-items: center; gap: 24px; overflow: hidden; }
.kb-hero::after { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 6px; background: var(--kb-accent); }
.kb-hero img.kb-hero-img { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 50%; padding: 8px; flex: none; }
.kb-hero h1 { margin: 0 0 6px; font-size: 1.9rem; font-weight: 800; color: #fff; }
.kb-hero .kb-sub { color: #d1d5db; font-size: .95rem; display: flex; flex-wrap: wrap; gap: 14px; }
.kb-hero .kb-sub a { color: var(--kb-accent); text-decoration: none; }

/* ---------- Section ---------- */
.kb-section { margin-top: 28px; }
.kb-section > h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 14px; padding-inline-start: 12px; border-inline-start: 4px solid var(--kb-accent); }

/* ---------- Match rows ---------- */
.kb-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.kb-match:hover { box-shadow: 0 0 0 2px var(--kb-accent); }
.kb-match .kb-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kb-match .kb-side.away { justify-content: flex-end; }
.kb-match .kb-side img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.kb-match .kb-side span { font-weight: 700; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-match .kb-mid { text-align: center; min-width: 86px; }
.kb-match .kb-score { font-size: 1.15rem; font-weight: 800; direction: ltr; }
.kb-match .kb-meta { font-size: .72rem; color: var(--kb-muted); }
.kb-badge { display: inline-block; font-size: .68rem; padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.kb-badge.live { background: #dc2626; color: #fff; animation: kbpulse 1.2s infinite; }
.kb-badge.finished { background: #e5e7eb; color: #374151; }
.kb-badge.scheduled { background: rgba(169,255,3,.18); color: #3d6400; border: 1px solid var(--kb-accent-dark); }
@keyframes kbpulse { 50% { opacity: .55; } }

/* ---------- Squad grid ---------- */
.kb-squad { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kb-player-card { background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; padding: 14px 10px; text-align: center; text-decoration: none; color: inherit; transition: transform .12s, box-shadow .15s; position: relative; }
.kb-player-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--kb-accent); }
.kb-player-card img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #f3f4f6; }
.kb-player-card .kb-pname { display: block; font-weight: 700; font-size: .85rem; margin-top: 8px; }
.kb-player-card .kb-ppos { display: block; font-size: .72rem; color: var(--kb-muted); margin-top: 2px; }
.kb-player-card .kb-pnum { position: absolute; top: 8px; inset-inline-end: 10px; font-size: .72rem; font-weight: 800; color: var(--kb-accent-dark); }

/* ---------- Stat chips & tables ---------- */
.kb-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.kb-stat { background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; padding: 12px; text-align: center; }
.kb-stat b { display: block; font-size: 1.3rem; color: var(--kb-accent-dark); }
.kb-stat span { font-size: .72rem; color: var(--kb-muted); }
.kb-table { width: 100%; border-collapse: collapse; background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; overflow: hidden; font-size: .85rem; }
.kb-table th { background: var(--kb-ink); color: #fff; padding: 9px 10px; font-weight: 700; }
.kb-table td { padding: 9px 10px; border-top: 1px solid var(--kb-line); text-align: center; }
.kb-table td:first-child { text-align: start; font-weight: 600; }
.kb-table tr.kb-sum td { background: rgba(169,255,3,.12); font-weight: 800; }

/* ---------- Match page scoreboard ---------- */
.kb-board { background: var(--kb-ink); color: #fff; border-radius: var(--kb-radius); padding: 36px 20px; text-align: center; }
.kb-board .kb-league { color: var(--kb-accent); font-size: .85rem; font-weight: 700; margin-bottom: 18px; }
.kb-board .kb-teams { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; max-width: 720px; margin: 0 auto; }
.kb-board .kb-team { text-decoration: none; color: #fff; }
.kb-board .kb-team img { width: 84px; height: 84px; object-fit: contain; background: #fff; border-radius: 50%; padding: 8px; }
.kb-board .kb-team b { display: block; margin-top: 10px; font-size: 1.05rem; }
.kb-board .kb-bigscore { font-size: 2.6rem; font-weight: 800; direction: ltr; }
.kb-board .kb-when { color: #9ca3af; font-size: .85rem; margin-top: 14px; }

@media (max-width: 640px) {
  .kb-hero { flex-direction: column; text-align: center; padding: 24px 16px; }
  .kb-board .kb-bigscore { font-size: 1.9rem; }
}

/* ---------- Technical fingerprint (radar) ---------- */
.kb-radar-wrap { text-align: center; }
.kb-radar-box { display: inline-block; max-width: 360px; width: 100%; }
.kb-radar { width: 100%; height: auto; }
.kb-note { color: var(--kb-muted); font-size: 12px; margin-top: 6px; }

/* ---------- Grouped stats ---------- */
.kb-statgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.kb-statgroup { background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: var(--kb-radius); padding: 12px 14px; }
.kb-statgroup h3 { margin: 0 0 8px; font-size: 14px; color: var(--kb-accent-dark, #7bc200); border-bottom: 1px solid var(--kb-line); padding-bottom: 6px; }
.kb-statrow { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; font-size: 13px; }
.kb-statrow span { color: var(--kb-muted); }
.kb-statrow b { color: var(--kb-text); font-variant-numeric: tabular-nums; }

/* ---------- Comparison page ---------- */
.kb-cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; background: var(--kb-ink, #0a0a0a); color: #fff; border-radius: var(--kb-radius); padding: 22px 18px; margin-bottom: 20px; }
.kb-cmp-side { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.kb-cmp-side img { width: 78px; height: 78px; object-fit: contain; background: #fff; border-radius: 50%; padding: 4px; }
.kb-cmp-side strong { font-size: 16px; }
.kb-vs-big { font-size: 22px; font-weight: 900; color: var(--kb-accent, #a9ff03); }
.kb-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.kb-dot-a { background: var(--kb-accent, #a9ff03); }
.kb-dot-b { background: #2194ff; }
.kb-legend { display: flex; gap: 18px; justify-content: center; margin-top: 8px; font-size: 13px; color: var(--kb-muted); }
.kb-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kb-cmp-table td, .kb-cmp-table th { text-align: center; }
.kb-cmp-table .kb-c-stat { color: var(--kb-muted); font-weight: 600; }
.kb-cmp-table .kb-win { background: color-mix(in srgb, var(--kb-accent, #a9ff03) 22%, transparent); font-weight: 800; }
/* Picker */
.kb-cmp-picker { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: start; }
.kb-pick input { width: 100%; box-sizing: border-box; padding: 11px; border: 1px solid var(--kb-line); border-radius: 10px; font: inherit; }
.kb-pick-res { margin-top: 6px; }
.kb-pick-row { display: block; width: 100%; text-align: right; background: #fff; border: 1px solid var(--kb-line); border-bottom: none; padding: 8px 10px; cursor: pointer; font: inherit; }
.kb-pick-row:last-child { border-bottom: 1px solid var(--kb-line); }
.kb-pick-row:hover { background: #f7f7f7; }
.kb-pick-row small { color: #999; }
.kb-pick-row em { float: left; font-style: normal; background: #eef; padding: 1px 8px; border-radius: 10px; font-size: 11px; }
@media (max-width: 640px) { .kb-cmp-picker, .kb-cmp-head { grid-template-columns: 1fr; } }

/* ---------- Match: events timeline ---------- */
.kb-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.kb-timeline::before { content: ""; position: absolute; top: 0; bottom: 0; right: 50%; width: 2px; background: var(--kb-line); }
.kb-timeline li { display: flex; align-items: center; gap: 8px; padding: 7px 0; width: 50%; }
.kb-tl-home { margin-right: 50%; flex-direction: row-reverse; text-align: left; padding-left: 16px; }
.kb-tl-away { margin-left: 50%; padding-right: 16px; }
.kb-tl-min { font-variant-numeric: tabular-nums; color: var(--kb-muted); font-size: 12px; min-width: 34px; }
.kb-tl-icon { font-size: 16px; }
.kb-tl-txt b { font-size: 14px; }
.kb-tl-txt small { color: var(--kb-muted); display: block; font-size: 11.5px; }

/* ---------- Match: lineups ---------- */
.kb-lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kb-lineup-col h3 { font-size: 15px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--kb-accent, #a9ff03); }
.kb-lineup-col h3 small { color: var(--kb-muted); font-weight: 600; }
.kb-lp { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; text-decoration: none; color: var(--kb-text); }
.kb-lp:hover { background: #f6f7f8; }
.kb-lp-pos { font-size: 10px; color: #fff; background: var(--kb-muted); border-radius: 5px; padding: 2px 5px; min-width: 30px; text-align: center; }
.kb-lp-name { flex: 1; font-size: 13.5px; }
.kb-lp-rating { font-weight: 800; font-size: 13px; color: #fff; background: var(--kb-accent-dark, #7bc200); border-radius: 6px; padding: 2px 7px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .kb-lineups { grid-template-columns: 1fr; } }

/* ---------- Match: head-to-head ---------- */
.kb-h2h-tally { display: flex; align-items: center; gap: 12px; }
.kb-h2h-num { font-size: 22px; font-weight: 900; min-width: 28px; text-align: center; }
.kb-h2h-bar { flex: 1; height: 12px; border-radius: 7px; overflow: hidden; display: flex; background: var(--kb-line); }
.kb-h2h-h { background: var(--kb-accent, #a9ff03); }
.kb-h2h-d { background: #cbd5e1; }
.kb-h2h-a { background: #2194ff; }
.kb-h2h-leg { display: flex; justify-content: space-between; color: var(--kb-muted); font-size: 12px; margin: 6px 2px 14px; }
.kb-form-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; }
.kb-form-row b { font-size: 13.5px; }
.kb-pill { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; margin-inline-start: 4px; }
.kb-pill-w { background: #16a34a; } .kb-pill-l { background: #dc2626; } .kb-pill-d { background: #9ca3af; }
.kb-h2h-list { margin-top: 12px; border-top: 1px solid var(--kb-line); }
.kb-h2h-game { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--kb-line); font-size: 13px; }
.kb-h2h-side { display: flex; align-items: center; gap: 6px; }
.kb-h2h-side:last-of-type { justify-content: flex-end; }
.kb-h2h-side img { width: 20px; height: 20px; object-fit: contain; }
.kb-h2h-sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.kb-h2h-date { color: var(--kb-muted); font-size: 11px; min-width: 74px; text-align: left; }

/* ---------- Share-card CTA on match page ---------- */
.kb-share-cta { display: inline-block; margin-top: 12px; background: var(--kb-accent, #a9ff03); color: #000; font-weight: 800; border-radius: 12px; padding: 9px 22px; text-decoration: none; }
.kb-share-cta:hover { background: var(--kb-accent-dark, #7bc200); }

/* ---------- Player page (SofaScore/FotMob style) ---------- */
.kb-phero { display: flex; align-items: center; gap: 18px; position: relative; }
.kb-phero-info { flex: 1; }
.kb-sub-2 { margin-top: 4px; opacity: .9; }
.kb-rating-badge { background: var(--kb-accent, #a9ff03); color: #04210f; border-radius: 16px; padding: 12px 18px; text-align: center; min-width: 84px; }
.kb-rating-badge b { display: block; font-size: 34px; font-weight: 900; line-height: 1; }
.kb-rating-badge span { font-size: 12px; font-weight: 700; }

.kb-comp-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 16px 0 4px; padding-bottom: 4px; }
.kb-comp-tab { white-space: nowrap; border: 1px solid var(--kb-line); background: var(--kb-card); border-radius: 20px; padding: 7px 16px; font: inherit; font-weight: 700; cursor: pointer; color: var(--kb-muted); }
.kb-comp-tab.active { background: var(--kb-ink, #0a0a0a); color: #fff; border-color: var(--kb-ink, #0a0a0a); }

.kb-adv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.kb-adv-card { background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; padding: 12px; text-align: center; }
.kb-adv-card b { display: block; font-size: 24px; font-weight: 900; color: var(--kb-text); }
.kb-adv-card span { font-size: 12px; color: var(--kb-muted); }

.kb-goalbreak { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: center; }
.kb-zonemap { width: 100%; height: auto; border-radius: 12px; }
.kb-gbar { display: grid; grid-template-columns: 90px 1fr 32px; align-items: center; gap: 8px; padding: 6px 0; }
.kb-gbar-l { font-size: 13px; color: var(--kb-muted); }
.kb-gbar-t { height: 10px; background: var(--kb-line); border-radius: 6px; overflow: hidden; }
.kb-gbar-t span { display: block; height: 100%; background: var(--kb-accent, #a9ff03); }
.kb-gbar b { font-variant-numeric: tabular-nums; }
@media (max-width: 620px) { .kb-goalbreak { grid-template-columns: 1fr; } }

.kb-traits { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.kb-trait { background: color-mix(in srgb, var(--kb-accent, #a9ff03) 12%, var(--kb-card)); border: 1px solid var(--kb-line); border-radius: 12px; padding: 11px 13px; }
.kb-trait b { display: block; font-size: 14.5px; }
.kb-trait span { font-size: 12px; color: var(--kb-muted); }

/* ---------- Heatmap (per-player, per-match) ---------- */
.kb-lp { position: relative; }
.kb-lp[data-heat] { cursor: pointer; }
.kb-lp-heat { font-size: 13px; }
.kb-lp-link { text-decoration: none; color: var(--kb-muted); font-weight: 700; padding: 0 4px; }
.kb-lp-link:hover { color: var(--kb-accent-dark, #7bc200); }
.kb-heat-modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.kb-heat-inner { background: #0e3d24; border-radius: 16px; padding: 16px; max-width: 560px; width: 92vw; position: relative; }
.kb-heat-inner img { width: 100%; height: auto; border-radius: 10px; display: block; background: #0e3d24; }
.kb-heat-name { color: #fff; font-weight: 800; text-align: center; margin-bottom: 10px; font-size: 16px; }
.kb-heat-x { position: absolute; top: 8px; left: 12px; background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }
.kb-heat-inner .kb-note { color: #cdeccd; margin-top: 8px; }

/* ===== Team form line (hero) ===== */
.kb-formline{display:flex;align-items:center;gap:5px;margin-top:10px;flex-wrap:wrap}
.kb-formlabel{font-size:13px;color:var(--kb-muted);margin-inline-end:4px}
.kb-fdot{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;font-size:12px;font-weight:700;color:#fff}
.kb-fdot-w{background:#16a34a}
.kb-fdot-d{background:#9ca3af}
.kb-fdot-l{background:#dc2626}

/* ===== Squad position groups ===== */
.kb-grp-h{display:flex;align-items:center;gap:8px}
.kb-grp-h small{font-size:13px;color:var(--kb-muted);font-weight:600;background:var(--kb-line);border-radius:10px;padding:1px 9px}

/* ===== Standings table ===== */
.kb-standings{width:100%;border-collapse:collapse;font-size:14px}
.kb-standings th,.kb-standings td{padding:9px 6px;text-align:center;border-bottom:1px solid var(--kb-line)}
.kb-standings th{color:var(--kb-muted);font-weight:600;font-size:12px}
.kb-standings td:first-child{color:var(--kb-muted);font-weight:700}
.kb-st-team{text-align:start!important}
.kb-st-team a{display:flex;align-items:center;gap:8px;color:var(--kb-ink);font-weight:600}
.kb-st-team img{width:22px;height:22px;object-fit:contain}
.kb-row-me{background:color-mix(in srgb,var(--kb-accent) 12%,transparent)}
.kb-row-me td{border-bottom-color:var(--kb-accent)}
.kb-row-me .kb-st-team a{color:var(--kb-accent-dark)}
@media(max-width:520px){.kb-standings th:nth-child(7),.kb-standings td:nth-child(7),
.kb-standings th:nth-child(8),.kb-standings td:nth-child(8){display:none}}

/* ===== Scorers / assists ranked lists ===== */
.kb-rank-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media(max-width:640px){.kb-rank-grid{grid-template-columns:1fr}}
.kb-ranklist{list-style:none;margin:0;padding:0}
.kb-ranklist li{display:flex;align-items:center;gap:10px;padding:8px 4px;border-bottom:1px solid var(--kb-line)}
.kb-rk-no{width:22px;text-align:center;color:var(--kb-muted);font-weight:700}
.kb-rk-ph{width:34px;height:34px;border-radius:50%;object-fit:cover;background:var(--kb-line)}
.kb-rk-name{flex:1;display:flex;flex-direction:column;line-height:1.25}
.kb-rk-name small{color:var(--kb-muted);font-size:12px}
.kb-rk-tl{width:20px;height:20px;object-fit:contain;opacity:.85}
.kb-rk-val{font-weight:800;color:var(--kb-accent-dark);min-width:42px;text-align:end}
.kb-rk-val small{color:var(--kb-muted);font-weight:600;font-size:11px}

/* ===== Fixtures by round (collapsible) ===== */
.kb-round{border:1px solid var(--kb-line);border-radius:var(--kb-radius);margin-bottom:10px;overflow:hidden}
.kb-round>summary{cursor:pointer;padding:11px 14px;font-weight:700;background:var(--kb-card);list-style:none;display:flex;align-items:center;gap:8px}
.kb-round>summary::-webkit-details-marker{display:none}
.kb-round>summary::before{content:"▸";color:var(--kb-muted);transition:transform .2s}
.kb-round[open]>summary::before{transform:rotate(90deg)}
.kb-round>summary small{color:var(--kb-muted);font-weight:600;font-size:12px}
.kb-round .kb-match{border:0;border-top:1px solid var(--kb-line);border-radius:0;margin:0}

/* ===== Competition hero logo (contain, not cover) ===== */
.kb-chero .kb-hero-img{object-fit:contain;background:var(--kb-card);padding:6px}

/* ===== Competitions index — league cards (dense, row-style) ===== */
.kb-lg-hero h1{margin:0;font-size:26px}
.kb-lg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:10px}
.kb-lg-grid-feat{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.kb-lg-card{position:relative;display:flex;align-items:center;gap:12px;padding:12px 14px;
  border:1px solid var(--kb-line);border-radius:var(--kb-radius);background:var(--kb-card);
  color:var(--kb-ink);transition:transform .12s,border-color .12s,box-shadow .12s}
.kb-lg-card:hover{transform:translateY(-2px);border-color:var(--kb-accent);box-shadow:0 6px 18px rgba(0,0,0,.06)}
.kb-lg-logo{flex:0 0 auto;width:44px;height:44px;display:flex;align-items:center;justify-content:center;
  background:#fff;border-radius:10px;border:1px solid var(--kb-line)}
.kb-lg-logo img{width:32px;height:32px;object-fit:contain}
.kb-lg-meta{display:flex;flex-direction:column;line-height:1.3;min-width:0}
.kb-lg-name{font-size:15px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kb-lg-country{color:var(--kb-muted);font-size:12px}
.kb-lg-card.is-featured{border-color:var(--kb-accent);background:color-mix(in srgb,var(--kb-accent) 5%,var(--kb-card))}
.kb-lg-star{position:absolute;inset-inline-start:10px;top:10px;color:var(--kb-accent-dark);font-size:13px}

/* ===== Breadcrumbs ===== */
.kb-crumbs{margin:0 0 14px}
.kb-crumbs ol{list-style:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0;padding:0;font-size:13px}
.kb-crumbs li{color:var(--kb-muted)}
.kb-crumbs li a{color:var(--kb-muted)}
.kb-crumbs li a:hover{color:var(--kb-accent-dark)}
.kb-crumbs li:not(:last-child)::after{content:"‹";margin-inline-start:6px;color:var(--kb-line)}
.kb-crumbs li[aria-current="page"]{color:var(--kb-ink);font-weight:700}

/* ===== Standings: qualification legend + group cards + zone badges ===== */
.kb-qz-legend{display:flex;flex-wrap:wrap;gap:14px;margin:0 0 16px;font-size:12.5px;color:var(--kb-muted)}
.kb-qz-item{display:inline-flex;align-items:center;gap:6px}
.kb-qz-item i{width:11px;height:11px;border-radius:3px;display:inline-block}

.kb-grp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:14px}
.kb-grp-card{border:1px solid var(--kb-line);border-radius:var(--kb-radius);overflow:hidden;background:var(--kb-card)}
.kb-grp-title{margin:0;padding:10px 14px;font-size:14px;font-weight:800;
  background:linear-gradient(90deg,color-mix(in srgb,var(--kb-accent) 14%,transparent),transparent);
  border-bottom:1px solid var(--kb-line)}
.kb-gtable{margin:0}
.kb-gtable th,.kb-gtable td{padding:8px 6px}

/* position badge with a qualification colour strip on the start edge */
.kb-pos-badge{display:inline-block;min-width:22px;padding:2px 7px;border-radius:5px;
  font-weight:700;background:var(--kb-line);color:var(--kb-ink);
  border-inline-start:3px solid transparent}
.kb-standings .kb-pos{padding-inline-start:8px}

/* richer team cell + row hover */
.kb-standings tbody tr{transition:background .12s}
.kb-standings tbody tr:hover{background:color-mix(in srgb,var(--kb-accent) 6%,transparent)}
.kb-standings .kb-st-team a{display:flex;align-items:center;gap:9px;color:var(--kb-ink);font-weight:600}
.kb-standings .kb-st-team img{width:24px;height:24px;object-fit:contain;border-radius:3px;flex:0 0 auto}
.kb-standings .kb-st-team span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ===== Fixtures match-day meta strip (stadium · channel · notes) ===== */
.kb-fixrow{border-top:1px solid var(--kb-line)}
.kb-fixrow:first-child{border-top:0}
.kb-round .kb-fixrow .kb-match{border:0;margin:0}
.kb-fixmeta{display:flex;flex-wrap:wrap;gap:8px 16px;padding:0 16px 10px;font-size:12px;color:var(--kb-muted)}
.kb-fixmeta .kb-ch{font-weight:700;color:var(--kb-accent-dark);background:color-mix(in srgb,var(--kb-accent) 12%,transparent);
  padding:1px 9px;border-radius:999px}
.kb-fixmeta .kb-fixnote{font-style:italic}

/* ===== Stadium cards ===== */
.kb-stad-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.kb-stad-card{border:1px solid var(--kb-line);border-radius:var(--kb-radius);overflow:hidden;background:var(--kb-card)}
.kb-stad-img{height:130px;background:var(--kb-line);display:flex;align-items:center;justify-content:center}
.kb-stad-img img{width:100%;height:100%;object-fit:cover}
.kb-stad-noimg{font-size:40px}
.kb-stad-body{padding:12px 14px}
.kb-stad-body b{display:block;font-size:15px}
.kb-stad-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.kb-stad-tags span{font-size:12px;background:var(--kb-line);border-radius:999px;padding:2px 10px;font-weight:600}

/* ===== Reels (vertical short videos in our identity) ===== */
.kb-reels{display:flex;gap:14px;overflow-x:auto;padding:4px 2px 12px;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch}
.kb-reels::-webkit-scrollbar{height:6px}
.kb-reels::-webkit-scrollbar-thumb{background:var(--kb-line);border-radius:3px}
.kb-reel{position:relative;flex:0 0 auto;width:230px;aspect-ratio:9/16;border-radius:16px;overflow:hidden;
  background:#000;scroll-snap-align:start;box-shadow:0 6px 20px rgba(0,0,0,.18)}
.kb-reel-v,.kb-reel-frame{width:100%;height:100%;object-fit:cover;border:0;display:block;cursor:pointer}
.kb-reel-yt{position:absolute;inset:0;background-size:cover;background-position:center;cursor:pointer;
  display:flex;align-items:center;justify-content:center}
.kb-reel-play{width:54px;height:54px;border-radius:50%;border:0;background:rgba(0,0,0,.55);color:#fff;
  font-size:20px;cursor:pointer;backdrop-filter:blur(2px)}
.kb-reel-sound{position:absolute;top:10px;inset-inline-end:10px;width:34px;height:34px;border-radius:50%;border:0;
  background:rgba(0,0,0,.5);color:#fff;font-size:15px;cursor:pointer;z-index:2}
.kb-reel-ov{position:absolute;inset-inline:0;bottom:0;padding:28px 12px 12px;pointer-events:none;
  background:linear-gradient(to top,rgba(0,0,0,.75),transparent);display:flex;flex-direction:column;gap:3px}
.kb-reel-title{color:#fff;font-weight:700;font-size:13px;line-height:1.35;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.kb-reel-brand{color:var(--kb-accent);font-weight:800;font-size:11px;letter-spacing:.3px}
@media (max-width:520px){.kb-reel{width:62vw;max-width:260px}}

/* ===== Reels: multi-platform embeds + link fallback + single (in articles) ===== */
.kb-reel.is-embed{width:340px;aspect-ratio:auto;background:var(--kb-card);border:1px solid var(--kb-line);
  display:flex;align-items:center;justify-content:center;box-shadow:none}
.kb-reel-embed{width:100%}
.kb-reel-embed iframe,.kb-reel-embed blockquote{max-width:100%!important;margin:0!important}
.kb-reel-embed iframe{width:100%!important;display:block;border:0}
.kb-reel-fallback{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;
  text-decoration:none;background-size:cover;background-position:center;background-color:#111}
.kb-reel-fallback::before{content:"";position:absolute;inset:0;background:rgba(0,0,0,.45)}
.kb-reel-pf{position:relative;font-size:42px}
.kb-reel-cta{position:relative;color:#fff;font-weight:800;font-size:14px;background:var(--kb-accent);
  color:#0a0a0a;padding:7px 16px;border-radius:999px}
.kb-reels-single{justify-content:center}
.kb-reels-single .kb-reel{width:300px}
.kb-reels-single .kb-reel.is-embed{width:min(100%,360px)}
@media (max-width:520px){.kb-reel.is-embed{width:86vw;max-width:340px}}

/* ===== Premium Match Details (beIN Style) ===== */
.kb-date-wrap { margin-bottom: 20px; font-weight: 700; background: rgba(255,255,255,0.08); display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 0.9rem; }

.kb-broadcast-box { 
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
  gap: 16px; 
  margin-top: 24px; 
  padding: 20px; 
  background: rgba(255,255,255,0.05); 
  border: 1px solid rgba(255,255,255,0.1); 
  border-radius: 20px; 
  text-align: right;
  backdrop-filter: blur(4px);
}

.kb-info-item { display: flex; align-items: center; gap: 12px; }
.kb-info-icon { 
  width: 40px; height: 40px; 
  background: var(--kb-accent); 
  color: #000; 
  display: flex; align-items: center; justify-content: center; 
  border-radius: 12px; 
  font-size: 1.2rem; 
  box-shadow: 0 4px 12px rgba(169, 255, 3, 0.3);
}
.kb-info-label { color: #9ca3af; font-size: 0.8rem; display: block; margin-bottom: 2px; }
.kb-info-val { color: #fff; font-weight: 800; font-size: 1rem; }

/* Match Progress Bar (LIVE) */
.kb-match-progress-wrap { margin-top: 25px; padding: 0 10%; }
.kb-progress-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; position: relative; }
.kb-progress-fill { height: 100%; background: linear-gradient(90deg, var(--kb-accent), #facc15); width: 0%; transition: width 1s ease-in-out; }
.kb-progress-fill::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 10px; background: #fff; filter: blur(4px); opacity: 0.8; }

/* Responsive adjustments */
@media (max-width: 640px) {
  .kb-broadcast-box { grid-template-columns: 1fr; gap: 20px; padding: 16px; }
  .kb-board { padding: 30px 14px; }
}


/* ============================================================
   MATCH PAGE TABS  (المباراة · التشكيلة · الإحصائيات · شائع ·
   أخبار · المواجهات · توقعات)  — added for tabbed match detail
   ============================================================ */

/* --- Tab nav --- */
.kb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; padding-bottom: 4px;
  border-bottom: 2px solid var(--kb-line); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.kb-tab { flex: 0 0 auto; appearance: none; background: transparent; border: none; cursor: pointer;
  font-family: var(--kb-font); font-size: .92rem; font-weight: 700; color: var(--kb-muted);
  padding: 10px 16px; border-radius: 10px 10px 0 0; position: relative; white-space: nowrap;
  transition: color .15s, background .15s; }
.kb-tab:hover { color: var(--kb-text); background: rgba(0,0,0,.03); }
.kb-tab.is-active { color: var(--kb-text); }
.kb-tab.is-active::after { content: ''; position: absolute; inset-inline: 8px; bottom: -6px; height: 4px;
  background: var(--kb-accent); border-radius: 999px; }

/* --- Panels --- */
.kb-tab-body { margin-top: 18px; }
.kb-tab-panel { display: none; animation: kbfade .2s ease; }
.kb-tab-panel.is-active { display: block; }
.kb-tab-panel > h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 14px;
  padding-inline-start: 12px; border-inline-start: 4px solid var(--kb-accent); }
@keyframes kbfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* --- Statistics (الإحصائيات) — card with team-headed rows --- */
.kb-stat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-weight: 800; color: #fff; background: var(--kb-ink); border-radius: 12px 12px 0 0;
  padding: 12px 16px; font-size: .95rem; }
.kb-stat-head span { flex: 1; }
.kb-stat-head span:first-child { text-align: start; color: var(--kb-accent); }
.kb-stat-head span:last-child { text-align: end; }
.kb-statwrap { background: var(--kb-card); border: 1px solid var(--kb-line); border-top: none;
  border-radius: 0 0 12px 12px; padding: 16px; }
.kb-statrow { margin-bottom: 16px; }
.kb-statrow:last-child { margin-bottom: 0; }
.kb-statrow-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.kb-statrow-top span { color: var(--kb-muted); font-size: .82rem; text-align: center; flex: 1; font-weight: 600; }
.kb-statrow-top b { font-weight: 800; font-size: 1.05rem; min-width: 60px; color: var(--kb-text); }
.kb-statrow-top b:first-child { text-align: start; }
.kb-statrow-top b:last-child { text-align: end; }
.kb-statrow.is-major .kb-statrow-top span { color: var(--kb-text); font-weight: 700; }
.kb-statbar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: #eef0f2; gap: 2px; }
.kb-statbar span { transition: width .5s ease; }
/* RTL: home grows from the start (right), away from the end (left) */
.kb-statbar-h { background: linear-gradient(90deg, var(--kb-accent-dark), var(--kb-accent)); border-radius: 999px 0 0 999px; }
.kb-statbar-a { background: #94a3b8; border-radius: 0 999px 999px 0; }
.kb-statrow.is-major .kb-statbar { height: 12px; }

/* --- Interactive vote poll (توقعات — first-party engagement) --- */
.kb-vote { background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; padding: 18px; max-width: 560px; }
.kb-vote-q { font-weight: 800; margin-bottom: 14px; font-size: 1.05rem; text-align: center; }
.kb-vote-opt { position: relative; display: flex; align-items: center; width: 100%; margin-bottom: 10px;
  padding: 13px 16px; border: 1.5px solid var(--kb-line); border-radius: 10px; background: #fff;
  font-family: var(--kb-font); font-size: .95rem; font-weight: 700; color: var(--kb-text);
  cursor: pointer; overflow: hidden; transition: border-color .15s, transform .08s; }
.kb-vote:not(.is-voted) .kb-vote-opt:hover { border-color: var(--kb-accent); transform: translateY(-1px); }
.kb-vote-fill { position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0;
  background: rgba(169,255,3,.22); transition: width .5s ease; z-index: 0; }
.kb-vote-label { position: relative; z-index: 1; flex: 1; text-align: start; }
.kb-vote-pct { position: relative; z-index: 1; font-weight: 800; color: var(--kb-accent-dark); opacity: 0; transition: opacity .3s; }
.kb-vote.is-voted .kb-vote-pct { opacity: 1; }
.kb-vote.is-voted .kb-vote-opt { cursor: default; }
.kb-vote.is-voted .kb-vote-opt.is-chosen { border-color: var(--kb-accent-dark); }
.kb-vote.is-voted .kb-vote-opt.is-chosen .kb-vote-fill { background: rgba(169,255,3,.4); }
.kb-vote.is-voted .kb-vote-opt.is-chosen .kb-vote-label::after { content: ' ✓'; color: var(--kb-accent-dark); }
.kb-vote-total { text-align: center; color: var(--kb-muted); font-size: .85rem; margin-top: 8px; font-weight: 700; }

/* --- Top performers (شائع) --- */
.kb-perf-cat { margin-bottom: 18px; }
.kb-perf-cat-name { font-weight: 800; color: var(--kb-accent-dark); margin-bottom: 8px; font-size: .9rem; }
.kb-perf-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kb-perf-card { display: flex; flex-direction: column; gap: 3px; background: var(--kb-card);
  border: 1px solid var(--kb-line); border-radius: 12px; padding: 12px; text-decoration: none;
  color: inherit; transition: box-shadow .15s; }
.kb-perf-card:hover { box-shadow: 0 0 0 2px var(--kb-accent); }
.kb-perf-empty { background: transparent; border-style: dashed; }
.kb-perf-name { font-weight: 800; }
.kb-perf-pos { color: var(--kb-muted); font-size: .75rem; margin-bottom: 4px; }
.kb-perf-stat { font-size: .8rem; color: var(--kb-text); }
.kb-perf-stat i { font-style: normal; font-weight: 800; color: var(--kb-accent-dark); }

/* --- Related news (أخبار) --- */
.kb-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.kb-news-card { display: flex; flex-direction: column; background: var(--kb-card); border: 1px solid var(--kb-line);
  border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .12s; }
.kb-news-card:hover { box-shadow: 0 0 0 2px var(--kb-accent); transform: translateY(-3px); }
.kb-news-thumb img { width: 100%; height: 130px; object-fit: cover; display: block; }
.kb-news-title { font-weight: 700; font-size: .9rem; padding: 10px 12px 4px; line-height: 1.5; }
.kb-news-date { color: var(--kb-muted); font-size: .75rem; padding: 0 12px 12px; margin-top: auto; }

/* --- Shot map (خريطة التسديدات) --- */
.kb-shotmap-title { font-size: 1rem; font-weight: 800; margin: 26px 0 12px; padding-inline-start: 12px; border-inline-start: 4px solid var(--kb-accent); }
.kb-shotmap-title small { display: block; font-weight: 600; margin-top: 4px; }
.kb-shotmap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kb-shotmap-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: .85rem; }
.kb-shotmap-h span { color: var(--kb-accent-dark); font-weight: 800; }
.kb-shotmap-pitch { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden;
  background: repeating-linear-gradient(0deg, #1f8a4c 0 28px, #1c8047 28px 56px); border: 1px solid rgba(255,255,255,.2); }
.kb-shotmap-goal { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 40%; height: 9%;
  border: 2px solid rgba(255,255,255,.5); border-top: none; }
.kb-shot { position: absolute; transform: translate(-50%, 50%); border-radius: 50%; border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: help; }
.kb-shot-goal { background: var(--kb-accent); }
.kb-shot-on { background: #38bdf8; }
.kb-shot-off { background: rgba(255,255,255,.55); }

@media (max-width: 480px) { .kb-shotmap { gap: 8px; } }

@media (max-width: 640px) {
  .kb-perf-stat { font-size: .72rem; }
  .kb-tab { padding: 9px 12px; font-size: .85rem; }
}

/* --- Scoreboard: clickable league --- */
.kb-league-link { color: var(--kb-accent); text-decoration: none; }
.kb-league-link:hover { text-decoration: underline; }

/* --- Team rank badge (group/league position, Google-style) --- */
.kb-rank { display: inline-block; margin-top: 6px; background: rgba(255,255,255,.12); color: #e5e7eb;
  font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }

/* --- Google-style live clock (MM:SS, green, pulsing) --- */
.kb-clock { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  background: rgba(16,185,129,.15); border: 1px solid #10b981; color: #10b981;
  font-weight: 800; font-size: 1.05rem; padding: 4px 12px; border-radius: 999px; direction: ltr; }
.kb-clock-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: kbpulse 1.2s infinite; }
@keyframes kbpulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* --- Goal scorers under the scoreboard (Google-style) --- */
.kb-scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 720px; margin: 14px auto 0;
  padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); }
.kb-scorers-side { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: #e5e7eb; }
.kb-scorers-h { text-align: start; }
.kb-scorers-a { text-align: end; }

/* --- One-tap share row (viral acquisition) --- */
.kb-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.kb-share-label { color: #9ca3af; font-size: .82rem; font-weight: 700; }
.kb-share-btn { display: inline-flex; align-items: center; gap: 5px; font-family: var(--kb-font);
  font-size: .8rem; font-weight: 800; padding: 7px 14px; border-radius: 999px; border: none; cursor: pointer;
  text-decoration: none; color: #fff; transition: transform .1s, opacity .15s; }
.kb-share-btn:hover { transform: translateY(-1px); opacity: .92; }
.kb-sh-wa { background: #25D366; color: #062b14; }
.kb-sh-tg { background: #229ED9; }
.kb-sh-x { background: #000; border: 1px solid #333; }
.kb-sh-copy { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); }
.kb-sh-card { background: var(--kb-accent); color: #0a0a0a; }

/* --- Auto match prose (SEO نظرة/ملخص) --- */
.kb-story { margin-top: 18px; background: var(--kb-card); border: 1px solid var(--kb-line);
  border-radius: 14px; padding: 18px 20px; }
.kb-story > h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 10px; padding-inline-start: 12px;
  border-inline-start: 4px solid var(--kb-accent); }
.kb-story p { margin: 0 0 10px; line-height: 1.9; color: var(--kb-text); font-size: .95rem; }
.kb-story p:last-child { margin-bottom: 0; }
.kb-story strong { color: var(--kb-accent-dark); font-weight: 800; }

/* --- Player of the match card (رجل المباراة) --- */
.kb-motm { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--kb-ink), #1e293b);
  color: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; text-decoration: none;
  border: 1px solid rgba(169,255,3,.3); }
.kb-motm:hover { box-shadow: 0 0 0 2px var(--kb-accent); }
.kb-motm-badge { background: var(--kb-accent); color: #0a0a0a; font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.kb-motm-name { font-weight: 800; font-size: 1.05rem; }
.kb-motm-team { color: #9ca3af; font-size: .82rem; }
.kb-motm-rating { margin-inline-start: auto; background: var(--kb-accent); color: #0a0a0a; font-weight: 800;
  font-size: 1rem; padding: 4px 12px; border-radius: 8px; direction: ltr; }

/* --- Net play time chip (الإحصائيات) --- */
.kb-playtime { display: inline-block; background: var(--kb-card); border: 1px solid var(--kb-line); color: var(--kb-muted);
  font-size: .82rem; font-weight: 700; padding: 6px 14px; border-radius: 999px; margin-bottom: 14px; }

/* --- Events timeline: type accents --- */
.kb-tl-kind { display: block; font-style: normal; font-size: .72rem; color: var(--kb-muted); margin-top: 1px; }
.kb-tl-k-red .kb-tl-icon, .kb-tl-k-yellow .kb-tl-icon { filter: drop-shadow(0 0 1px rgba(0,0,0,.3)); }
.kb-tl-k-goal .kb-tl-txt b, .kb-tl-k-penalty .kb-tl-txt b { color: var(--kb-accent-dark); }
.kb-tl-k-var .kb-tl-kind { color: #d97706; font-weight: 700; }

/* --- Shot map: clearer dots --- */
.kb-shot { opacity: .92; }
.kb-shot-goal { background: var(--kb-accent); box-shadow: 0 0 0 2px rgba(169,255,3,.4), 0 1px 3px rgba(0,0,0,.5); }
.kb-shot-on { background: #38bdf8; }
.kb-shot-off { background: rgba(255,255,255,.7); }

/* ============================================================
   FAVORITE TEAMS  (الفرق المفضّلة)
   ============================================================ */

/* Follow button (teams + players) with live follower count */
.kb-fav-star { display: inline-flex; align-items: center; gap: 7px; vertical-align: middle; margin-inline-start: 10px;
  background: linear-gradient(135deg, rgba(169,255,3,.16), rgba(169,255,3,.04));
  color: #fff; border: 1px solid var(--kb-accent);
  font-family: var(--kb-font); font-size: .82rem; font-weight: 800; padding: 6px 8px 6px 14px; border-radius: 999px; cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s; }
.kb-fav-star:hover { transform: translateY(-1px); box-shadow: 0 3px 12px rgba(169,255,3,.25); }
.kb-fav-star:disabled { opacity: .6; cursor: default; }
.kb-fav-star.is-on { background: var(--kb-accent); color: #0a0a0a; }
.kb-fav-ico { font-size: 1.05rem; line-height: 1; color: var(--kb-accent); }
.kb-fav-star.is-on .kb-fav-ico { color: #0a0a0a; }
/* follower count pill inside the button */
.kb-fav-count { background: rgba(0,0,0,.35); color: #fff; font-size: .72rem; font-weight: 800;
  min-width: 22px; text-align: center; padding: 2px 7px; border-radius: 999px; direction: ltr; }
.kb-fav-star.is-on .kb-fav-count { background: rgba(0,0,0,.18); color: #0a0a0a; }
.kb-fav-n { background: var(--kb-accent); color: #0a0a0a; font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; margin-inline-start: 4px; }

/* Favorites app (shortcode screen) */
.kb-fav-app { max-width: 720px; margin: 0 auto; }
.kb-fav-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kb-fav-head h2 { font-size: 1.3rem; font-weight: 800; margin: 0; }
.kb-fav-logout { background: none; border: 1px solid var(--kb-line); color: var(--kb-muted); border-radius: 8px;
  padding: 6px 14px; cursor: pointer; font-family: var(--kb-font); font-weight: 700; }
.kb-fav-logout:hover { color: var(--kb-text); border-color: var(--kb-muted); }
.kb-fav-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.kb-fav-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--kb-card); border: 1px solid var(--kb-line);
  border-radius: 999px; padding: 5px 6px 5px 12px; font-size: .85rem; font-weight: 700; }
.kb-fav-chip img { width: 22px; height: 22px; object-fit: contain; border-radius: 50%; background: #fff; }
.kb-fav-rm { background: var(--kb-line); border: none; width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  font-weight: 800; line-height: 1; color: var(--kb-muted); }
.kb-fav-rm:hover { background: #ef4444; color: #fff; }
.kb-fav-sub { font-size: 1.05rem; font-weight: 800; margin: 0 0 12px; padding-inline-start: 12px; border-inline-start: 4px solid var(--kb-accent); }

/* Favorite match cards */
.kb-fav-matches { display: flex; flex-direction: column; gap: 10px; }
.kb-fav-match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; padding: 12px 16px;
  text-decoration: none; color: inherit; transition: box-shadow .15s; }
.kb-fav-match:hover { box-shadow: 0 0 0 2px var(--kb-accent); }
.kb-fav-team { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.kb-fav-team:last-child { flex-direction: row-reverse; }
.kb-fav-team img { width: 34px; height: 34px; object-fit: contain; }
.kb-fav-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 86px; text-align: center; }
.kb-fav-score { font-weight: 800; font-size: 1.05rem; direction: ltr; }
.kb-fav-when { font-size: .72rem; color: var(--kb-muted); }
.kb-fav-live { font-size: .72rem; color: #10b981; font-weight: 800; }
.kb-fav-ch { font-size: .68rem; color: var(--kb-muted); }

/* Auth (login / register) */
.kb-auth { max-width: 380px; margin: 0 auto; background: var(--kb-card); border: 1px solid var(--kb-line);
  border-radius: 16px; padding: 22px; }
.kb-auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.kb-auth-tabs button { flex: 1; background: transparent; border: 1px solid var(--kb-line); color: var(--kb-muted);
  padding: 9px; border-radius: 10px; cursor: pointer; font-family: var(--kb-font); font-weight: 700; }
.kb-auth-tabs button.is-active { background: var(--kb-ink); color: #fff; border-color: var(--kb-ink); }
.kb-auth-form { display: flex; flex-direction: column; gap: 10px; }
.kb-auth-form input { padding: 11px 14px; border: 1px solid var(--kb-line); border-radius: 10px; font-family: var(--kb-font); font-size: .95rem; }
.kb-auth-form input:focus { outline: none; border-color: var(--kb-accent); }
.kb-auth-submit { background: var(--kb-accent); color: #0a0a0a; border: none; border-radius: 10px; padding: 12px;
  font-family: var(--kb-font); font-weight: 800; font-size: 1rem; cursor: pointer; }
.kb-auth-submit:hover { background: var(--kb-accent-dark); }
.kb-auth-submit:disabled { opacity: .6; cursor: default; }
.kb-auth-msg { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 12px; font-size: .85rem; margin: 0; }

@media (max-width: 480px) {
  .kb-fav-team b { font-size: .8rem; }
  .kb-fav-team img { width: 28px; height: 28px; }
}

/* --- Lineup pitch graphic (التشكيلة المتوقعة) --- */
.kb-pitch-head { display: flex; justify-content: space-between; font-size: .85rem; color: var(--kb-muted); margin-bottom: 10px; }
.kb-pitch-head b { color: var(--kb-text); }
.kb-pitch { position: relative; width: 100%; max-width: 560px; margin: 0 auto; aspect-ratio: 3 / 4;
  border-radius: 14px; overflow: hidden;
  background:
    repeating-linear-gradient(0deg, #1f8a4c 0 40px, #1c8047 40px 80px);
  border: 2px solid rgba(255,255,255,.25); }
/* pitch markings */
.kb-pitch-lines { position: absolute; inset: 0; pointer-events: none; }
.kb-pitch-lines::before { /* halfway line */
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: rgba(255,255,255,.5); }
.kb-pitch-lines::after { /* centre circle */
  content: ''; position: absolute; left: 50%; top: 50%; width: 90px; height: 90px; transform: translate(-50%,-50%);
  border: 2px solid rgba(255,255,255,.5); border-radius: 50%; }
.kb-pitch::before, .kb-pitch::after { /* penalty boxes top & bottom */
  content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  width: 46%; height: 14%; border: 2px solid rgba(255,255,255,.4); }
.kb-pitch::before { top: 0; border-top: none; }
.kb-pitch::after { bottom: 0; border-bottom: none; }

/* player marker */
.kb-pp { position: absolute; transform: translate(-50%, 50%); width: 64px; text-align: center; z-index: 2; }
.kb-pp-away { transform: translate(-50%, -50%); }
.kb-pp[role="button"] { cursor: pointer; }
.kb-pp-img { position: relative; display: block; width: 44px; height: 44px; margin: 0 auto; border-radius: 50%;
  background-size: cover; background-position: center; background-color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.kb-pp-rating { position: absolute; bottom: -4px; inset-inline-end: -4px; font-style: normal; font-size: .6rem; font-weight: 800;
  background: var(--kb-accent); color: #0a0a0a; border-radius: 6px; padding: 0 3px; line-height: 1.5; }
.kb-pp.has-heat .kb-pp-img { cursor: pointer; }
.kb-pp.has-heat:hover .kb-pp-img { border-color: var(--kb-accent); }
.kb-pp-heat { position: absolute; top: -6px; inset-inline-start: -6px; font-style: normal; font-size: .7rem; }
.kb-pp-name { display: block; margin-top: 3px; font-size: .68rem; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64px; }
.kb-pp-link { position: absolute; top: -6px; inset-inline-end: -6px; width: 18px; height: 18px; line-height: 17px;
  text-align: center; font-size: .7rem; font-weight: 800; text-decoration: none;
  background: #fff; color: var(--kb-ink); border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.4); opacity: 0; transition: opacity .15s; }
.kb-pp:hover .kb-pp-link { opacity: 1; }
@media (hover: none) { .kb-pp-link { opacity: 1; } }

/* bench */
.kb-bench-title { font-size: 1rem; font-weight: 800; margin: 22px 0 12px; padding-inline-start: 12px; border-inline-start: 4px solid var(--kb-accent); }
.kb-bench { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kb-bench-col h4 { margin: 0 0 8px; font-size: .9rem; color: var(--kb-accent-dark); }
.kb-bench-row { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: inherit; font-size: .82rem; }
.kb-bench-row:hover { background: rgba(0,0,0,.04); }
.kb-bench-pos { color: var(--kb-muted); font-size: .72rem; min-width: 64px; }
.kb-bench-name { font-weight: 600; }

@media (max-width: 480px) {
  .kb-pp { width: 52px; }
  .kb-pp-img { width: 38px; height: 38px; }
  .kb-pp-name { font-size: .6rem; }
  .kb-pitch-lines::after { width: 64px; height: 64px; }
}

/* ============================================================
   SITE-WIDE DARK MODE  (html.dark — toggled from the header button)
   Applies across the whole site, not just the matches widget.
   ============================================================ */
html.dark {
  --kb-card: #1e293b;
  --kb-line: #334155;
  --kb-text: #e5e7eb;
  --kb-muted: #94a3b8;
}
html.dark body { background: #0f172a !important; color: #e5e7eb; }
html.dark .kb-page,
html.dark .site-main,
html.dark .entry-content,
html.dark article { color: var(--kb-text); }

/* Surfaces that hardcoded a light background */
html.dark .kb-vote-opt { background: #0f172a; }
html.dark .kb-auth,
html.dark .kb-poll,
html.dark .kb-news-card,
html.dark .kb-fav-match,
html.dark .kb-fav-chip,
html.dark .kb-perf-card,
html.dark .kb-statrow,
html.dark .kb-story,
html.dark .kb-playtime { background: var(--kb-card); }
html.dark .kb-auth-form input { background: #0f172a; color: #e5e7eb; border-color: #334155; }
html.dark .kb-auth-tabs button { color: #94a3b8; border-color: #334155; }
html.dark .kb-table td { background: #1e293b; color: #e5e7eb; }
html.dark .kb-tabs { border-bottom-color: #334155; }
html.dark .kb-tab:hover { background: rgba(255,255,255,.06); }

/* Generic light cards used around the theme (scoped, not blanket) */
html.dark .kb-card,
html.dark .widget,
html.dark .post-card,
html.dark .entry-card { background: var(--kb-card) !important; border-color: var(--kb-line); }

/* Links inside content stay readable */
html.dark .entry-content a, html.dark .single-content a { color: #7dd3fc; }

/* ============================================================
   LIVE MATCHES PAGE (مباريات مباشرة) — full-width, delightful
   ============================================================ */
.kb-live-page { width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
  padding: 24px clamp(12px, 4vw, 48px) 64px; font-family: var(--kb-font); box-sizing: border-box; }
.kb-live-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; max-width: 1100px; margin: 0 auto 16px; }
.kb-live-head h1 { font-size: 1.5rem; font-weight: 800; margin: 0; color: var(--kb-text); }
.kb-live-tabs { display: flex; gap: 6px; }
.kb-live-tab { background: var(--kb-card); border: 1px solid var(--kb-line); color: var(--kb-muted);
  font-family: var(--kb-font); font-weight: 800; font-size: .85rem; padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: all .15s; }
.kb-live-tab:hover { color: var(--kb-text); }
.kb-live-tab.is-active { background: var(--kb-accent); color: #0a0a0a; border-color: var(--kb-accent); }

/* date carousel */
.kb-live-dates { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 12px; max-width: 1100px; margin: 0 auto; scrollbar-width: thin; }
.kb-date { flex: 0 0 auto; min-width: 68px; background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px;
  padding: 8px 10px; cursor: pointer; text-align: center; font-family: var(--kb-font); transition: all .15s; }
.kb-date:hover { border-color: var(--kb-accent); }
.kb-date.is-active { background: var(--kb-ink); border-color: var(--kb-ink); }
.kb-date.is-active .kb-date-d, .kb-date.is-active .kb-date-n { color: #fff; }
.kb-date-d { display: block; font-weight: 800; font-size: .8rem; color: var(--kb-text); }
.kb-date-n { display: block; font-size: .7rem; color: var(--kb-muted); margin-top: 2px; }
.kb-date.is-active .kb-date-d { color: var(--kb-accent); }

/* toolbar */
.kb-live-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; max-width: 1100px; margin: 4px auto 18px; }
.kb-live-search { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid var(--kb-line); border-radius: 10px; font-family: var(--kb-font); background: var(--kb-card); color: var(--kb-text); }
.kb-live-search:focus { outline: none; border-color: var(--kb-accent); }
.kb-live-onlylive { font-size: .85rem; color: var(--kb-muted); font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* body + groups */
.kb-live-body { max-width: 1100px; margin: 0 auto; }
.kb-live-loading, .kb-live-empty { text-align: center; color: var(--kb-muted); padding: 40px 0; }
.kb-lm-group { margin-bottom: 22px; }
.kb-lm-league { font-weight: 800; color: var(--kb-accent-dark); font-size: .9rem; margin: 0 0 8px; padding-inline-start: 10px; border-inline-start: 3px solid var(--kb-accent); }

/* match card */
.kb-lm { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  background: var(--kb-card); border: 1px solid var(--kb-line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px;
  text-decoration: none; color: var(--kb-text); transition: box-shadow .15s, transform .08s; }
.kb-lm:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-1px); }
.kb-lm.is-fav { border-color: var(--kb-accent); background: linear-gradient(180deg, rgba(169,255,3,.06), var(--kb-card)); }
.kb-lm-star { position: absolute; top: 8px; inset-inline-start: 10px; font-size: .8rem; }
.kb-lm-team { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .92rem; min-width: 0; }
.kb-lm-team b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-lm-away { flex-direction: row-reverse; }
.kb-lm-team img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.kb-lm-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 92px; text-align: center; }
.kb-lm-score { font-size: 1.25rem; font-weight: 800; direction: ltr; color: var(--kb-text); }
.kb-lm-ft { font-size: .66rem; color: var(--kb-muted); }
.kb-lm-time { font-size: 1.1rem; font-weight: 800; direction: ltr; color: var(--kb-text); }
.kb-lm-cd { font-size: .68rem; font-weight: 800; color: var(--kb-accent-dark); background: rgba(169,255,3,.14); padding: 1px 8px; border-radius: 999px; direction: ltr; }
.kb-lm-live { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 800; color: #10b981; }
.kb-lm-live i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; animation: kbpulse 1.2s infinite; }
.kb-lm-min { font-size: .8rem; font-weight: 800; color: #10b981; direction: ltr; }
.kb-lm-ch { position: absolute; bottom: 6px; inset-inline-end: 12px; font-size: .62rem; color: var(--kb-muted); }

@media (max-width: 560px) {
  .kb-lm-team b { font-size: .8rem; }
  .kb-lm-team img { width: 28px; height: 28px; }
  .kb-lm-mid { min-width: 72px; }
}
