/* ==========================================================================
   LiveKoora hubs.css v2 (final)
   The original livekoora.com layout and look, rebuilt lean:
   desktop = league sidebar | fixtures | details rail ; mobile = one column.
   Dark theme, Cairo, red accents. RTL + LTR via logical properties.
   ========================================================================== */

/* ---- Font: self-hosted Cairo (Arabic + Latin), never blocks text (fixes the 3.4s LCP) ---- */
@font-face{font-family:Cairo;font-style:normal;font-weight:400;font-display:swap;
  src:url(/wp-content/themes/livekoora-child/assets/fonts/cairo-400.woff2) format('woff2')}
@font-face{font-family:Cairo;font-style:normal;font-weight:700;font-display:swap;
  src:url(/wp-content/themes/livekoora-child/assets/fonts/cairo-700.woff2) format('woff2')}

/* ---- Tokens (sampled from livekoora.com) ---- */
:root{
  --bg:#0d0f12; --card:#15181d; --card-2:#1a1d22; --row:#1f232a; --raised:#23272e;
  --border:#262a31; --border-soft:#1f232a;
  --text:#f2f2f5; --muted:#a9aeb7; --faint:#8a9099; /* v1.3.1: was #6b7178, failed contrast (3.6:1) */
  --red:#ff3743; --red-bg:rgba(255,55,67,.12);
  --win:#1fc17a; --draw:#9aa0aa;
  --r:12px; --r-sm:8px; --pill:999px;
  --side:260px; --rail:340px; --maxw:1440px;
  --font:Cairo,"Segoe UI",system-ui,-apple-system,Arial,"Noto Kufi Arabic",sans-serif;
}

/* ---- Base ---- */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14.5px;line-height:1.5;-webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
a:hover{color:#fff}
img{max-width:100%;height:auto;vertical-align:middle}
h1,h2,h3{margin:0;line-height:1.3;font-weight:700}
ul,ol{margin:0;padding:0;list-style:none}
table{border-collapse:collapse;width:100%}
button{font-family:inherit;cursor:pointer}
:focus-visible{outline:2px solid var(--red);outline-offset:2px}

/* ---- Header (one compact row; logo, nav, search, language) ---- */
.lk-header{background:var(--card);border-bottom:1px solid var(--border)}
.lk-header .bar{max-width:var(--maxw);margin-inline:auto;display:flex;align-items:center;gap:18px;padding:10px 16px}
.lk-logo{flex:0 0 auto}
.lk-logo img{height:36px;width:auto;display:block}
.lk-topnav{display:flex;gap:18px;font-weight:700;font-size:14px}
.lk-topnav a:hover{color:var(--red)}
.lk-search-wrap{position:relative;flex:1 1 auto;max-width:440px;margin-inline-start:auto}
#lk-search{width:100%;height:38px;border-radius:var(--r-sm);border:1px solid var(--border);border-bottom-color:var(--red);
  background:var(--bg);color:var(--text);padding-inline:14px;font-family:inherit;font-size:13.5px;outline:none}
#lk-search::placeholder{color:var(--faint)}
#lk-search:focus{border-color:var(--red);box-shadow:0 0 0 3px var(--red-bg)}
#lk-search-results{position:absolute;inset-inline:0;top:44px;background:var(--card);border:1px solid var(--border);
  border-radius:var(--r-sm);overflow:hidden;box-shadow:0 14px 34px rgba(0,0,0,.5);z-index:60}
#lk-search-results:empty{display:none}
#lk-search-results a{display:flex;justify-content:space-between;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border-soft);font-size:13.5px}
#lk-search-results a:hover{background:var(--card-2)}
#lk-search-results em{color:var(--red);font-style:normal;font-size:12px;font-weight:700}
.lk-lang{flex:0 0 auto;color:var(--red);font-weight:700;font-size:14px}

/* ---- Ad slots: space reserved so ads never shift the layout (CLS) ---- */
.lk-ad{display:flex;justify-content:center;align-items:center;margin:14px auto 0;max-width:var(--maxw);padding-inline:16px}
.lk-ad-top{min-height:90px}
.lk-ad img{border-radius:6px}
.lk-ad .m{display:none}

/* ---- Page title strip ---- */
.lk-pagetitle{text-align:center;color:var(--red);font-size:15px;font-weight:700;margin:14px 16px 0}

/* ---- Three-column layout ---- */
.lk-layout{max-width:var(--maxw);margin:14px auto 0;padding:0 16px 40px;display:grid;
  grid-template-columns:var(--side) minmax(0,1fr) var(--rail);grid-template-areas:"side main rail";gap:16px;align-items:start}
.lk-side{grid-area:side;position:sticky;top:12px}
.lk-main{grid-area:main;min-width:0}
.lk-rail{grid-area:rail;position:sticky;top:12px}
.lk-main>main{padding:0;margin:0}

/* ---- Cards ---- */
.lk-card,.lk-main>main>section,.lk-scoreboard{background:var(--card);border:1px solid var(--border);border-radius:var(--r);padding:14px;margin-bottom:16px}
.lk-card-h,.lk-main>main>section>h2{color:var(--red);font-size:17px;text-align:center;margin-bottom:12px;font-weight:700}

/* ---- Sidebar league lists (sitewide internal links) ---- */
.lk-side-list li+li{margin-top:6px}
.lk-side-list a{display:flex;align-items:center;gap:10px;padding:8px 10px;background:var(--bg);border-radius:var(--r-sm);font-size:13.5px}
.lk-side-list a:hover,.lk-side-list a[aria-current="page"]{background:var(--raised);color:#fff}
.lk-side-list a[aria-current="page"]{box-shadow:inset 3px 0 0 var(--red)}
.lk-side-list img{width:20px;height:20px;border-radius:4px;flex:0 0 auto;background:#fff}

/* ---- Breadcrumb + H1 inside main ---- */
.lk-breadcrumb{color:var(--faint);font-size:12.5px;margin-bottom:8px}
.lk-breadcrumb a:hover{color:var(--text)}
.lk-main h1{font-size:22px;margin-bottom:12px;display:flex;align-items:center;gap:10px}
.lk-main h1 img{width:34px;height:34px;border-radius:6px}
.lk-follow{margin-inline-start:auto;font-size:12px;border:1px solid var(--border);border-radius:var(--pill);padding:3px 12px;background:transparent;color:var(--muted)}
.lk-follow.is-following{border-color:var(--red);color:var(--red)}

/* ---- Fixtures toolbar: tabs + date navigation ---- */
.lk-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--card-2);border-radius:var(--r-sm);padding:8px 10px;margin-bottom:12px}
.lk-tabs{display:flex;gap:6px;flex-wrap:wrap}
.lk-tabs button{background:var(--raised);color:var(--muted);border:0;border-radius:6px;padding:5px 12px;font-size:12.5px;font-weight:700}
.lk-tabs button.on{background:#3a3f48;color:#fff}
.lk-datenav{display:flex;align-items:center;gap:10px;font-weight:700;font-size:13.5px}
.lk-datenav button{background:transparent;border:0;color:var(--text);font-size:16px;padding:2px 8px}
.lk-datenav button:hover{color:var(--red)}

/* ---- League group (home) ---- */
.lk-league-block{background:transparent;border:0;padding:0;margin:0 0 12px}
.lk-main>main>section.lk-league-block{background:transparent;border:0;padding:0}
.lk-league-block>h2{display:flex;align-items:center;gap:10px;margin:0;padding:9px 12px;background:var(--card-2);
  border-inline-start:3px solid var(--red);border-radius:6px;color:var(--muted);font-size:13px;font-weight:600;text-align:start}
.lk-league-block>h2 a:hover{color:#fff}
.lk-league-block>h2 img{width:18px;height:18px}
.lk-league-block>ul{margin-top:4px}

/* ---- Match row: minute | home | score | away ---- */
.lk-match{display:grid;grid-template-columns:44px minmax(0,1fr) 70px minmax(0,1fr);align-items:center;gap:8px;
  padding:9px 10px;border-bottom:1px solid var(--border-soft);font-size:13.5px}
.lk-match:hover{background:var(--card-2)}
.lk-match .status{color:var(--faint);font-size:11.5px;text-align:center}
.lk-match .home,.lk-match .away{display:flex;align-items:center;gap:8px;min-width:0}
.lk-match .away{justify-content:flex-end;text-align:end}
.lk-match .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lk-match img.badge{width:20px;height:20px;flex:0 0 auto}
.lk-match .score{text-align:center;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:.5px}
.lk-match.is-live .score,.lk-match.is-live .status{color:var(--red)}
.lk-match.is-live .status::before{content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--red);
  margin-inline-end:4px;vertical-align:middle;animation:lkp 1.4s ease-in-out infinite}
.lk-match.is-finished .score{color:#fff}
@keyframes lkp{50%{opacity:.3}}
.lk-hidden{display:none!important}

/* ---- Standings ---- */
.lk-standings table,.lk-mini-table{font-size:13px}
.lk-standings th,.lk-mini-table th{color:var(--faint);font-weight:600;font-size:11px;padding:7px 6px;text-align:center}
.lk-standings th:nth-child(2),.lk-mini-table th:nth-child(2){text-align:start}
.lk-standings td,.lk-mini-table td{padding:8px 6px;text-align:center;border-top:1px solid var(--border-soft);font-variant-numeric:tabular-nums}
.lk-standings td:nth-child(2),.lk-mini-table td:nth-child(2){text-align:start}
.lk-standings td:nth-child(2) a,.lk-mini-table td:nth-child(2) a{display:flex;align-items:center;gap:8px}
.lk-standings td img,.lk-mini-table td img{width:20px;height:20px}
.lk-standings tr:hover td{background:var(--card-2)}
.lk-standings td:first-child,.lk-mini-table td:first-child{color:var(--muted);font-weight:700}
.lk-standings td strong,.lk-mini-table td strong{color:#fff}

/* ---- Lists inside hub cards ---- */
.lk-fixtures li,.lk-results li,.lk-team-fixtures li,.lk-scorers li,.lk-position li,.lk-timeline li,.lk-stats li{
  display:flex;align-items:center;gap:10px;padding:8px 2px;border-top:1px solid var(--border-soft)}
.lk-fixtures li:first-child,.lk-results li:first-child,.lk-team-fixtures li:first-child,.lk-scorers li:first-child,.lk-position li:first-child,.lk-timeline li:first-child,.lk-stats li:first-child{border-top:0}
.lk-fixtures time{margin-inline-start:auto;color:var(--faint);font-size:12px}
.lk-results strong{color:#fff;font-variant-numeric:tabular-nums}
.lk-scorers ol{counter-reset:s}
.lk-scorers li{counter-increment:s}
.lk-scorers li::before{content:counter(s);color:var(--faint);min-width:18px;font-weight:700}
.lk-scorers li span{margin-inline-start:auto;color:var(--red);font-weight:700}
.lk-position a{color:var(--text);font-weight:700}
.lk-position a:hover{color:var(--red)}

/* ---- Intro / FAQ copy (unique text that helps hubs rank) ---- */
.lk-intro p{color:var(--muted);line-height:1.8;margin:0 0 10px}
.lk-faq details{border-top:1px solid var(--border-soft);padding:10px 2px}
.lk-faq summary{cursor:pointer;font-weight:700}
.lk-faq details p{color:var(--muted);margin:8px 0 0;line-height:1.8}

/* ---- Team form ---- */
.lk-form .form{display:flex;gap:6px;justify-content:center}
.lk-form .form span{width:26px;height:26px;border-radius:6px;display:grid;place-items:center;font-size:12px;font-weight:700;color:#fff}
.f-W{background:var(--win)} .f-D{background:var(--draw);color:#0d0f12!important} .f-L{background:var(--red)}

/* ---- Match page scoreboard ---- */
.lk-scoreboard{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px;text-align:center;padding:22px 14px;
  background:linear-gradient(180deg,#1b1f25,#15181d)}
.lk-scoreboard a{display:flex;flex-direction:column;align-items:center;gap:8px;font-weight:700}
.lk-scoreboard img{width:56px;height:56px}
.lk-scoreboard .score{font-size:36px;font-weight:800;font-variant-numeric:tabular-nums}
.lk-scoreboard .status{grid-column:1/-1;color:var(--faint);font-size:12.5px}
.lk-match-summary p{color:var(--muted);line-height:1.8;margin:0}

/* ---- Right rail: featured match ---- */
.lk-feature{display:block;background:linear-gradient(180deg,#20242b,#16191e);border-radius:var(--r-sm);padding:14px;margin-bottom:14px}
.lk-feature .comp{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-bottom:10px}
.lk-feature .teams{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;text-align:center;gap:8px}
.lk-feature .t{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:13px;font-weight:700}
.lk-feature .t img{width:46px;height:46px;background:#fff;border-radius:8px;padding:4px}
.lk-feature .sc{font-size:28px;font-weight:800;font-variant-numeric:tabular-nums}
.lk-feature .meta{text-align:center;color:var(--faint);font-size:12px;margin-top:8px}
.lk-btn{display:block;text-align:center;background:var(--red);color:#fff;border-radius:6px;padding:8px 12px;font-weight:700;font-size:13px;margin-top:10px}
.lk-btn:hover{color:#fff;filter:brightness(1.08)}

/* ---- Footer ---- */
.lk-footer{border-top:1px solid var(--border);background:var(--card);margin-top:10px}
.lk-footer .inner{max-width:var(--maxw);margin-inline:auto;padding:20px 16px;display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between;color:var(--muted);font-size:13px}
.lk-footer nav{display:flex;gap:16px}
.lk-footer a:hover{color:#fff}

/* ---- Tablet: rail drops under the fixtures ---- */
@media (max-width:1099px){
  .lk-layout{grid-template-columns:var(--side) minmax(0,1fr);grid-template-areas:"side main" "side rail"}
  .lk-rail{position:static}
}

/* ---- Mobile: one column, league chips scroll sideways (Forza-style) ---- */
@media (max-width:759px){
  body{font-size:14px}
  .lk-header .bar{flex-wrap:wrap;gap:10px}
  .lk-topnav{display:none}
  .lk-search-wrap{order:3;flex-basis:100%;max-width:none;margin:0}
  .lk-ad-top{min-height:100px}
  .lk-ad .d{display:none} .lk-ad .m{display:block}
  .lk-layout{grid-template-columns:minmax(0,1fr);grid-template-areas:"side" "main" "rail";gap:12px;padding:0 10px 30px}
  .lk-side{position:static}
  .lk-side .lk-card{padding:10px;margin-bottom:8px}
  .lk-side .lk-card-h{display:none}
  .lk-side-list{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .lk-side-list::-webkit-scrollbar{display:none}
  .lk-side-list li+li{margin-top:0}
  .lk-side-list a{white-space:nowrap;border-radius:var(--pill);padding:6px 12px}
  .lk-toolbar{flex-direction:column;align-items:stretch}
  .lk-tabs{justify-content:center}
  .lk-datenav{justify-content:center}
  .lk-match{grid-template-columns:38px minmax(0,1fr) 56px minmax(0,1fr);padding:9px 6px;font-size:13px}
  .lk-main h1{font-size:19px}
}

/* ==========================================================================
   v2.1 additions (go-live): components used by the final templates
   ========================================================================== */

/* Accessible hidden text (match name inside the score link) */
.lk-vh{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Placeholder when a logo is missing (keeps rows aligned, no layout shift) */
.lk-nologo{display:inline-block;width:20px;height:20px;border-radius:50%;background:#2f323a;flex:0 0 auto}
.lk-nologo.is-red{background:var(--red)}
.lk-feature .t .lk-nologo{width:46px;height:46px;border-radius:8px}
.lk-scoreboard .lk-nologo{width:56px;height:56px;border-radius:10px}

/* Sidebar card titles are <p> now (not headings) */
p.lk-card-h{margin:0 0 12px}

/* Lead paragraph under every H1 (data-written, unique per page) */
.lk-lead{color:var(--muted);line-height:1.8;margin:-4px 0 14px;font-size:14px}

/* H1 + follow button side by side (the button is no longer inside the H1) */
.lk-titlebar{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.lk-titlebar h1{margin:0}
.lk-titlebar .lk-follow{margin-inline-start:auto}

/* League group headers are links with a logo */
.lk-league-block>h2 a{display:flex;align-items:center;gap:10px;min-width:0}

/* Match row: links + score parts */
.lk-match a.home:hover .nm,.lk-match a.away:hover .nm{color:var(--red)}
.lk-match a.score{display:block;border-radius:6px;padding:2px 0}
.lk-match a.score:hover{background:var(--raised)}
.lk-match .score b{font-weight:700}
.lk-match .score i{font-style:normal;color:var(--faint);margin:0 5px}
.lk-match .score time{color:var(--muted);font-weight:600;font-size:13px}
.lk-match.is-other .status{color:var(--muted)}

/* Rail extras */
.lk-feature .sc b{font-weight:800}
.lk-feature .sc i{font-style:normal;color:var(--faint);margin:0 6px}
.lk-feature .sc time{font-size:18px;color:var(--muted)}
.lk-rail-h{font-size:13px;color:var(--muted);margin:14px 0 6px;font-weight:700}
.lk-more{display:block;text-align:center;color:var(--red);font-weight:700;font-size:13px;margin-top:10px}
.lk-rail-scorers li{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 2px;border-top:1px solid var(--border-soft);font-size:13px}
.lk-rail-scorers li:first-child{border-top:0}
.lk-rail-scorers small{color:var(--faint)}
.lk-rail-scorers b{color:var(--red)}

/* Match page */
.lk-scoreboard .t{display:flex;flex-direction:column;align-items:center;gap:8px;font-weight:700}
.lk-scoreboard .score b{font-weight:800}
.lk-scoreboard .score i{font-style:normal;color:var(--faint);margin:0 8px}
.lk-scoreboard .score time{font-size:26px;color:var(--muted)}
.lk-matchpage.is-live .score,.lk-matchpage[data-state="live"] .lk-scoreboard .score{color:var(--red)}
.lk-stats-table td,.lk-stats-table th{padding:8px 6px;text-align:center;border-top:1px solid var(--border-soft);font-variant-numeric:tabular-nums}
.lk-stats-table th[scope="row"]{color:var(--muted);font-weight:600}
.lk-stats-table thead th{color:#fff;border-top:0}

/* Day loading / empty states */
.lk-loading{opacity:.45;transition:opacity .15s}
.lk-empty{color:var(--muted);text-align:center;padding:18px 8px;margin:0}

/* Footer text */
.lk-footer .inner p{margin:0;max-width:760px;line-height:1.7}

/* Plain WordPress pages (About, Contact...) inside the layout */
.lk-main .site-main,.lk-main .page-content{background:var(--card);border:1px solid var(--border);border-radius:var(--r);padding:18px;line-height:1.8}
.lk-main .site-main a{color:var(--red)}
.lk-main .site-main h1,.lk-main .site-main h2{margin:0 0 12px}

/* Score digits: flex items follow the page direction, so in Arabic the home
   goals sit on the right next to the home team (plain text "2-1" would be
   reordered left-to-right by the browser and put the home goals on the wrong side). */
.lk-match [data-role="score"],.lk-feature .sc,.lk-scoreboard .score{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.lk-match .score i,.lk-feature .sc i,.lk-scoreboard .score i{margin:0}

@media (max-width:759px){
  .lk-titlebar{flex-wrap:wrap}
  .lk-scoreboard .lk-nologo{width:44px;height:44px}
  /* both league lists in ONE swipeable chip row above the matches (Forza style) */
  .lk-side{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;margin-inline:-10px;padding-inline:10px}
  .lk-side::-webkit-scrollbar{display:none}
  .lk-side .lk-card{flex:0 0 auto;margin:0;padding:0;background:none;border:0}
  .lk-side-list{overflow:visible}
}

/* ==========================================================================
   Staging merge additions: components from the Week 2-5 templates that the
   package stylesheet does not cover (search messages, follow strip, on-demand
   note, trust pages, 404, bidi isolation, result scores).
   ========================================================================== */

/* Latin names / negative numbers inside RTL text keep their own order */
.lk-bidi{unicode-bidi:isolate}

/* Search: "no results" / "loading" notes and the result rows built by search.js */
#lk-search-results[hidden]{display:none}
.lk-search-note{margin:0;padding:10px 14px;color:var(--muted);font-size:13px}
#lk-search-results small{color:var(--faint);font-size:12px}

/* Home: the "following" strip (localStorage, filled by follow.js) */
.lk-follow-strip ul{display:flex;flex-wrap:wrap;gap:8px}
.lk-follow-strip a{display:inline-block;background:var(--bg);border:1px solid var(--border);border-radius:var(--pill);padding:5px 12px;font-size:13px}
.lk-follow-strip a:hover{border-color:var(--red);color:#fff}

/* On-demand league note + refresh button */
.lk-ondemand-note p{margin:0;color:var(--muted);font-size:13px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.lk-refresh{margin-inline-start:auto;background:var(--raised);color:var(--text);border:1px solid var(--border);border-radius:6px;padding:4px 12px;font-size:12.5px}
.lk-refresh:hover{border-color:var(--red)}
.lk-refresh[disabled]{opacity:.6;cursor:default}

/* Scores in lists (league fixtures/results, team results): home goals sit next to the home team in Arabic */
.lk-res,.lk-live-score{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums}
.lk-res b,.lk-live-score b{font-weight:700}
.lk-res i,.lk-live-score i{font-style:normal;color:var(--faint)}
.lk-live-score.is-live,.lk-fixtures li.is-live .lk-live-score,.lk-fixtures li.is-live .lk-live-status{color:var(--red)}
.lk-fixtures li a,.lk-results li a,.lk-team-fixtures li a{display:flex;align-items:center;gap:8px;min-width:0}
.lk-results li a:hover,.lk-team-fixtures li a:hover,.lk-fixtures li a:hover{color:var(--red)}
.lk-next a{font-weight:700}
.lk-next time{display:block;color:var(--faint);font-size:12.5px;margin-top:4px}
.lk-highlight-matches li{padding:8px 2px;border-top:1px solid var(--border-soft)}
.lk-highlight-matches li:first-child{border-top:0}

/* GCC and country pages: plain lists of leagues / teams */
.lk-gcc>ul li,.lk-country>ul li{padding:8px 2px;border-top:1px solid var(--border-soft)}
.lk-gcc>ul li:first-child,.lk-country>ul li:first-child{border-top:0}
.lk-gcc>ul,.lk-country>ul{background:var(--card);border:1px solid var(--border);border-radius:var(--r);padding:6px 14px;margin-bottom:16px}
.lk-gcc small{color:var(--faint);margin-inline-start:6px}
.lk-country>h2{color:var(--red);font-size:17px;margin:4px 0 10px}

/* Trust pages (About / Contact / Advertise) and the 404 page */
.lk-page-body,.lk-404 p{background:var(--card);border:1px solid var(--border);border-radius:var(--r);padding:18px;line-height:1.8;color:var(--muted)}
.lk-page-body h2{color:var(--text);font-size:17px;margin:16px 0 8px}
.lk-page-body p{margin:0 0 10px}
.lk-page-body a,.lk-404 a{color:var(--red)}

/* League hub: logo + team name on one line in the standings; scorer names stay plain */
.lk-teamcell{display:flex;align-items:center;gap:8px}
.lk-scorers li span.lk-bidi{margin-inline-start:0;color:inherit;font-weight:400}

/* v1.3.1 (Lighthouse): logos keep their own shape inside the square box (no stretching),
   and white text on the red button reaches 4.5:1 contrast */
img.badge,.lk-side-list img,.lk-league-block>h2 img,.lk-standings td img,.lk-mini-table td img,
.lk-feature .t img,.lk-scoreboard img,.lk-main h1 img,.lk-teamcell img{object-fit:contain}
.lk-btn{background:#d61f2c}

/* ==========================================================================
   v2.2: homepage and logos as on the live site
   (Live tab first, match details panel, flashing live minute, open icons,
   collapsible competitions, calendar, white tiles behind every logo)
   ========================================================================== */

/* ---- Every club / competition logo sits on a white tile (dark logos stay visible) ---- */
.lk-lg,img.badge,.lk-side-list img,.lk-league-block img,.lk-standings td img,.lk-mini-table td img,.lk-teamcell img,
.lk-main h1 img,.lk-scoreboard img,.lk-feature .t img{background:#fff;border-radius:4px;padding:2px;object-fit:contain;box-sizing:border-box}
.lk-side-list img{background:#f2f2f5;padding:1px}
.lk-scoreboard img{border-radius:8px;padding:5px}
.lk-logo-box{width:70px;height:50px;background:#fff;border:1px solid #2e3c4d;border-radius:6px;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
.lk-logo-box img{width:auto!important;height:auto!important;max-width:70%;max-height:85%;padding:0;background:none;border-radius:0}

/* ---- Fixtures card (title, tabs, date) ---- */
#lk-fixtures .lk-toolbar{background:#0d0f12;padding:10px 12px}
#lk-fixtures .lk-tabs{gap:10px}
#lk-fixtures .lk-tabs button{background:#1a1d22;color:#c4c7cc;border-radius:6px;padding:6px 14px;font-size:13.5px;font-weight:700}
#lk-fixtures .lk-tabs button.on{background:#2f323a;color:#f2f2f5}
#lk-fixtures .lk-tabs button[hidden]{display:none}
.lk-datenav{position:relative}
.lk-date-open{background:none;border:0;color:#f2f2f5;font-weight:700;font-size:15px;padding:2px 6px;cursor:pointer;min-width:84px}
.lk-date-open:hover{color:var(--red)}
.lk-cal{position:absolute;top:calc(100% + 8px);inset-inline-end:0;width:262px;background:#1a1d22;border:1px solid #2a2e35;border-radius:10px;padding:12px;z-index:60;box-shadow:0 14px 34px rgba(0,0,0,.5)}
.lk-cal[hidden]{display:none}
.lk-cal-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;font-size:14px;font-weight:700}
.lk-cal-h button{background:none;border:0;color:#f2f2f5;font-size:18px;padding:0 8px}
.lk-cal-g{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}
.lk-cal-g button{background:none;border:0;border-radius:6px;color:#c4c7cc;font-size:12.5px;padding:5px 0}
.lk-cal-g button:hover:not([disabled]){background:#2f323a;color:#fff}
.lk-cal-g button.today{box-shadow:inset 0 0 0 1px var(--red)}
.lk-cal-g button.on{background:var(--red);color:#fff}
.lk-cal-g button[disabled]{opacity:.25;cursor:default}

/* ---- Competition header: red edge, logo, name, collapse arrow ---- */
.lk-league-block>h2.lk-league-h{display:flex;align-items:center;gap:8px;margin:10px 0 0;padding:10px 14px;background:#0d0f12;
  border-inline-start:3px solid var(--red);border-radius:6px;color:#8b9096;font-size:14px;font-weight:600;cursor:pointer;text-align:start}
.lk-league-h a:hover{color:#fff}
.lk-league-h img{width:22px;height:22px}
.lk-toggle{margin-inline-start:auto;background:none;border:0;color:#8b9096;width:26px;height:26px;padding:0;cursor:pointer}
.lk-toggle::before{content:"\25BC";font-size:13px;display:inline-block;transition:transform .3s}
.lk-collapsed .lk-toggle::before{transform:rotate(180deg)}
.lk-collapsed>ul{display:none}

/* ---- Match row: [open] [minute] [home] [score] [away] ---- */
.lk-match{grid-template-columns:26px 40px minmax(0,1fr) 56px minmax(0,1fr);padding:8px 10px;cursor:pointer;border-bottom:1px solid #1a1d22}
.lk-match:hover{background:#1a1d22}
.lk-match.on{background:#23272e;box-shadow:inset 0 0 0 1px #3a3f48}
.lk-match:focus-visible{outline:2px solid var(--red);outline-offset:-2px}
.lk-open{display:block;width:22px;height:22px;background:url(open.svg) center/18px 18px no-repeat;opacity:.75;animation:lkBeat 1.6s ease-in-out infinite}
.lk-open:hover{opacity:1;animation-play-state:paused}
@keyframes lkBeat{0%,100%{transform:scale(1)}50%{transform:scale(1.14)}}
.lk-match .status,.lk-match.is-live .status{color:#c4c7cc;font-size:11.5px;font-weight:600;text-align:center}
.lk-match.is-live .status::before{content:none}
.lk-match.is-other .status{color:var(--muted)}
.lk-match .home img,.lk-match .away img{width:22px;height:22px}
.lk-match .score{font-size:15px;font-weight:700;color:#f2f2f5}
.lk-match.is-live .score{color:var(--red)}
.lk-match .score time{font-size:13px;color:var(--muted);font-weight:600}
.lk-flash{animation:lkFlash 1s infinite}
@keyframes lkFlash{0%,100%{opacity:1}50%{opacity:.4}}

/* ---- Live tab by default: filtering is pure CSS, so the first paint is already right ---- */
#lk-fixtures[data-filter="live"] .lk-match:not([data-state="live"]),
#lk-fixtures[data-filter="finished"] .lk-match:not([data-state="finished"]),
#lk-fixtures[data-filter="scheduled"] .lk-match:not([data-state="scheduled"]),
#lk-fixtures[data-filter="live"] .lk-league-block:not([data-states~="live"]),
#lk-fixtures[data-filter="finished"] .lk-league-block:not([data-states~="finished"]),
#lk-fixtures[data-filter="scheduled"] .lk-league-block:not([data-states~="scheduled"]){display:none}
.lk-fx-empty{display:none;text-align:center;color:#b9b9b9;padding:28px 10px}
.lk-fx-empty p{margin:0 0 12px}
.lk-fx-empty button{background:#1a1d22;color:#f2f2f5;border:1px solid #2f323a;border-radius:6px;padding:6px 14px;margin:4px;font-size:13px;font-weight:700}
.lk-fx-empty button:hover{border-color:var(--red)}
#lk-fixtures[data-filter="live"][data-live="0"] .lk-fx-empty[data-for="live"],
#lk-fixtures[data-filter="finished"][data-finished="0"] .lk-fx-empty[data-for="finished"],
#lk-fixtures[data-filter="scheduled"][data-scheduled="0"] .lk-fx-empty[data-for="scheduled"],
#lk-fixtures[data-filter="all"][data-total="0"] .lk-fx-empty[data-for="all"]{display:block}

/* ---- Homepage side column: match details panel ---- */
.lk-rail-home{position:static}
.lk-panel{position:relative;overflow:hidden;transition:opacity .15s}
.lk-panel.lk-loading{opacity:.6}
.lk-panel-expand{position:absolute;top:14px;inset-inline-end:14px;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;
  background:#0d0f12;color:#f2f2f5;border:1px solid #2a2e35;z-index:2}
.lk-panel-expand:hover{border-color:var(--red);color:#fff}
.lk-panel-back{display:none;background:none;border:0;color:#bbb;font-size:14px;padding:0;margin-bottom:6px;cursor:pointer}
.lk-panel-back:hover{color:#fff}
.lk-pc{position:relative;border-radius:12px;overflow:hidden;padding:14px 12px;margin-bottom:16px;background:#14171c url(panel-bg.webp) center/cover no-repeat}
.lk-pc::before{content:"";position:absolute;inset:0;background:rgba(0,0,0,.5)}
.lk-pc>*{position:relative}
.lk-pc-league{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:14px;margin-bottom:6px}
.lk-pc-comp{display:flex;align-items:center;gap:8px;min-width:0}
.lk-pc-comp img{width:22px;height:22px}
.lk-pc-round{font-size:13px;white-space:nowrap}
.lk-pc-date{text-align:center;font-size:13.5px;opacity:.85;margin:4px 0 12px}
.lk-pc-teams{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;text-align:center;gap:12px}
.lk-pc-team{display:flex;flex-direction:column;align-items:center;gap:6px;font-weight:700;font-size:14.5px;min-width:0}
a.lk-pc-team:hover .nm{color:var(--red)}
.lk-pc-score{display:flex;flex-direction:column;align-items:center;gap:4px}
.lk-pc-big{display:inline-flex;align-items:center;gap:8px;font-size:40px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.lk-pc-big i{font-style:normal;opacity:.7}
.lk-pc-big time{font-size:26px}
.lk-pc-status{font-size:13.5px}
.lk-pc-live{color:#ff6b74}
.lk-pc-info{display:flex;justify-content:center;align-items:center;gap:6px;font-size:13.5px;margin-top:6px}
.lk-pc-info .ic{opacity:.8}
.lk-panel-full{display:block;width:fit-content;margin:0 auto;padding:7px 16px}
.lk-ptabs{display:flex;gap:8px;margin:16px 0 10px}
.lk-ptabs button{flex:1;background:#0d0f12;color:#8fa5b7;border:1px solid #0d0f12;padding:6px 0;border-radius:6px;font-weight:700;font-size:13px}
.lk-ptabs button.on{background:#2f323a;color:#f2f2f5}
.lk-ptab{display:none}
.lk-ptab.on{display:block}
.lk-half{display:flex;align-items:center;gap:6px;width:max-content;margin:8px auto;padding:6px 12px;background:#0d0f12;border-radius:6px;font-size:13.5px}
.lk-dot{width:8px;height:8px;border-radius:50%;background:var(--red);display:inline-block}
.lk-ev{display:grid;grid-template-columns:1fr 48px 1fr;gap:6px;padding:9px 0;border-bottom:1px solid #1c2934;font-size:13.5px}
.lk-ev .t{text-align:center;color:#8fa5b7;font-variant-numeric:tabular-nums}
.lk-ev .a{text-align:end}
.lk-ev .who{font-weight:600}
.lk-ev .as{display:block;font-size:12px;opacity:.7}
.lk-ev small{font-size:11px;opacity:.8;margin-inline-start:3px}
.lk-ic{display:inline-block;vertical-align:middle;margin-inline-end:4px}
.lk-card-y,.lk-card-r{width:10px;height:14px;border-radius:2px}
.lk-card-y{background:#f2c94c}
.lk-card-r{background:#eb3b3b}
.lk-ic-sub{color:#4ea3ff;font-weight:700}
.lk-ic-miss{color:#eb3b3b}
.lk-ic-var{font-size:10px;border:1px solid #8fa5b7;border-radius:3px;padding:0 3px}
.lk-st{display:flex;justify-content:space-between;gap:8px;font-size:13.5px;margin:10px 0 4px}
.lk-st .lb{color:var(--muted);text-align:center}
.lk-bar{display:flex;justify-content:space-between;gap:4px;height:8px;background:#0d151c;border-radius:4px;overflow:hidden}
.lk-bar i{display:block;height:8px;border-radius:4px;background:#f2f2f5}
.lk-bar i+i{background:#e9c46a}
.lk-lu-h{margin:12px 0 8px;padding:4px;background:#0d0f12;border-radius:6px;text-align:center;font-weight:700}
.lk-lu{display:grid;grid-template-columns:1fr 1fr;gap:12px;font-size:13.5px}
.lk-lu>div+div{text-align:end}
.lk-lu li{padding:2px 0}
.lk-lu b{display:inline-block;min-width:22px;color:var(--muted)}
.lk-scroll{overflow-x:auto}
.lk-ptable{font-size:12px;min-width:540px}
.lk-ptable th,.lk-ptable td{padding:6px;border-bottom:1px solid #263544;text-align:center;white-space:nowrap}
.lk-ptable th:first-child,.lk-ptable td:first-child{text-align:start;position:sticky;inset-inline-start:0;background:var(--card)}
.lk-ptable abbr{text-decoration:none;cursor:help}
.lk-panel.lk-hl{animation:lkPop .5s ease-out}
.lk-panel.lk-hl::after{content:"";position:absolute;top:0;bottom:0;left:-45%;width:34%;pointer-events:none;z-index:3;
  background:linear-gradient(105deg,transparent,rgba(255,255,255,.07),transparent);transform:skewX(-16deg);animation:lkShine 1.2s cubic-bezier(.22,.61,.36,1)}
@keyframes lkPop{40%{transform:translateY(-12px)}70%{transform:translateY(2px)}}
@keyframes lkShine{from{left:-45%}to{left:118%}}

/* ---- Latest blog posts ---- */
.lk-posts li{padding:9px 2px;border-top:1px solid var(--border-soft)}
.lk-posts li:first-child{border-top:0}
.lk-posts a{display:block;font-weight:600;line-height:1.6}
.lk-posts a:hover{color:var(--red)}
.lk-posts time{display:block;color:var(--faint);font-size:12px;margin-top:2px}

@media (max-width:1099px){
  .lk-panel-back{display:block}
}
@media (max-width:759px){
  .lk-match{grid-template-columns:22px 34px minmax(0,1fr) 46px minmax(0,1fr);padding:8px 6px;gap:6px}
  .lk-match .home img,.lk-match .away img{width:18px;height:18px}
  .lk-match .status{font-size:11px}
  #lk-fixtures .lk-tabs button{font-size:13px;padding:6px 12px}
  .lk-pc-big{font-size:30px}
  .lk-logo-box{width:58px;height:40px}
  .lk-cal{inset-inline-end:50%;transform:translateX(50%);width:min(300px,90vw)}
  [dir="rtl"] .lk-cal{transform:translateX(-50%)}
}
@media (prefers-reduced-motion:reduce){
  .lk-flash,.lk-open,.lk-panel.lk-hl,.lk-panel.lk-hl::after{animation:none}
}

/* ---- Homepage: intro + FAQ sit under the list on desktop and after the panel on phones ---- */
.lk-layout.lk-has-extra{grid-template-areas:"side main rail" "side extra rail"}
.lk-extra{grid-area:extra;min-width:0}
.lk-extra>section{background:var(--card);border:1px solid var(--border);border-radius:var(--r);padding:14px;margin-bottom:16px}
.lk-extra>section>h2{color:var(--red);font-size:17px;text-align:center;margin-bottom:12px}
@media (max-width:1099px){.lk-layout.lk-has-extra{grid-template-areas:"side main" "side rail" "side extra"}}
@media (max-width:759px){.lk-layout.lk-has-extra{grid-template-areas:"side" "main" "rail" "extra"}}

/* ---- v2.3: grouped search results (matches, teams, competitions) ---- */
#lk-search-results{max-height:min(72vh,600px);overflow-y:auto;overscroll-behavior:contain}
.lk-sr-h{padding:8px 14px 6px;font-size:12px;font-weight:700;color:var(--red);background:var(--card-2);border-bottom:1px solid var(--border-soft)}
#lk-search-results a:focus{outline:none;background:var(--card-2)}
#lk-search-results a.lk-sr-m{display:block;padding:9px 12px}
.lk-sr-teams{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px}
.lk-sr-t{display:flex;align-items:center;gap:6px;min-width:0;font-weight:600}
.lk-sr-t .lk-bidi{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;min-width:0}
.lk-sr-away{justify-content:flex-end;text-align:end}
.lk-sr-t img,.lk-sr-n img{width:20px;height:20px;flex:0 0 auto}
.lk-sr-sc{display:inline-flex;gap:4px;align-items:center;font-weight:800;font-variant-numeric:tabular-nums;min-width:46px;justify-content:center}
.lk-sr-sc i{font-style:normal;color:var(--faint)}
.lk-sr-m.is-live .lk-sr-sc{color:var(--red)}
.lk-sr-time{min-width:46px;text-align:center;color:var(--muted);font-weight:700;font-variant-numeric:tabular-nums}
.lk-sr-meta{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:5px;font-size:11.5px;color:var(--faint);justify-content:center}
.lk-sr-live{background:var(--red);color:#fff;border-radius:3px;padding:0 5px;font-weight:700}
.lk-sr-min{color:var(--red);font-weight:700}
.lk-sr-st{color:var(--muted);font-weight:700}
.lk-sr-n{display:flex;align-items:center;gap:8px;min-width:0}

/* ==========================================================================
   1.4.5: match lists centred (league fixtures/results, team next match,
   upcoming matches, fixtures and results, featured matches, league position).
   Each row: home team | score or "vs" | away team, the score in the middle,
   date and live minute centred underneath. Works in RTL and LTR (logical sides).
   ========================================================================== */
.lk-fixtures li,.lk-results li,.lk-team-fixtures li,.lk-highlight-matches li,.lk-next{
  flex-direction:column;align-items:stretch;gap:4px;text-align:center}
.lk-fixtures li>a,.lk-results li>a,.lk-team-fixtures li>a,.lk-highlight-matches li>a,.lk-next>a{
  display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;width:100%}
.lk-fixtures li>a>:first-child,.lk-results li>a>:first-child,.lk-team-fixtures li>a>:first-child,
.lk-highlight-matches li>a>:first-child,.lk-next>a>:first-child{justify-self:end;text-align:end}
.lk-fixtures li>a>:last-child,.lk-results li>a>:last-child,.lk-team-fixtures li>a>:last-child,
.lk-highlight-matches li>a>:last-child,.lk-next>a>:last-child{justify-self:start;text-align:start}
.lk-vs{color:var(--faint);font-size:12.5px;min-width:28px;text-align:center}
.lk-results .lk-res,.lk-team-fixtures .lk-res{justify-self:center;min-width:56px;justify-content:center}
.lk-fixtures time,.lk-next time{margin:0;display:block;text-align:center;color:var(--faint);font-size:12px}
.lk-fixtures li .lk-live-score,.lk-fixtures li .lk-live-status{align-self:center}
.lk-fixtures li .lk-live-score:empty,.lk-fixtures li .lk-live-status:empty{display:none}
.lk-next h2+a{margin-top:2px}
.lk-position li{justify-content:center;flex-wrap:wrap}
@media (max-width:759px){
  .lk-fixtures li>a,.lk-results li>a,.lk-team-fixtures li>a,.lk-highlight-matches li>a,.lk-next>a{gap:8px;font-size:13px}
}
/* live score and minute side by side under the teams; date on its own line */
.lk-fixtures li{flex-direction:row;flex-wrap:wrap;justify-content:center;column-gap:8px}
.lk-fixtures li>a,.lk-fixtures li>time{flex:0 0 100%}

/* ---- 1.6.0: legal pages (Terms of Use, Privacy Policy) ---- */
.lk-page-body ul{margin:0 0 12px;padding-inline-start:22px;list-style:disc}
.lk-page-body li{margin:0 0 6px}
.lk-page-body strong{color:var(--text)}
.lk-legal-date{color:var(--faint);font-size:13px}
