/* ─────────────────────────────────────────────────────────────
   KoraGoal — public website styles
   Hand-written, no build step. Tokens mirror the Flutter app's
   lib/core/theme/tokens.dart so all surfaces stay identical.
   ───────────────────────────────────────────────────────────── */

:root,
[data-theme="dark"] {
    --canvas:     #07101E;
    --surface:    #0F1E32;
    --surface2:   #182840;
    --elevated:   #1E3050;
    --border:     #1A2C44;
    --border2:    #273D5C;
    --text:       #F0F4FF;
    --text2:      #8B9AB8;
    --text-muted: #4E5E7A;
    --accent:     #A8FF00;
}

/* وضع نهاري بخلفية بيضاء ناصعة — طلب المستخدم لونًا أكثر راحة للعين، أقرب
   لدرجة كريمية/خضراء فاتحة بدل #FFFFFF المسطّح في كل مكان. */
[data-theme="light"] {
    --canvas:     #F3F6F1;
    --surface:    #FFFFFF;
    --surface2:   #EAF0E4;
    --elevated:   #FFFFFF;
    --border:     #E1E8DA;
    --border2:    #CBD6C1;
    --text:       #14201A;
    --text2:      #4A5B44;
    --text-muted: #7C8B74;
    --accent:     #1FA84C;
}

:root {
    --live: #FF3B30;
    --win:  #26D100;
    --draw: #A6AC9F;
    --loss: #FF5A4D;
    --ucl:  #1E60C9;
    --uel:  #FF8A00;
    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Tajawal', 'Segoe UI', Arial, sans-serif;
    background: var(--canvas);
    color: var(--text);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

.wrap {
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 16px;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    flex-wrap: wrap;
}

.brand { font-weight: 800; font-size: 20px; color: var(--accent); }

.main-nav { display: flex; gap: 18px; font-size: 15px; font-weight: 500; }

/* ── Main ───────────────────────────────────────────────────── */
.site-main { padding-block: 20px 40px; }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.breadcrumbs .current { color: var(--text2); }

.page-title {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 800;
    margin: 0 0 14px;
}

/* موجود في الصفحة لمحرك البحث وقارئ الشاشة، لكن غير مرئي — للصفحات التي
   يُكرِّر فيها H1 عنواناً واضحاً أصلاً من عنصر آخر (شريط التاريخ في
   الرئيسية مثلاً يعرض "اليوم — الإثنين" فيصبح H1 تكراراً بصرياً بلا فائدة). */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.seo-prose {
    color: var(--text2);
    font-size: 15px;
    margin: 0 0 18px;
}

/* ── Standings table ────────────────────────────────────────── */
/* Wide tables scroll inside their own container so the page body
   never scrolls horizontally on a phone. */
.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.standings {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.standings caption {
    caption-side: top;
    text-align: start;
    padding: 12px 14px;
    font-weight: 700;
    color: var(--text2);
    font-size: 14px;
}

.standings th,
.standings td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.standings thead th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    background: var(--surface2);
}

.standings tbody tr:last-child td { border-bottom: 0; }
.standings tbody tr:hover { background: var(--surface2); }

.standings .col-team { text-align: start; white-space: normal; min-width: 180px; }
.standings .col-pts  { font-weight: 800; color: var(--text); }

.team-cell { display: flex; align-items: center; gap: 8px; }
.team-cell img { width: 22px; height: 22px; object-fit: contain; flex: none; }

/* Rank badge carries the qualification zone colour. */
.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: var(--surface2);
    border-inline-start: 3px solid transparent;
}

/* ── Form (last 5) ──────────────────────────────────────────── */
.form-strip { display: inline-flex; gap: 3px; }
.form-strip i {
    width: 16px; height: 16px;
    border-radius: 4px;
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    color: #07101E;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.form-strip .w { background: var(--win); }
.form-strip .d { background: var(--draw); }
.form-strip .l { background: var(--loss); }

/* ── Zone legend ────────────────────────────────────────────── */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text2);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ── Season switcher ────────────────────────────────────────── */
.seasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.seasons a {
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border2);
    font-size: 13px;
    color: var(--text2);
}
.seasons a[aria-current="page"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #07101E;
    font-weight: 700;
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}
.tabs a {
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text2);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tabs a[aria-current="page"] {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq { margin-top: 32px; }
.faq h2 { font-size: 19px; margin-bottom: 10px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
}
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { color: var(--text2); margin: 8px 0 0; }

/* ── Home / archive board ───────────────────────────────────── */
.day-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}
.day-nav .day-current { font-weight: 700; }
.day-nav .disabled { color: var(--text-muted); }

.comp-block { margin-bottom: 18px; }

.comp-head {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
}
.comp-head a { display: inline-flex; align-items: center; gap: 8px; }
.comp-head img { width: 20px; height: 20px; object-fit: contain; }

.match-list {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.match-row {
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

/* The whole row is the link target — a 44px-tall tap area on a phone. */
.match-link {
    display: grid;
    grid-template-columns: 62px 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
}
.match-link:hover { background: var(--surface2); color: inherit; }
.match-row:last-child { border-bottom: 0; }
.match-row.is-live { background: color-mix(in srgb, var(--live) 8%, transparent); }

.match-time { color: var(--text2); font-size: 13px; text-align: center; }
.match-time .live-dot { color: var(--live); font-weight: 700; }

.match-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.match-team.home { justify-content: flex-end; text-align: end; }
.match-team.away { justify-content: flex-start; text-align: start; }
.match-team img { width: 20px; height: 20px; object-fit: contain; flex: none; }

.match-score {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 46px;
    text-align: center;
}

@media (max-width: 420px) {
    .match-row { font-size: 13px; }
    .match-link { grid-template-columns: 50px 1fr auto 1fr; gap: 6px; }
    .match-team img { width: 18px; height: 18px; }
}

/* ── Match page ─────────────────────────────────────────────── */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 14px;
    margin-bottom: 16px;
    text-align: center;
}
.scoreboard.is-live { border-color: var(--live); }

.sb-team { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; }
.sb-team img { width: 48px; height: 48px; object-fit: contain; }

.sb-score { font-size: clamp(26px, 7vw, 38px); font-weight: 800; font-variant-numeric: tabular-nums; }
.sb-score.muted { color: var(--text-muted); }
.sb-pens { font-size: 12px; color: var(--text2); }
.sb-status { font-size: 13px; color: var(--text2); margin-top: 4px; }
.live-dot { color: var(--live); font-weight: 700; }

.meta-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.meta-list li { background: var(--surface); padding: 10px 14px; font-size: 14px; display: flex; gap: 10px; }
.meta-list li span:first-child { color: var(--text-muted); min-width: 72px; }

.sec-head { font-size: 17px; font-weight: 700; margin: 22px 0 10px; }

.events { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.event { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.event:last-child { border-bottom: 0; }
.event.away { flex-direction: row-reverse; text-align: end; }
.ev-min { color: var(--text-muted); font-size: 12px; min-width: 34px; font-variant-numeric: tabular-nums; }
.ev-who small { color: var(--text-muted); }

/* ── Entity hero (team / player) ────────────────────────────── */
.entity-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}
.entity-hero img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.entity-hero img.round { border-radius: 50%; object-fit: cover; }
.entity-name { font-size: 20px; font-weight: 800; margin: 0; }
.entity-meta { color: var(--text2); font-size: 13px; margin: 4px 0 0; }

.stat-tiles { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px; padding: 0; }
.stat-tiles li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 8px; text-align: center; }
.stat-tiles b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-tiles span { font-size: 12px; color: var(--text2); }

/* ── Squad ──────────────────────────────────────────────────── */
.squad { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.squad a { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 9px 11px; font-size: 14px; }
.squad img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.sq-name { flex: 1; min-width: 0; }
.sq-name b { color: var(--accent); font-size: 11px; margin-inline-start: 4px; }
.sq-meta { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* ── Competition grid (hubs) ────────────────────────────────── */
.comp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.comp-grid a { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.comp-grid img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.comp-grid b { display: block; font-size: 14px; }
.comp-grid small { color: var(--text-muted); font-size: 12px; }

/* ── Search ─────────────────────────────────────────────────── */
.search-form { display: flex; gap: 8px; margin-bottom: 18px; }
.search-form input {
    flex: 1; min-width: 0;
    padding: 11px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border2);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 15px;
}
.search-form button {
    padding: 11px 20px;
    border: 0;
    border-radius: var(--radius);
    background: var(--accent);
    color: #07101E;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.result-list { list-style: none; margin: 0 0 8px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.result-list li { border-bottom: 1px solid var(--border); }
.result-list li:last-child { border-bottom: 0; }
.result-list a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 14px; }
.result-list img { width: 24px; height: 24px; object-fit: contain; }
.result-list img.round { border-radius: 50%; object-fit: cover; }

/* Competition label appended to a match row on team pages. */
.match-link.with-comp { grid-template-columns: 62px 1fr auto 1fr; }
.match-comp { grid-column: 1 / -1; font-size: 11px; color: var(--text-muted); }

/* ── CMS prose ──────────────────────────────────────────────── */
.prose { font-size: 15px; line-height: 1.9; }
.prose h2, .prose h3 { margin-top: 24px; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose a { color: var(--accent); text-decoration: underline; }
.prose ul, .prose ol { padding-inline-start: 22px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose td, .prose th { border: 1px solid var(--border); padding: 8px; }

/* ── Ads ────────────────────────────────────────────────────── */
.ad-wrap { margin: 12px auto; max-width: 1100px; padding-inline: 16px; }
.ad-wrap.ad-fixed { display: flex; justify-content: center; }
.ad-image { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.ad-desktop { display: none; }
@media (min-width: 768px) {
    .ad-desktop { display: block; }
    .ad-mobile  { display: none; }
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer-inner {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px;
    padding-block: 8px;
}
.footer-about strong { color: var(--text); font-size: 15px; }
.footer-about p { margin: 6px 0 0; }
.footer-links { display: flex; flex-direction: column; gap: 7px; }
.footer-social { display: flex; flex-direction: column; gap: 7px; }
.footer-copy { padding-top: 12px; border-top: 1px solid var(--border); margin-top: 12px; }

@media (max-width: 700px) {
    .footer-inner { grid-template-columns: 1fr; gap: 16px; }
    .main-nav { display: none; }
    .header-search input { width: 110px; }
}

/* ── Bottom nav (موبايل) ────────────────────────────────────── */
.bottom-nav { display: none; }

@media (max-width: 767px) {
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
    .bottom-nav {
        display: flex;
        position: fixed; inset-inline: 0; bottom: 0; z-index: 20;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav a {
        flex: 1;
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 3px; padding: 8px 2px;
        font-size: 11px; color: var(--text-muted);
    }
    .bottom-nav a[aria-current="page"] { color: var(--accent); }
    .bottom-nav svg { width: 21px; height: 21px; }
}

/* ═══════════════════════════════════════════════════════════════
   HEADER — نقل حرفي من app/components/Header.tsx
   ═══════════════════════════════════════════════════════════════ */
.kg-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
    transition: box-shadow .2s ease, background-color .2s ease;
}
.kg-header.is-scrolled { box-shadow: 0 8px 24px -12px rgba(0,0,0,.35); }

/* Promo banner — بانر متدرّج بدل لون مسطّح، وأزرار المتجر بشكل حبّة بدل رابط بخط تحته */
.kg-promo {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #29E0C8));
    color: var(--canvas);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
}
.kg-promo a {
    display: inline-flex; align-items: center;
    padding: 3px 12px; border-radius: 999px;
    background: color-mix(in srgb, var(--canvas) 16%, transparent);
    text-decoration: none; font-weight: 800; font-size: 12px;
    transition: background-color .15s;
}
.kg-promo a:hover { background: color-mix(in srgb, var(--canvas) 26%, transparent); color: var(--canvas); }

/* h-14 = 56px, max-w-7xl = 1280px */
.kg-header-bar {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 12px;
    height: 68px;
    display: flex;
    align-items: center;
    gap: 10px;
}
@media (min-width: 640px) { .kg-header-bar { padding-inline: 20px; } }

.kg-logo { flex-shrink: 0; display: flex; align-items: center; gap: 8px; margin-inline-end: 10px; transition: opacity .15s; }
.kg-logo:hover { opacity: .85; }
.kg-logo-img { height: 36px; width: auto; object-fit: contain; }
.kg-logo-text {
    font-size: 22px; font-weight: 900; letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #ffffff));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

[data-theme="dark"]  .only-light-img { display: none; }
[data-theme="light"] .only-dark-img  { display: none; }

/* Desktop nav — مسار حبّة (pill track) بخلفية surface2، والرابط النشط يظهر
   كحبّة داكنة/فاتحة بلون accent بدل مجرّد تغيير لون النص. */
.kg-nav { display: none; }
@media (min-width: 768px) {
    .kg-nav {
        display: flex; align-items: center; gap: 2px; flex: 1;
        background: var(--surface2); border: 1px solid var(--border);
        border-radius: 999px; padding: 4px;
    }
}
.kg-nav-link {
    display: flex; align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 999px;
    color: var(--text2);
    white-space: nowrap;
    transition: color .15s, background-color .15s;
}
.kg-nav-link:hover { color: var(--text); }
.kg-nav-link.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }

.kg-live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--live);
    display: inline-block;
    margin-inline-end: 6px;
    animation: live-dot 1.4s ease-in-out infinite;
}
@keyframes live-dot { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

.kg-header-actions {
    display: flex; align-items: center; gap: 2px; margin-inline-start: auto;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px;
}

.kg-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    border: 0; background: none;
    border-radius: 999px;
    color: var(--text2);
    cursor: pointer;
    transition: color .15s, background-color .15s, transform .15s;
}
.kg-icon-btn:hover { color: var(--text); background: var(--surface); transform: translateY(-1px); }
.kg-icon-btn:active { transform: translateY(0); }

[data-theme="dark"]  .kg-icon-btn .only-light { display: none; }
[data-theme="light"] .kg-icon-btn .only-dark  { display: none; }

.kg-desktop-only { display: none; }
@media (min-width: 768px) { .kg-desktop-only { display: inline-flex; } .kg-mobile-only { display: none; } }

/* Mobile menu */
.kg-mobile-menu {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    animation: slide-down .2s ease;
}
@keyframes slide-down { from { transform: translateY(-8px); opacity: 0 } to { transform: none; opacity: 1 } }

.kg-mobile-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.kg-mobile-nav a {
    display: inline-flex; align-items: center;
    padding: 9px 15px;
    border-radius: 8px;
    background: var(--surface2);
    font-size: 15px;
    color: var(--text2);
}
.kg-mobile-nav a[aria-current="page"] { color: var(--accent); }

.kg-mobile-comps { margin-top: 14px; }
.kg-mobile-comps h3 { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; font-weight: 600; }
.kg-mobile-comps a {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 6px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.kg-mobile-comps a:last-child { border-bottom: 0; }
.kg-mobile-comps img { width: 20px; height: 20px; object-fit: contain; }

/* ── لوحة الإعدادات (وقت/منطقة زمنية) — نقل من SettingsPanel.tsx ── */
.kg-settings { position: relative; }

.kg-settings-panel {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    width: 300px; max-width: calc(100vw - 24px);
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
    overflow: hidden; z-index: 60;
}
.kg-settings-head { padding: 12px 16px; font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--border); }
.kg-settings-sec { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.kg-settings-sec:last-child { border-bottom: 0; }
.kg-settings-label {
    margin: 0 0 9px; font-size: 10px; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--text-muted);
}

.kg-tz-select {
    position: relative; display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 12px;
    background: var(--surface2); border: 1px solid var(--border); cursor: pointer;
}
.kg-tz-current { flex: 1; min-width: 0; }
.kg-tz-current span { display: block; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kg-tz-current small { display: block; margin-top: 2px; font-size: 10px; font-weight: 700; color: var(--accent); }
.kg-tz-select svg { flex: none; color: var(--text-muted); }
.kg-tz-select select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

.kg-format-row { display: flex; gap: 8px; }
.kg-format-row button {
    flex: 1; padding: 7px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface2); color: var(--text2);
    font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
    transition: all .15s;
}
.kg-format-row button.is-on { background: var(--accent); color: var(--canvas); border-color: var(--accent); }
.kg-format-row button:not(.is-on):hover { border-color: var(--accent); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   FOOTER — نقل حرفي من app/components/Footer.tsx
   ═══════════════════════════════════════════════════════════════ */
.kg-footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    background: var(--surface);
}
.kg-footer-inner {
    max-width: 672px;              /* max-w-2xl */
    margin-inline: auto;
    padding: 32px 24px;
    display: flex; flex-direction: column; align-items: center;
    gap: 20px;
    text-align: center;
}

.kg-footer-logo { font-size: 22px; font-weight: 900; color: var(--accent); letter-spacing: -0.02em; line-height: 1; }
.kg-footer-tagline { font-size: 13px; color: var(--text-muted); line-height: 1.7; max-width: 384px; margin: 0; }

.kg-store-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.kg-store-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color .15s;
}
.kg-store-btn:hover { border-color: var(--accent); color: inherit; }
.kg-store-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.kg-store-txt small { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kg-store-txt b { font-size: 13px; font-weight: 700; color: var(--text); }

.kg-social { display: flex; align-items: center; gap: 12px; }
.kg-social a { padding: 8px; border-radius: 8px; color: var(--text2); transition: color .15s, background-color .15s; }
.kg-social a:hover { color: var(--text); background: var(--surface2); }

.kg-footer-links { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; }
.kg-footer-links a { font-size: 13px; color: var(--text-muted); }
.kg-footer-links a:hover { color: var(--text); }
.kg-sep { color: var(--border2); font-size: 10px; user-select: none; }

.kg-copyright {
    font-size: 11px; color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 16px; width: 100%; text-align: center; margin: 0;
}
.kg-footer-custom { font-size: 11px; color: var(--text-muted); text-align: center; width: 100%; }

/* AdSense: أخفِ الوحدات غير المملوءة — من globals.css الأصلي */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
ins.adsbygoogle:not([data-ad-status]) { min-height: 0 !important; }
body.no-ads ins.adsbygoogle, body.no-ads .ad-wrap { display: none !important; }

/* شريط تمرير رفيع — من globals.css الأصلي */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
html, body { overflow-x: hidden; }

/* تكبير خطوط الهيدر — الأصل كان مقاساً للهاتف ويبدو صغيراً على شاشة عريضة */
.kg-icon-btn svg { width: 21px; height: 21px; }
@media (min-width: 1280px) {
    .kg-nav-link { font-size: 17px; padding: 8px 16px; }
    .kg-logo-img { height: 42px; }
}

/* ═══════════════════════════════════════════════════════════════
   HOME — نقل حرفي من FixtureCard / CompetitionGroup / DateStrip
   ═══════════════════════════════════════════════════════════════ */
.kg-group {
    margin-bottom: 12px; border-radius: 16px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.kg-group-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface2); }
.kg-group-head:hover { color: inherit; }
.kg-group-logo {
    width: 20px; height: 20px; flex: none; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border); overflow: hidden;
    display: flex; align-items: center; justify-content: center; font-size: 9px;
}
.kg-group-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.kg-group-name {
    font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.25; flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kg-group-body > .kg-fx + .kg-fx { border-top: 1px solid var(--border); }

.kg-fx { display: flex; align-items: center; padding: 10px 12px; transition: background-color .15s; }
.kg-fx:hover { background: rgba(255,255,255,.04); color: inherit; }
[data-theme="light"] .kg-fx:hover { background: rgba(0,0,0,.03); }

.kg-fx-team { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.kg-fx-home { justify-content: flex-end; }
.kg-fx-away { justify-content: flex-start; }
.kg-fx-name {
    font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kg-fx-home .kg-fx-name { text-align: end; }
.kg-fx-logo {
    width: 36px; height: 36px; flex: none; border-radius: 50%;
    background: var(--surface2); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.kg-fx-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }

.kg-fx-center {
    width: 88px; flex: none;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding-inline: 4px;
}
.kg-fx-live { display: flex; align-items: center; gap: 4px; }
.kg-fx-score-lg { font-size: 19px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }

.kg-live-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.kg-live-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.kg-live-ring svg { position: absolute; inset: 0; }
.kg-live-min { position: relative; z-index: 1; font-size: 11px; font-weight: 900; color: #26D100; font-variant-numeric: tabular-nums; line-height: 1; }
.kg-stoppage { font-size: 9px; font-weight: 900; line-height: 1; padding: 2px 4px; border-radius: 999px; background: #FF3B30; color: #fff; }

.kg-score-box {
    padding: 3px 8px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface2);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.kg-score-row { display: flex; align-items: center; gap: 3px; }
.kg-score-box b { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.25; }
.kg-score-box i { font-style: normal; font-size: 15px; font-weight: 700; color: var(--text-muted); }
.kg-score-box small { font-size: 10px; color: var(--text-muted); line-height: 1; }

.kg-pen { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kg-score-box-sm b, .kg-score-box-sm i { font-size: 13px; color: var(--text2); }
.kg-pen-label { font-size: 9px; font-weight: 700; color: var(--text2); line-height: 1; }
.kg-score-box-pen { padding: 3px 12px; }
.kg-score-box-pen b { font-size: 16px; font-weight: 900; }

.kg-fx-off { font-size: 11px; color: var(--text-muted); line-height: 1.25; }
.kg-fx-pre b { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.kg-strip { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
@media (min-width: 640px) { .kg-strip { flex-direction: row; align-items: center; } }
.kg-strip-nav { order: 2; display: flex; align-items: center; gap: 6px; }
.kg-strip-filters { order: 1; display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.kg-strip-spacer { display: none; }
@media (min-width: 640px) {
    .kg-strip-nav { order: 1; }
    .kg-strip-spacer { display: block; order: 2; flex: 1; min-width: 0; }
    .kg-strip-filters { order: 3; margin-inline-start: 0; }
}
.kg-datepill { flex: 1; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
@media (min-width: 640px) { .kg-datepill { flex: none; } }
.kg-datepill-arrow { flex: none; padding: 8px; color: var(--text2); display: inline-flex; transition: background-color .15s, color .15s; }
.kg-datepill-arrow:hover { background: var(--surface2); color: var(--text); }
.kg-datepill-label {
    flex: 1; padding: 8px 10px; font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; text-align: center; border-inline: 1px solid var(--border);
}
.kg-datepill-label:hover { background: var(--surface2); color: var(--text); }
.kg-cal { position: relative; flex: none; }
.kg-cal-btn { padding: 7px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text2); cursor: pointer; display: inline-flex; }
.kg-cal-btn:hover { background: var(--surface2); color: var(--text); }
.kg-cal input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

.kg-chip {
    flex: none; display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
    transition: all .15s; user-select: none;
}
.kg-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.kg-chip-live { border-color: var(--live); color: var(--live); }
.kg-chip-live .kg-chip-dot { animation: live-dot 1.4s ease-in-out infinite; }
.kg-chip.is-on { background: var(--live); color: #fff; border-color: var(--live); }
.kg-chip-count { font-size: 10px; font-weight: 900; min-width: 16px; height: 16px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 2px; background: var(--live); color: #fff; }
.kg-chip.is-on .kg-chip-count { background: #fff; color: var(--live); }

/* ── تخطيط الرئيسية مع القائمة الجانبية ── */
.kg-home { display: block; }
.kg-home-main { min-width: 0; }

.kg-side { display: none; }

@media (min-width: 1024px) {
    .kg-home { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 16px; align-items: start; }
    .kg-side { display: block; position: sticky; top: 80px; }
}

.kg-side-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 12px;
}
.kg-side-head {
    margin: 0;
    padding: 9px 12px;
    background: var(--surface2);
    font-size: 13px; font-weight: 700; color: var(--text);
}
.kg-side-list { display: flex; flex-direction: column; }
.kg-side-list a {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px;
    font-size: 14px; font-weight: 600; color: var(--text2);
    border-top: 1px solid var(--border);
    transition: background-color .15s, color .15s;
}
.kg-side-list a:hover { background: var(--surface2); color: var(--text); }
.kg-side-logo {
    width: 20px; height: 20px; flex: none; border-radius: 50%;
    background: var(--surface2); overflow: hidden;
    display: flex; align-items: center; justify-content: center; font-size: 9px;
}
.kg-side-logo img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }

/* شرحة "أهم المباريات" */
.kg-chip-featured { font-weight: 500; }
.kg-chip-featured:hover { border-color: var(--accent); color: var(--accent); }
.kg-chip-featured.is-on {
    background: var(--accent); color: var(--canvas);
    border-color: var(--accent); font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   MATCH PAGE — نقل من FixtureTabs.tsx
   ═══════════════════════════════════════════════════════════════ */
/* Tabs — مسار حبّة بخلفية surface2 (نفس لغة القائمة العلوية)، والتبويب النشط
   حبّة داكنة/فاتحة بلون accent بدل خط سفلي رفيع يسهل تفويته. */
.kg-tabs {
    display: flex; gap: 2px; margin-bottom: 16px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 999px; padding: 4px;
    overflow-x: auto;
}
.kg-tabs::-webkit-scrollbar { display: none; }
.kg-tab {
    flex: none; padding: 10px 18px; border: 0; background: none;
    font: inherit; font-size: 14px; font-weight: 700;
    color: var(--text2); cursor: pointer; white-space: nowrap;
    border-radius: 999px;
    transition: color .15s, background-color .15s, box-shadow .15s;
}
.kg-tab:hover { color: var(--text); }
.kg-tab.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.kg-panel.is-hidden { display: none; }

/* Details */
.kg-info {
    list-style: none; margin: 0 0 18px; padding: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
.kg-info li {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.kg-info li:last-child { border-bottom: 0; }
.kg-info span { color: var(--text-muted); min-width: 96px; flex: none; }
.kg-info b { font-weight: 600; color: var(--text); }

.kg-channels { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kg-channels li {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 13px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--border); font-size: 13px;
}
.kg-channels img { width: 26px; height: 26px; object-fit: contain; border-radius: 4px; }
.kg-channels small { color: var(--text-muted); }

/* Events */
.kg-events {
    list-style: none; margin: 0; padding: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden;
}
.kg-ev { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.kg-ev:last-child { border-bottom: 0; }
.kg-ev.is-away { flex-direction: row-reverse; text-align: end; }
.kg-ev-min { color: var(--text-muted); font-size: 12px; min-width: 36px; font-variant-numeric: tabular-nums; flex: none; }
.kg-ev-icon { flex: none; font-size: 15px; }
.kg-ev-who { display: flex; flex-direction: column; gap: 1px; }
.kg-ev-who b { font-weight: 700; }
.kg-ev-who small { color: var(--text-muted); font-size: 11px; }

/* Lineups */
.kg-lineups { display: grid; gap: 12px; }
@media (min-width: 700px) { .kg-lineups { grid-template-columns: 1fr 1fr; } }
.kg-lineup { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.kg-lineup h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.kg-lineup h3 small { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.kg-lineup h4 { margin: 14px 0 7px; font-size: 12px; color: var(--text-muted); }
.kg-lineup ul { list-style: none; margin: 0; padding: 0; }
.kg-lineup li { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.kg-lineup li:last-child { border-bottom: 0; }
.kg-lineup i {
    font-style: normal; font-size: 11px; font-weight: 700;
    min-width: 22px; height: 22px; flex: none;
    border-radius: 6px; background: var(--surface2);
    display: inline-flex; align-items: center; justify-content: center;
}
.kg-lineup li span { flex: 1; }
.kg-lineup li span b { color: var(--accent); font-size: 11px; }
.kg-lineup li small { color: var(--text-muted); font-size: 11px; }
.kg-subs i { background: transparent; border: 1px solid var(--border); }
.kg-coach { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; }

/* Stats */
.kg-stats { list-style: none; margin: 0; padding: 0; }
.kg-stats li {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 11px 14px; margin-bottom: 8px;
}
.kg-stat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 13px; }
.kg-stat-row b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.kg-stat-row span { color: var(--text-muted); }

/* Videos — نقل من _VideosCard/_VideoRow */
.kg-vheader { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.kg-vheader-icn { color: var(--accent); font-size: 15px; }
.kg-vheader b { font-size: 14px; font-weight: 700; }
.kg-vheader-count {
    padding: 2px 8px; border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent); font-size: 11px; font-weight: 700;
}

.kg-vlist { display: flex; flex-direction: column; gap: 8px; }
.kg-vrow {
    display: flex; align-items: stretch; height: 90px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
}
.kg-vrow-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px 12px; }
.kg-vrow-text p {
    margin: 0; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kg-vrow-num {
    align-self: flex-start; padding: 2px 6px; border-radius: 4px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent); font-size: 11px; font-weight: 800;
}

.kg-vthumb {
    position: relative; flex: none; width: 124px; height: 90px;
    border: 0; padding: 0; cursor: pointer; background: var(--surface2);
}
.kg-vthumb-media { position: absolute; inset: 0; }
.kg-vthumb-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kg-vthumb-fallback { background: var(--surface2); }
.kg-vplay {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(0,0,0,.55); color: #fff; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}

.kg-vembed { width: 100%; aspect-ratio: 16/9; background: #000; }
.kg-vembed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* الفريقان في جدول الترتيب داخل صفحة المباراة */
.standings tr.is-highlight { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ── الهدافين (تبويب المباراة) — نقل من ScorersTab ── */
.kg-toggle {
    display: flex; padding: 4px; margin-bottom: 12px;
    background: var(--surface2); border-radius: 12px; border: 1px solid var(--border);
}
.kg-toggle button {
    flex: 1; padding: 9px; border: 0; background: none; font: inherit;
    font-size: 14px; font-weight: 800; color: var(--text2);
    border-radius: 8px; cursor: pointer; transition: all .15s;
}
.kg-toggle button.is-active { background: var(--accent); color: #07101E; }

.kg-scorers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.kg-scorers a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 13px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border);
    transition: opacity .15s;
}
.kg-scorers a:hover { opacity: .8; color: inherit; }

.kg-rank-badge {
    width: 28px; height: 28px; flex: none; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 900; background: var(--surface2); color: var(--text2);
}
.kg-rank-1 { background: #FFD700; color: #111; }
.kg-rank-2 { background: #C0C0C0; color: #111; }
.kg-rank-3 { background: #CD7F32; color: #111; }

.kg-scorer-avatar {
    width: 40px; height: 40px; flex: none; border-radius: 50%;
    overflow: hidden; background: var(--surface2);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 900; color: var(--text2);
}
.kg-scorer-avatar img { width: 100%; height: 100%; object-fit: cover; }

.kg-scorer-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kg-scorer-info b { font-size: 14px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kg-scorer-info small { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text2); }
.kg-scorer-info small img { width: 14px; height: 14px; object-fit: contain; }

.kg-scorer-value {
    flex: none; padding: 6px 12px; border-radius: 8px;
    font-size: 18px; font-weight: 900;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   MATCH TABS — نقل من fixture_detail_screen.dart (تطبيق فلاتر)
   ═══════════════════════════════════════════════════════════════ */

/* ── الأحداث: _TlEvView / _EvIconWidget / _MinuteBadge ── */
.kg-tl { list-style: none; margin: 0; padding: 0; }
.kg-tl-row {
    display: flex; align-items: center;
    min-height: 52px; padding: 8px 6px;
    border-bottom: 1px solid var(--border);
}
.kg-tl-row:last-child { border-bottom: 0; }
.kg-tl-side { flex: 1; min-width: 0; display: flex; align-items: center; }
.kg-tl-row.is-home .kg-tl-side { justify-content: flex-end; }
.kg-tl-row.is-away .kg-tl-side { justify-content: flex-start; }

.kg-tl-text { display: flex; flex-direction: column; gap: 2px; padding-inline: 8px; min-width: 0; }
.kg-tl-text.end { align-items: flex-end; text-align: end; }
.kg-tl-text.start { align-items: flex-start; text-align: start; }
.kg-tl-text b { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.kg-tl-text small { font-size: 11px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

.kg-tl-min-wrap { flex: none; width: 52px; display: flex; align-items: center; justify-content: center; position: relative; }
.kg-tl-min {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; padding: 5px 8px;
    border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface2); color: var(--text2);
    font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.kg-tl-min.is-goal { background: #55D986; border-color: transparent; color: #fff; }
.kg-tl-extra {
    position: absolute; top: -8px; inset-inline-end: 2px;
    padding: 1px 4px; border-radius: 999px;
    background: #6B7280; color: #fff; font-size: 9px; font-weight: 900;
}
.kg-tl-row.is-hidden { display: none; }

/* فواصل الخط الزمني — نهاية المباراة / الاستراحة / بداية المباراة */
.kg-tl-sep {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 6px; font-size: 12px; font-weight: 700; color: var(--text-muted);
}
.kg-tl-sep::before, .kg-tl-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.kg-tl-sep span { flex: none; }
.kg-tl-sep b { flex: none; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.kg-tl-sep-start b { display: none; }

.kg-ev-empty { text-align: center; padding: 24px 12px; }

.kg-ev-icn { flex: none; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; border-radius: 50%; position: relative; }
.kg-ev-goal { background: rgba(85,217,134,.15); border: 1px solid rgba(85,217,134,.4); }
.kg-ev-own  { background: rgba(255,59,48,.15); }
.kg-ev-pen  { background: rgba(85,217,134,.15); }
.kg-ev-penmiss { background: rgba(255,59,48,.15); }
.kg-ev-var  { background: rgba(91,124,250,.15); border: 1px solid rgba(91,124,250,.4); color: #5B7CFA; font-size: 15px; }
.kg-ev-sub  { background: var(--surface2); border: 1px solid var(--border); }
.kg-ev-yellow, .kg-ev-red { background: transparent; }

.kg-card { display: block; width: 16px; height: 22px; border-radius: 3px; }
.kg-ev-yellow .kg-card { background: #FFCC00; box-shadow: 0 0 4px rgba(255,204,0,.4); }
.kg-ev-red .kg-card { background: var(--live); box-shadow: 0 0 4px rgba(255,59,48,.4); }

.kg-sub-arrows { font-size: 15px; color: var(--text2); line-height: 1; }
.kg-pbadge, .kg-xmark {
    position: absolute; font-style: normal; line-height: 1;
}
.kg-pbadge {
    bottom: -2px; inset-inline-end: -4px;
    padding: 1px 3px; border-radius: 3px;
    background: #55D986; color: #fff; font-size: 8px; font-weight: 900;
}
.kg-xmark { color: var(--live); font-size: 16px; font-weight: 900; }

/* ── التشكيلة: _StartersList ── */
.kg-lineups { display: grid; gap: 14px; }
@media (min-width: 700px) { .kg-lineups { grid-template-columns: 1fr 1fr; } }
.kg-lineup-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.kg-lineup-head span:first-child { flex: 1; font-size: 12px; font-weight: 700; color: var(--text2); letter-spacing: .03em; }
.kg-formation-badge {
    padding: 3px 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    color: var(--accent); font-size: 12px; font-weight: 800;
}

.kg-starters {
    list-style: none; margin: 0; padding: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; overflow: hidden;
}
.kg-starters li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.kg-starters li:last-child { border-bottom: 0; }

/* .kg-avatar-stack هو مرجع تموضع الشارة، بلا overflow:hidden؛ الدائرة وحدها
   تقصّ الصورة. نفس إصلاح .kg-pp-stack في الملعب — والسبب نفسه: شارة برقم
   سالب داخل حاوية overflow:hidden كانت تُقصّ، أو تُحشر مع الصورة في صفّ واحد
   فتظهر الصورة "غير مكتملة". */
.kg-avatar-stack { position: relative; flex: none; display: inline-flex; }

.kg-player-avatar {
    flex: none; width: 40px; height: 40px;
    border-radius: 50%; background: var(--surface2);
    border: 1px solid var(--border); overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.kg-player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.kg-player-avatar.is-sub { width: 34px; height: 34px; }
.kg-num-badge {
    position: absolute; top: -3px; inset-inline-end: -3px;
    min-width: 16px; padding: 1px 3px; font-style: normal;
    border-radius: 999px; background: var(--accent); color: #07101E;
    font-size: 9px; font-weight: 900; text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.kg-num-badge.is-sub { background: var(--surface); color: var(--text2); border: 1px solid var(--border); font-size: 8px; box-shadow: none; }

.kg-player-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kg-cap-badge {
    padding: 2px 6px; border-radius: 999px;
    background: rgba(255,193,7,.18); border: 1px solid #FFC107;
    color: #FFC107; font-size: 10px; font-weight: 900;
}
.kg-pos-chip { padding: 2px 8px; border-radius: 4px; background: var(--surface2); color: var(--text2); font-size: 11px; }

.kg-subs-label { font-size: 12px; color: var(--text-muted); margin: 12px 0 6px; font-weight: 700; }
.kg-coach { font-size: 12px; color: var(--text-muted); margin: 10px 0 0; }
.kg-coach b { color: var(--text); }

/* ── الإحصائيات: _PossessionCard / _StatSectionCard ── */
.kg-poss-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px 16px; margin-bottom: 12px;
    display: flex; flex-direction: column; align-items: center;
}
.kg-poss-label { font-size: 11px; color: var(--text-muted); letter-spacing: .04em; margin-bottom: 14px; }
.kg-poss-row { display: flex; align-items: center; gap: 10px; width: 100%; }
.kg-poss-row img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.kg-poss-num { flex: 1; font-size: 22px; font-weight: 800; color: var(--text); }
.kg-poss-num.end { text-align: end; }
.kg-poss-bar, .kg-stat-bar { display: flex; width: 100%; border-radius: 8px; overflow: hidden; margin-top: 12px; }
.kg-poss-bar { height: 14px; }
.kg-stat-bar { height: 7px; border-radius: 4px; margin-top: 8px; }

.kg-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.kg-stat-card-head {
    padding: 10px 16px; background: var(--surface2);
    font-size: 12px; font-weight: 700; color: var(--text2); letter-spacing: .03em;
}
.kg-stat-line { padding: 10px 16px; border-top: 1px solid var(--border); }
.kg-stat-vals { display: flex; align-items: center; }
.kg-stat-vals b { width: 48px; flex: none; font-size: 16px; font-weight: 800; color: var(--text); }
.kg-stat-vals b.end { text-align: end; }
.kg-stat-vals span { flex: 1; text-align: center; font-size: 12px; color: var(--text2); }

/* ── الترتيب: _StandingsTable ── */
.kg-std { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.kg-std-head, .kg-std-row {
    display: grid;
    grid-template-columns: 24px 4fr 1fr 1fr 1fr 1fr 1fr 1fr;
    align-items: center; gap: 4px;
    padding: 8px 12px;
}
.kg-std-head { background: var(--surface2); font-size: 11px; font-weight: 700; color: var(--text2); border-bottom: 1px solid var(--border); }
.kg-std-head span, .kg-std-row > span { text-align: center; }
.kg-std-team { text-align: start !important; display: flex; align-items: center; gap: 8px; overflow: hidden; }
.kg-std-team img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.kg-std-team b { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kg-std-pts { font-size: 15px; font-weight: 900; color: var(--accent); }

.kg-std-row { position: relative; border-bottom: 1px solid var(--border); }
.kg-std-row:last-child { border-bottom: 0; }
.kg-std-row.is-side { background: color-mix(in srgb, #1565C0 18%, transparent); }
.kg-std-row.is-side .kg-std-team b { font-weight: 800; }
.kg-std-stripe { position: absolute; inset-inline-start: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 0 2px 2px 0; }
.kg-std-rank { font-size: 13px; font-weight: 700; color: var(--text); }

/* ═══════════════════════════════════════════════════════════════
   الملعب التفاعلي — نقل من _Pitch/_PitchPlayer/_LineupTab (تطبيق فلاتر)
   ═══════════════════════════════════════════════════════════════ */

/* مبدّل الفريقين — نفس تصميم الحبّة 44px في _LineupTabState */
.kg-team-switch {
    display: flex; gap: 4px; height: 44px; padding: 4px;
    background: var(--surface2); border-radius: 999px; margin-bottom: 14px;
}
.kg-team-switch button {
    flex: 1; border: 0; background: none; border-radius: 999px;
    font: inherit; font-size: 13px; font-weight: 700; color: var(--text2);
    cursor: pointer; transition: all .2s;
}
.kg-team-switch button.is-active { background: var(--accent); color: #07101E; }

.kg-team-panel.is-hidden { display: none; }

/* الملعب نفسه: خطوط عشب متبادلة + علامات الملعب، نسبة 0.70 كما في CustomPaint */
.kg-pitch-wrap {
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    margin-bottom: 14px;
}
.kg-pitch {
    position: relative;
    aspect-ratio: 0.70;
    background:
        repeating-linear-gradient(180deg,
            #3FA34D 0, #3FA34D calc(100% / 7),
            #45B056 calc(100% / 7), #45B056 calc(200% / 7));
}
.kg-pitch::before {
    content: ""; position: absolute; inset: 4px;
    border: 1.4px solid rgba(255,255,255,.45); border-radius: 2px;
}
.kg-pitch-line.kg-pitch-mid {
    position: absolute; inset-inline: 4px; top: 50%; height: 0;
    border-top: 1.4px solid rgba(255,255,255,.45);
}
.kg-pitch-circle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 26%; aspect-ratio: 1; border: 1.4px solid rgba(255,255,255,.45); border-radius: 50%;
}
.kg-pitch-circle::after {
    content: ""; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.6);
}
.kg-pitch-box { position: absolute; inset-inline: 22.5%; height: 18%; border: 1.4px solid rgba(255,255,255,.45); }
.kg-pitch-box-top { top: 4px; border-top: 0; }
.kg-pitch-box-bottom { bottom: 4px; border-bottom: 0; }

.kg-pitch-formation {
    position: absolute; left: 10px; bottom: 10px; z-index: 2;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(255,255,255,.9); color: #111;
    font-size: 12px; font-weight: 800;
}

/* لاعب على الملعب — بطاقة موضوعة بالنسبة المئوية x/y المحسوبة في المتحكّم */
.kg-pp {
    position: absolute; transform: translate(-50%, -50%);
    width: calc(76px * var(--kg-scale, 1));
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; z-index: 1;
}
.kg-pp:hover { color: inherit; }

/* الحاوية الخارجية: بلا overflow:hidden، فهي مرجع تموضع الشارات على الحافة.
   دائرة الصورة وحدها تقصّ الصورة؛ الشارات إخوتها فلا تُقصّ معها. */
.kg-pp-stack {
    position: relative;
    width: calc(60px * var(--kg-scale, 1)); height: calc(60px * var(--kg-scale, 1));
}
.kg-pp-photo {
    position: absolute; inset: 0;
    border-radius: 50%; background: #1F2B4D;
    border: 1.8px solid #fff; overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center;
}
.kg-pp-photo img { width: 100%; height: 100%; object-fit: cover; }

.kg-pp-num {
    position: absolute; top: -2px; inset-inline-end: -2px; font-style: normal;
    height: calc(17px * var(--kg-scale, 1)); min-width: calc(17px * var(--kg-scale, 1));
    padding-inline: 3px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: #1A2233; border: 1.4px solid #fff;
    font-size: calc(9px * var(--kg-scale, 1)); font-weight: 800; color: #fff; line-height: 1;
}
.kg-pp-cap {
    position: absolute; bottom: -4px; inset-inline-end: -4px; font-style: normal;
    width: calc(15px * var(--kg-scale, 1)); height: calc(15px * var(--kg-scale, 1));
    border-radius: 50%; background: #FFD60A; border: 1.2px solid #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: calc(8px * var(--kg-scale, 1)); font-weight: 900; color: rgba(0,0,0,.87); line-height: 1;
}
.kg-pp-rating {
    position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); font-style: normal;
    padding: 1.5px 4.5px; border-radius: 4px; border: 1.2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.35);
    font-size: calc(9.5px * var(--kg-scale, 1)); font-weight: 900; color: #fff; line-height: 1; white-space: nowrap;
}
.kg-pp-marks {
    position: absolute; top: -2px; inset-inline-start: -2px;
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.kg-pp-goal {
    font-style: normal; font-size: calc(10px * var(--kg-scale, 1)); line-height: 1;
    background: #55D986; color: #07101E; border-radius: 999px;
    padding: 1px 4px; font-weight: 900;
}
.kg-pp-card { display: block; width: calc(10px * var(--kg-scale, 1)); height: calc(14px * var(--kg-scale, 1)); border-radius: 2px; }
.kg-pp-red { background: #E5403A; }
.kg-pp-yellow { background: #F7C948; }
.kg-pp-sub {
    position: absolute; bottom: -3px; left: -3px; font-style: normal;
    width: calc(14px * var(--kg-scale, 1)); height: calc(14px * var(--kg-scale, 1));
    border-radius: 50%; background: #E5403A; border: 1.1px solid #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: calc(9px * var(--kg-scale, 1)); color: #fff; line-height: 1;
}

.kg-pp-name {
    max-width: 100%; font-size: clamp(8px, calc(10.5px * var(--kg-scale, 1)), 11px);
    font-weight: 700; color: #fff; text-align: center;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0,0,0,.7), 0 0 2px rgba(0,0,0,.5);
}

/* ═══════════════════════════════════════════════════════════════
   بطاقة النتيجة (Hero) — نقل حرفي من الموقع القديم (Next.js)
   ═══════════════════════════════════════════════════════════════ */
:root, [data-theme="dark"]  { --hero-bg: linear-gradient(180deg, #1A2540 0%, #0B1220 100%); }
[data-theme="light"]        { --hero-bg: linear-gradient(180deg, #1B5E20 0%, #2E7D32 100%); }

.kg-hero { border-radius: 16px; overflow: hidden; margin-bottom: 16px; background: var(--hero-bg); }

.kg-hero-comp {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    transition: background-color .15s;
}
.kg-hero-comp:hover { background: rgba(255,255,255,.05); color: inherit; }
.kg-hero-comp span { font-size: 14px; font-weight: 700; color: #fff; }

.kg-hero-body { padding: 20px 16px; }

.kg-hero-datebar { display: flex; justify-content: center; margin-bottom: 20px; }
.kg-hero-datebar span { font-size: 14px; color: rgba(255,255,255,.65); }
.kg-hero-pill {
    display: inline-flex; align-items: center;
    padding: 6px 14px; border-radius: 999px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.8); font-size: 12px; font-weight: 700;
}

.kg-hero-row { display: flex; align-items: center; gap: 8px; }
@media (min-width: 480px) { .kg-hero-row { gap: 16px; } }

.kg-hero-team {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    text-decoration: none;
}
.kg-hero-team:hover { opacity: .8; color: inherit; }
.kg-hero-team span:last-child {
    font-size: 13px; font-weight: 900; color: #fff; text-align: center;
    line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    padding-inline: 4px;
}
.kg-hero-logo {
    width: 68px; height: 68px; flex: none;
    border-radius: 50%; border: 2px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.kg-hero-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.kg-hero-mid { flex: none; display: flex; flex-direction: column; align-items: center; gap: 10px; }

.kg-hero-final-row { display: flex; align-items: center; gap: 8px; }
.kg-hero-score { font-size: clamp(42px, 9vw, 50px); font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.kg-hero-live-row .kg-hero-score { font-size: clamp(40px, 8vw, 48px); }
.kg-hero-dash { font-size: 26px; font-weight: 700; color: rgba(255,255,255,.3); line-height: 1; }

.kg-hero-live-row { display: flex; align-items: center; gap: 12px; }
@media (min-width: 480px) { .kg-hero-live-row { gap: 16px; } }

.kg-live-ring-big { position: relative; width: 72px; height: 72px; flex: none; display: flex; align-items: center; justify-content: center; }
.kg-live-ring-big svg { position: absolute; inset: 0; }
.kg-live-ring-time { position: relative; font-size: 13px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.kg-hero-half-label { font-size: 9px; font-weight: 700; color: #fff; }

.kg-hero-pre { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.kg-hero-time { font-size: clamp(32px, 7vw, 38px); font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; line-height: 1; }
.kg-hero-countdown { font-size: 14px; font-weight: 700; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }
.kg-hero-countdown[hidden] { display: none; }

.kg-hero-sub-pill {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    margin: 12px auto 0; width: fit-content;
    padding: 5px 12px; border-radius: 999px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
    color: rgba(255,255,255,.6); font-size: 11px; font-weight: 700;
}
