/* ==========================================================================
   Yalla Score (يلا سكور) — "stadium night" design system
   Arabic only, RTL, dark theme. Logical properties throughout.
   ========================================================================== */

/* ---------- Fonts: Cairo (SIL OFL), self-hosted ---------- */
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/cairo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cairo Fallback";
  src: local("Tahoma"), local("Segoe UI"), local("Arial");
  size-adjust: 104%;
  ascent-override: 100%;
  descent-override: 40%;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #0a0f1c;
  --bg-2: #0d1424;
  --card: #121a2d;
  --card-2: #172139;
  --card-3: #1d2945;
  --line: #222e4c;
  --line-2: #2c3a5e;
  --text: #edf1fa;
  --text-2: #c4cde2;
  --dim: #8794b4;
  --accent: #ff9a1f;
  --accent-2: #ff4d2e;
  --accent-ink: #1a0f02;
  --grad: linear-gradient(135deg, #ffb21e 0%, #ff4d2e 100%);
  --live: #ff3d6e;
  --live-bg: rgba(255, 61, 110, .14);
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, .14);
  --info: #5ac8fa;
  --warn: #fbbf24;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 22px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .55);
  --accent-fg: #ff9a1f;
  --glass: rgba(10, 15, 28, .94);
  --sunk: rgba(0, 0, 0, .28);
  --sunk-2: rgba(0, 0, 0, .38);
  --live-ink: #ffd3de;
  --warn-ink: #fde68a;
  --ok-ink: #a7f3d0;
  --err-ink: #fecdd3;
  --font: "Cairo", "Cairo Fallback", system-ui, sans-serif;
  --shell: 1320px;
  --tabbar-h: 0px;
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 85% -120px, rgba(255, 154, 31, .10), transparent 60%),
    radial-gradient(900px 480px at 0% 0%, rgba(90, 200, 250, .07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--tabbar-h);
  font-variant-numeric: tabular-nums;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-fg); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 800; letter-spacing: 0; }
p { margin: 0 0 .9em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.is-hidden { display: none !important; }
.dim { color: var(--dim); }
.fine { font-size: .85em; }
.hp { position: absolute; inset-inline-start: -9999px; height: 0; overflow: hidden; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 16px; border-radius: 0 0 var(--r-sm) var(--r-sm); font-weight: 700; }
.skip:focus { top: 0; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 16px; }
.slim { max-width: 860px; }

/* ---------- Crests & avatars ---------- */
.crest { object-fit: contain; flex: none; }
.crest-lg { width: 72px; height: 72px; }
.crest-xl { width: 88px; height: 88px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45)); }
.avatar, .ph { border-radius: 50%; object-fit: cover; background: var(--card-3); flex: none; }

/* ---------- Live indicators ---------- */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); flex: none; margin-inline-end: 6px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(255, 61, 110, .6); animation: ys-ping 1.6s infinite;
}
@keyframes ys-ping { 0% { box-shadow: 0 0 0 0 rgba(255, 61, 110, .55); } 70% { box-shadow: 0 0 0 7px rgba(255, 61, 110, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 61, 110, 0); } }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--card-3); color: var(--text-2); white-space: nowrap;
}
.tag-live { background: var(--live-bg); color: var(--live); }
.tag-soft { background: transparent; border: 1px solid var(--line-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--grad); color: var(--accent-ink); font-weight: 800; transition: transform .15s, filter .15s;
}
.btn:hover { color: var(--accent-ink); filter: brightness(1.07); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn-ghost:hover { color: var(--accent-fg); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.logo { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.logo:hover { color: inherit; }
.logo-txt { display: flex; flex-direction: column; line-height: 1.05; }
.logo-main { font-size: 22px; font-weight: 800; }
.logo-main em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo-sub { font-size: 9.5px; letter-spacing: .32em; color: var(--dim); font-weight: 700; margin-top: 3px; }

.mainnav { display: flex; gap: 4px; margin-inline-start: auto; }
.mainnav a {
  position: relative; padding: 8px 14px; border-radius: 999px; font-weight: 700; color: var(--text-2); font-size: 15px;
}
.mainnav a:hover { color: var(--text); background: var(--card-2); }
.mainnav a[aria-current="page"] { color: var(--accent-ink); background: var(--grad); }

.live-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-weight: 800; font-size: 14px; color: var(--live); background: var(--live-bg); flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 61, 110, .35);
}
.live-pill:hover, .live-pill.is-on { color: #fff; background: var(--live); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: ys-ping 1.6s infinite; }

/* ---------- Bottom tab bar (phones) ---------- */
.tabbar { display: none; }

/* ==========================================================================
   Page scaffolding
   ========================================================================== */
.page { padding-bottom: 48px; }
.page > .shell:first-child { padding-top: 18px; }

.crumbs { font-size: 13px; color: var(--dim); margin: 4px 0 14px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.crumbs::-webkit-scrollbar { display: none; }
.crumbs ol { display: flex; gap: 6px; align-items: center; }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .45; }
.crumbs a:hover { color: var(--accent-fg); }
.crumbs [aria-current] { color: var(--text-2); }

.page-h { font-size: clamp(22px, 3.2vw, 32px); margin-bottom: 16px; display: flex; align-items: center; gap: 4px; }
.page-h-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-h-row .page-h { margin: 0; }

/* Boxes (cards) */
.box {
  background: linear-gradient(180deg, var(--card) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  --pad: 18px; padding: var(--pad); margin-bottom: 18px; box-shadow: var(--shadow);
}
.box-head, .sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.box-head h2, .sec-head h2 { font-size: 18px; display: flex; align-items: center; }
.box-head h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 4px; background: var(--grad); margin-inline-end: 10px;
}
.box-sub { color: var(--dim); font-size: 13.5px; }
.sec-more { margin-inline-start: auto; font-size: 13.5px; font-weight: 700; color: var(--accent-fg); }
.sec-more:hover { color: var(--text); }
.box-foot { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); font-weight: 700; font-size: 14px; color: var(--accent-fg); text-align: center; }

/* Layouts */
.duo { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.tri { display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px; gap: 18px; align-items: start; padding-top: 6px; }
.tri-start, .duo-side { position: sticky; top: 84px; }
.tri-start .box, .tri-end .box { padding: 16px; }

/* ==========================================================================
   Home: hero + live rail
   ========================================================================== */
.hero { padding: 26px 0 8px; }
.hero-kicker {
  display: inline-block; margin: 0 0 8px; padding: 2px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800;
  color: var(--accent-fg); background: rgba(255, 154, 31, .12); box-shadow: inset 0 0 0 1px rgba(255, 154, 31, .3);
}
.hero-title { font-size: clamp(22px, 3.6vw, 36px); max-width: 30ch; }
.hero-days { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-days a {
  padding: 6px 16px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--line-2);
  font-weight: 700; font-size: 14px; color: var(--text-2);
}
.hero-days a.is-on { background: var(--text); color: var(--bg); border-color: var(--text); }

.rail { padding: 18px 0 8px; }
.rail-note, .rail-empty { color: var(--dim); font-size: 14px; margin: -6px 0 10px; }
.rail-empty { padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--r); text-align: center; margin: 0; }
.rail-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 270px); gap: 12px;
  overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.tile { scroll-snap-align: start; }
.tile .match-link {
  display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .2s, transform .2s;
}
.tile .match-link:hover { color: inherit; border-color: var(--accent-fg); transform: translateY(-2px); }
.tile.is-live .match-link { border-color: rgba(255, 61, 110, .45); background: linear-gradient(180deg, rgba(255, 61, 110, .08), var(--card) 55%); }
.tile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--dim); }
.tile-league { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tile-head .st { color: var(--live); font-weight: 800; display: inline-flex; align-items: center; }
.tile-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.tile .team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.tile .team-name { font-size: 13px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; }
.tile .sc { display: flex; gap: 6px; font-size: 26px; font-weight: 800; direction: ltr; }
.tile .sc i { font-style: normal; color: var(--dim); }
.tile .ko { font-size: 20px; font-weight: 800; direction: ltr; }
.tile-day { font-size: 11.5px; color: var(--dim); }

/* ==========================================================================
   Competition links (side rails)
   ========================================================================== */
.comp-links li + li { border-top: 1px solid var(--line); }
.comp-links a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-radius: var(--r-sm); }
.comp-links a:hover { background: var(--card-2); color: inherit; }
.cl-name { display: flex; flex-direction: column; flex: 1; min-width: 0; font-weight: 700; font-size: 14px; line-height: 1.35; }
.cl-name small, .cl-name > span + small { color: var(--dim); font-weight: 500; font-size: 12px; }
.cl-name > span { display: block; }

.club-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.club-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; text-align: center;
  background: var(--card-2); border-radius: var(--r); font-size: 12.5px; font-weight: 700; line-height: 1.3; height: 100%;
  border: 1px solid transparent;
}
.club-grid a:hover { border-color: var(--accent-fg); color: inherit; }
.club-grid small { color: var(--dim); font-weight: 600; font-size: 11.5px; }
.club-grid small.is-live { color: var(--live); }
.club-grid.is-wide { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* Scorers podium (home) */
.podium li { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.podium li + li { border-top: 1px solid var(--line); }
.pd-rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--card-3); color: var(--text-2); flex: none; }
.podium li:first-child .pd-rank { background: var(--grad); color: var(--accent-ink); }
.pd-who { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.pd-who strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-who small { color: var(--dim); font-size: 12px; }
.pd-goals { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.pd-goals b { font-size: 20px; color: var(--accent-fg); }
.pd-goals small { font-size: 10.5px; color: var(--dim); }

/* ==========================================================================
   Date navigation & filters
   ========================================================================== */
.date-nav { display: flex; align-items: stretch; gap: 6px; margin-bottom: 14px; }
.date-arrow, .cal-btn {
  display: grid; place-items: center; width: 44px; flex: none; border-radius: var(--r);
  background: var(--card-2); border: 1px solid var(--line); color: var(--text-2); cursor: pointer;
}
.date-arrow:hover, .cal-btn:hover { border-color: var(--accent); color: var(--accent-fg); }
.date-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(66px, 1fr); gap: 6px; flex: 1; min-width: 0;
  overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
}
.date-strip::-webkit-scrollbar { display: none; }
.date-strip li { scroll-snap-align: center; }
.date-strip a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 56px; padding: 6px 4px;
  border-radius: var(--r); background: var(--card-2); border: 1px solid var(--line); line-height: 1.2; height: 100%;
}
.date-strip a:hover { border-color: var(--line-2); color: inherit; background: var(--card-3); }
.d-name { font-size: 12px; color: var(--dim); font-weight: 700; white-space: nowrap; }
.d-num { font-size: 17px; font-weight: 800; white-space: nowrap; }
.d-mon { font-size: 12px; font-weight: 600; color: var(--dim); }
.date-strip a[aria-current="date"] { background: var(--grad); border-color: transparent; color: var(--accent-ink); box-shadow: 0 8px 20px -10px rgba(255, 77, 46, .8); }
.date-strip a[aria-current="date"] .d-name, .date-strip a[aria-current="date"] .d-mon { color: rgba(26, 15, 2, .75); }
.date-form { display: flex; gap: 6px; flex: none; margin: 0; }
.cal-btn { position: relative; overflow: hidden; }
.cal-btn input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.cal-btn input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.js .date-go { display: none; }

.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; align-self: flex-start; max-width: 100%; overflow-x: auto; }
.seg button {
  display: inline-flex; align-items: center; border: 0; background: transparent; padding: 6px 16px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--dim); cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-2); font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--accent-fg); color: var(--text); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: rgba(255, 154, 31, .14); border-color: var(--accent-fg); color: var(--accent-fg); }
.chip.is-static { cursor: default; }

/* ==========================================================================
   Competition groups & match rows
   ========================================================================== */
.comp-stack { display: flex; flex-direction: column; gap: 14px; }
.league-group { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.comp-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: linear-gradient(90deg, var(--card-3), var(--card-2));
  border-bottom: 1px solid var(--line);
}
.comp-names { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.comp-names h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-country { font-size: 12px; color: var(--dim); }
.comp-count { min-width: 28px; height: 24px; padding: 0 8px; border-radius: 8px; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: var(--bg); color: var(--text-2); }

.match-list > .match + .match { border-top: 1px solid var(--line); }
.match-list.is-flat { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--bg-2); }

.match:not(.tile) .match-link {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 40px 18px; align-items: center; gap: 12px;
  padding: 11px 14px; position: relative; transition: background .15s;
}
.match:not(.tile) .match-link:hover { background: var(--card-2); color: inherit; }
.match.is-live:not(.tile) .match-link { background: linear-gradient(270deg, rgba(255, 61, 110, .08), transparent 45%); }
.match.is-live:not(.tile) .match-link::before {
  content: ""; position: absolute; inset-block: 8px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--live);
}
.mc-clock {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px;
  border-inline-end: 1px solid var(--line); padding-inline-end: 10px; line-height: 1.25; text-align: center;
}
.mc-date { font-size: 11px; color: var(--dim); white-space: nowrap; }
.mc-clock .ko { font-weight: 800; font-size: 15px; direction: ltr; }
.mc-clock .st { font-size: 11.5px; font-weight: 700; color: var(--dim); display: inline-flex; align-items: center; }
.match.is-live .mc-clock .st { color: var(--live); font-size: 13px; }
.match.is-live .mc-clock .live-dot { width: 6px; height: 6px; margin-inline-end: 4px; }
.match.is-postponed .st, .match.is-cancelled .st { color: var(--warn); }
.mc-teams { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mc-league { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mc-teams .team-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.match.is-finished .team.win .team-name, .match.is-live .team-name { color: var(--text); }
.match.is-finished .team.win .team-name { font-weight: 800; }
.mc-teams .pen { font-size: 11.5px; color: var(--accent-fg); font-weight: 700; }
.match:not(.tile) .sc { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.match:not(.tile) .sc b {
  display: grid; place-items: center; width: 30px; height: 26px; border-radius: 7px; background: var(--card-3); font-size: 15px; font-weight: 800;
}
.match.is-live:not(.tile) .sc b { background: var(--live-bg); color: var(--live-ink); }
.match.is-finished:not(.tile) .team.win ~ .sc b { background: var(--card-3); }
.mc-go { color: var(--dim); opacity: .5; }
.match-link:hover .mc-go { color: var(--accent-fg); opacity: 1; }
.match.flash .sc b { animation: ys-flash 1.6s ease; }
@keyframes ys-flash { 0%, 100% { background: var(--card-3); } 25%, 60% { background: var(--accent); color: var(--accent-ink); } }

.match-list.is-feature .match-link { padding-block: 16px; }
.match-list.is-compact .match-link { grid-template-columns: 54px minmax(0, 1fr) 36px; padding: 9px 10px; }
.match-list.is-compact .mc-go { display: none; }

.empty, .rail-empty { color: var(--dim); }
.empty { text-align: center; padding: 18px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 30px 16px; color: var(--dim); }
.empty-state p { margin: 0; max-width: 46ch; }
.notice { padding: 10px 14px; border-radius: var(--r-sm); background: rgba(251, 191, 36, .12); color: var(--warn-ink); border-inline-start: 3px solid var(--warn); font-size: 14px; margin-bottom: 12px; }
.notice.is-ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok); }
.notice.is-error { background: var(--live-bg); color: var(--err-ink); border-color: var(--live); }
.tz-note { font-size: 12.5px; color: var(--dim); margin: 12px 0 0; text-align: center; }

.skeleton { display: flex; flex-direction: column; gap: 8px; }
.skeleton span { height: 58px; border-radius: var(--r); background: linear-gradient(90deg, var(--card-2) 0%, var(--card-3) 50%, var(--card-2) 100%); background-size: 200% 100%; animation: ys-shimmer 1.2s infinite linear; }
@keyframes ys-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.jump-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.jump-links a { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 700; font-size: 14px; background: var(--card); }
.jump-links a:hover { border-color: var(--accent-fg); }

/* ==========================================================================
   Entity heads (league / team), tabs
   ========================================================================== */
.ent-head {
  display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 16px; border-radius: var(--r-lg);
  background:
    linear-gradient(120deg, rgba(255, 154, 31, .16), transparent 55%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .025) 0 14px, transparent 14px 28px),
    var(--card);
  border: 1px solid var(--line);
}
.ent-head .page-h { margin-bottom: 4px; }
.ent-head p { margin: 0; }
.ent-head .crest-lg { background: rgba(255, 255, 255, .06); border-radius: 20px; padding: 8px; width: 84px; height: 84px; }

.tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin-bottom: 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); position: sticky; top: 74px; z-index: 20; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 6px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--text-2); }
.tabs a:hover { background: var(--card-3); color: var(--text); }

/* League & team cards */
.comp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.comp-card a {
  display: flex; gap: 14px; align-items: center; padding: 16px; height: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, transform .2s;
}
.comp-card a:hover { border-color: var(--accent-fg); color: inherit; transform: translateY(-2px); }
.comp-card .crest { background: rgba(255, 255, 255, .05); border-radius: 14px; padding: 6px; width: 60px; height: 60px; }
.cc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cc-body strong { font-size: 16px; }
.cc-body small { color: var(--dim); }
.cc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.season-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin: 0; }
.season-stats div { background: var(--card-2); border-radius: var(--r); padding: 10px; text-align: center; border: 1px solid var(--line); }
.season-stats dt { font-size: 12px; color: var(--dim); }
.season-stats dd { margin: 0; font-size: 22px; font-weight: 800; }
.form-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; margin-inline: -4px; }
.standings { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
.standings caption { text-align: start; font-weight: 800; padding: 8px 4px; color: var(--accent-fg); }
.standings th, .standings td { padding: 8px 6px; text-align: center; white-space: nowrap; }
.standings thead th { font-size: 12px; color: var(--dim); font-weight: 700; }
.standings thead abbr { text-decoration: none; }
.standings tbody tr { background: var(--card-2); }
.standings tbody tr td:first-child, .standings tbody tr th:first-child { border-start-start-radius: 10px; border-end-start-radius: 10px; }
.standings tbody tr > :last-child { border-start-end-radius: 10px; border-end-end-radius: 10px; }
.standings tbody tr:hover { background: var(--card-3); }
.standings .c-team { text-align: start; font-weight: 600; width: 100%; }
.standings .c-team a, .c-team-plain { display: flex; align-items: center; gap: 8px; }
.standings .c-team span { overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.standings .c-pts strong { color: var(--accent-fg); font-size: 15px; }
.pos { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-weight: 800; font-size: 12.5px; }
.pos-q { background: rgba(90, 200, 250, .16); color: var(--info); }
.standings tr.is-hl { background: rgba(255, 154, 31, .14); box-shadow: inset 0 0 0 1px rgba(255, 154, 31, .5); }
.standings.is-compact { font-size: 13px; }
.scorers .player { display: flex; align-items: center; gap: 10px; }
.scorers .player > span { display: flex; flex-direction: column; line-height: 1.3; }
.p-name { font-weight: 700; }
.p-team { font-size: 12px; color: var(--dim); }
.form-guide { display: inline-flex; gap: 3px; }
.form-guide i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; font-style: normal; font-size: 11px; font-weight: 800; }
.form-guide.is-lg i { width: 26px; height: 26px; font-size: 12.5px; }
.f-W { background: var(--ok-bg); color: var(--ok); }
.f-D { background: rgba(148, 163, 184, .16); color: var(--text-2); }
.f-L { background: var(--live-bg); color: var(--live); }

/* ==========================================================================
   Match page
   ========================================================================== */
.duel {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 22px 18px 18px; margin-bottom: 16px; text-align: center;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 154, 31, .22), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 60px, transparent 60px 120px),
    var(--card);
  border: 1px solid var(--line);
}
.duel::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--grad); }
.duel.is-live::after { background: var(--live); }
.sb-league { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-2); padding: 3px 12px; border-radius: 999px; background: var(--sunk); }
.sb-league a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.sb-title { font-size: clamp(17px, 2.4vw, 22px); margin: 12px 0 6px; color: var(--text-2); }
.sb-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 10px 0 16px; }
.sb-team { display: flex; flex-direction: column; align-items: center; gap: 10px; font-weight: 800; font-size: clamp(14px, 2vw, 18px); }
.sb-center { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 120px; }
.sb-score { display: flex; gap: 10px; direction: ltr; align-items: center; }
.sb-score b { display: grid; place-items: center; min-width: 58px; height: 64px; border-radius: 14px; background: var(--sunk-2); font-size: 40px; font-weight: 800; border: 1px solid var(--line-2); }
.sb-score i { font-style: normal; color: var(--dim); font-size: 28px; }
.duel.is-live .sb-score b { border-color: rgba(255, 61, 110, .5); }
.duel.flash .sb-score b { animation: ys-flash 1.6s ease; }
.sb-time { font-size: 34px; font-weight: 800; direction: ltr; }
.sb-status { display: inline-flex; align-items: center; font-weight: 800; font-size: 14px; padding: 2px 12px; border-radius: 999px; background: var(--sunk); }
.duel.is-live .sb-status { color: var(--live); }
.duel .pen { font-size: 13px; color: var(--accent-fg); font-weight: 700; }
.sb-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; }
.sb-facts div { padding: 6px 12px; border-radius: 12px; background: var(--sunk); font-size: 13px; text-align: start; }
.sb-facts dt { color: var(--dim); font-size: 11.5px; }
.sb-facts dd { margin: 0; font-weight: 700; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 6px; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 50%; width: 2px; background: var(--line); transform: translateX(50%); }
.ev { display: grid; grid-template-columns: 1fr 44px 1fr; align-items: center; gap: 10px; position: relative; }
.ev-min { grid-column: 2; grid-row: 1; justify-self: center; z-index: 1; min-width: 40px; padding: 2px 6px; border-radius: 999px; background: var(--card-3); font-size: 12.5px; font-weight: 800; text-align: center; direction: ltr; }
.ev-home .ev-text { grid-column: 1; grid-row: 1; text-align: end; }
.ev-away .ev-text { grid-column: 3; grid-row: 1; }
.ev-icon { display: none; }
.ev-text { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; background: var(--card-2); font-size: 14px; line-height: 1.4; position: relative; }
.ev-home .ev-text { border-inline-end: 3px solid var(--line-2); }
.ev-away .ev-text { border-inline-start: 3px solid var(--line-2); }
.ev:has(.ev-goal) .ev-text { border-color: var(--ok); }
.ev:has(.ev-yellow) .ev-text { border-color: var(--warn); }
.ev:has(.ev-red) .ev-text { border-color: var(--live); }
.ev:has(.ev-sub) .ev-text { border-color: var(--info); }
.ev:has(.ev-miss) .ev-text, .ev:has(.ev-own) .ev-text { border-color: #a78bfa; }
.ev-text .dim { font-size: 12.5px; }

.stats-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.stats { display: flex; flex-direction: column; gap: 12px; }
.stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 5px; }
.stat-row span { color: var(--text-2); }
.stat-row b { min-width: 40px; }
.stat-row b:last-child { text-align: end; }
.stat-bar { display: flex; gap: 4px; height: 7px; }
.stat-bar span { border-radius: 99px; background: var(--card-3); }
.stat-bar .sb-h.lead { background: var(--grad); }
.stat-bar .sb-a.lead { background: var(--info); }

.motm { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: linear-gradient(90deg, rgba(255, 154, 31, .14), transparent); margin-bottom: 14px; }
.motm > div { display: flex; flex-direction: column; flex: 1; line-height: 1.35; }
.rating { min-width: 38px; padding: 2px 6px; border-radius: 8px; text-align: center; font-size: 13.5px; }
.r-hi { background: var(--ok-bg); color: var(--ok); }
.r-mid { background: rgba(251, 191, 36, .14); color: var(--warn); }
.r-lo { background: var(--live-bg); color: var(--live); }
.tp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tp-cols h3, .lineup h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 8px; flex-wrap: wrap; }
.tp-list li, .inj-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.tp-list li + li, .inj-list li + li { border-top: 1px solid var(--line); }
.tp-name, .inj-who { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; font-size: 14px; }

.lineups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lineup { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.lineup h4 { font-size: 13px; color: var(--accent-fg); margin: 12px 0 6px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 14px; }
.players .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--card-3); flex: none; }
.players.is-subs .num { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.pos-tag { margin-inline-start: auto; font-size: 11px; color: var(--dim); font-weight: 700; }

.h2h-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.h2h-sum div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: var(--r); background: var(--card-2); text-align: center; font-size: 13px; }
.h2h-sum b { font-size: 24px; }
.pred-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; gap: 3px; margin-bottom: 12px; }
.pred-bar span:nth-child(1) { background: var(--grad); }
.pred-bar span:nth-child(2) { background: var(--card-3); }
.pred-bar span:nth-child(3) { background: var(--info); }
.pred-pick { font-weight: 700; }
.sub-title { font-size: 15px; margin: 16px 0 10px; color: var(--text-2); }

/* ==========================================================================
   Stories (news)
   ========================================================================== */
.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.story-grid.is-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.story { display: flex; flex-direction: column; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: border-color .2s; }
.story:hover { border-color: var(--line-2); }
.story.is-large { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; }
.story-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--card-3); }
.story.is-large .story-img { aspect-ratio: auto; height: 100%; }
.story-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.story:hover .story-img img { transform: scale(1.04); }
.story-body { display: flex; flex-direction: column; gap: 6px; padding: 14px; flex: 1; }
.story-cat { align-self: flex-start; font-size: 12px; font-weight: 800; color: var(--accent-fg); }
.story-title { font-size: 16px; line-height: 1.45; }
.story.is-large .story-title { font-size: clamp(18px, 2.2vw, 24px); }
.story-excerpt { color: var(--text-2); font-size: 14px; margin: 0; }
.story-date { margin-top: auto; font-size: 12.5px; color: var(--dim); }
.story-list { display: flex; flex-direction: column; gap: 10px; }
.story-list .story { flex-direction: row; }
.story-list .story-img { width: 110px; flex: none; aspect-ratio: 1; }
.story-list .story-body { padding: 10px 12px; }
.story-list .story-title { font-size: 14px; }
.cat-nav { margin-bottom: 16px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 22px; }
.pager a { padding: 7px 18px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 700; }
.pager a:hover { border-color: var(--accent-fg); }

/* Article */
.article { min-width: 0; }
.article-head { margin-bottom: 18px; }
.article-title { font-size: clamp(24px, 3.6vw, 38px); line-height: 1.35; margin: 6px 0 12px; }
.article-lede { font-size: 18px; color: var(--text-2); }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; color: var(--dim); }
.article-figure { margin: 0 0 22px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.article-figure img { width: 100%; height: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.article-nav a { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.article-nav a:hover { border-color: var(--accent-fg); color: inherit; }
.article-nav small { color: var(--accent-fg); font-weight: 700; }
.an-next { text-align: end; }

.prose { font-size: 16.5px; line-height: 1.95; color: var(--text-2); }
.prose h2 { font-size: 22px; color: var(--text); margin: 1.4em 0 .5em; }
.prose h3 { font-size: 18px; color: var(--text); margin: 1.2em 0 .4em; }
.prose a { color: var(--accent-fg); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent-fg); }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-inline-start: 4px solid var(--accent); background: var(--card-2); border-radius: var(--r-sm); }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: start; }
.prose th { color: var(--text); background: var(--card-2); }
.prose img { border-radius: var(--r); height: auto; }
.seo-text h2 { margin-top: 0; font-size: 20px; }
.seo-text { font-size: 15px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 14px; color: var(--text); }
.field input, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line-2); color: var(--text);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent-fg); box-shadow: 0 0 0 3px rgba(255, 154, 31, .2); }
.field.has-error input, .field.has-error textarea { border-color: var(--live); }
.field-error { color: var(--live); font-size: 13px; }
.form .btn { align-self: flex-start; }

/* Error pages */
.error-page { text-align: center; padding-block: 48px; }
.error-code { font-size: clamp(90px, 18vw, 160px); font-weight: 800; line-height: 1; margin: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page .page-h { justify-content: center; }

/* ==========================================================================
   Footer
   ========================================================================== */
.foot { margin-top: 30px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 34px 0 20px; }
.foot-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.foot-about { margin: 0; color: var(--dim); max-width: 62ch; font-size: 14.5px; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 22px; padding: 24px 0; }
.foot-cols nav { display: flex; flex-direction: column; gap: 6px; }
.foot-h { font-size: 13px; letter-spacing: .02em; color: var(--accent-fg); margin-bottom: 6px; }
.foot-cols a { color: var(--text-2); font-size: 14.5px; }
.foot-cols a:hover { color: var(--accent-fg); }
.foot-bottom { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .tri { grid-template-columns: 230px minmax(0, 1fr); }
  .tri-end { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .tri-end .box { margin-bottom: 0; }
  .duo { grid-template-columns: minmax(0, 1fr) 300px; }
  .story-grid.is-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  :root { --tabbar-h: calc(64px + env(safe-area-inset-bottom)); }
  .mainnav { display: none; }
  .top-actions { margin-inline-start: auto; }
  .topbar-in { min-height: 58px; }
  .tri, .duo { grid-template-columns: minmax(0, 1fr); }
  .tri-start { order: 3; position: static; }
  .tri-main { order: 1; }
  .tri-end { order: 2; grid-template-columns: 1fr; }
  .duo-side { position: static; }
  .tabs { top: 64px; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
    height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
    background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--dim); position: relative; }
  .tab-ico { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background .2s, color .2s; }
  .tab[aria-current="page"] { color: var(--text); }
  .tab[aria-current="page"] .tab-ico { background: rgba(255, 154, 31, .18); color: var(--accent-fg); }
  .tab:active .tab-ico { transform: scale(.92); }
  .tab-live .ico { color: var(--live); }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .shell { padding-inline: 12px; }
  .box { --pad: 12px; padding: 14px var(--pad); border-radius: var(--r); }
  .hero { padding-top: 18px; }
  .logo-main { font-size: 19px; }
  .logo-mark { width: 32px; height: 32px; }
  .live-pill { padding: 6px 12px; font-size: 13px; }
  .rail-track { grid-auto-columns: minmax(220px, 78vw); }
  .date-arrow { display: none; }
  .date-strip { grid-auto-columns: 68px; }
  .match:not(.tile) .match-link { grid-template-columns: 54px minmax(0, 1fr) 34px; gap: 10px; padding: 10px; }
  .mc-go { display: none; }
  .comp-head { padding: 9px 10px; }
  .story-grid, .story-grid.is-page { grid-template-columns: minmax(0, 1fr); }
  .story.is-large { display: flex; }
  .story.is-large .story-img { aspect-ratio: 16 / 9; }
  .tp-cols, .lineups { grid-template-columns: 1fr; }
  .sb-score b { min-width: 46px; height: 54px; font-size: 32px; }
  .crest-xl { width: 64px; height: 64px; }
  .sb-center { min-width: 96px; }
  .ent-head { padding: 16px; gap: 12px; }
  .ent-head .crest-lg { width: 64px; height: 64px; }
  .hide-sm { display: none; }
  .article-nav { grid-template-columns: 1fr; }
  .club-grid { grid-template-columns: repeat(3, 1fr); }
  .ev { grid-template-columns: 1fr 40px 1fr; gap: 6px; }
  .ev-text { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 860px) { .hide-md { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* League logos are often dark artwork: give them a light chip on the dark theme. */
.comp-logo, .comp-links .crest, .chip-logo, .tile-logo, .sb-league .crest, .comp-card .crest, .ent-head .crest-lg {
  background: #eef2f8; border-radius: 8px; padding: 3px;
}
.chip-logo, .tile-logo { border-radius: 5px; padding: 1px; }


/* ==========================================================================
   v2 — light theme, header actions, collapsible groups, mobile polish
   ========================================================================== */
:root[data-theme="light"] {
  --bg: #f2f4f9; --bg-2: #f8f9fc; --card: #ffffff; --card-2: #f3f5fa; --card-3: #e7ebf3;
  --line: #e2e7f0; --line-2: #cdd5e3; --text: #0f1729; --text-2: #3a465f; --dim: #66728f;
  --accent-fg: #c2410c; --glass: rgba(255, 255, 255, .94); --sunk: rgba(15, 23, 41, .05); --sunk-2: rgba(15, 23, 41, .07);
  --live: #e11d48; --live-bg: rgba(225, 29, 72, .1); --live-ink: #be123c;
  --ok: #059669; --ok-bg: rgba(5, 150, 105, .12); --ok-ink: #065f46;
  --warn: #d97706; --warn-ink: #92400e; --err-ink: #9f1239; --info: #0284c7;
  --shadow: 0 8px 24px -16px rgba(15, 23, 41, .35);
  color-scheme: light;
}
:root[data-theme="light"] body { background: radial-gradient(1100px 520px at 85% -120px, rgba(255, 154, 31, .14), transparent 60%), var(--bg); }
:root[data-theme="light"] .comp-logo, :root[data-theme="light"] .comp-links .crest, :root[data-theme="light"] .comp-card .crest,
:root[data-theme="light"] .ent-head .crest-lg, :root[data-theme="light"] .sb-league .crest { box-shadow: inset 0 0 0 1px var(--line); }
:root[data-theme="light"] .tabbar, :root[data-theme="light"] .topbar { box-shadow: 0 1px 0 var(--line); }
:root[data-theme="light"] .sb-score b { color: var(--text); }
:root[data-theme="light"] .match:not(.tile) .sc b { background: var(--card-3); }
html { transition: background-color .25s; }

[hidden] { display: none !important; }
html { -webkit-tap-highlight-color: transparent; }
a, button, input { touch-action: manipulation; }

/* Header actions */
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text-2); transition: color .15s, border-color .15s, transform .15s;
}
.icon-btn:hover { color: var(--accent-fg); border-color: var(--accent); }
.icon-btn:active { transform: scale(.92); }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }
.live-pill { min-height: 40px; }
.lp-num {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--live); color: #fff; font-size: 12.5px; line-height: 1;
}
.live-pill:hover .lp-num, .live-pill.is-on .lp-num { background: #fff; color: var(--live); }
.live-pill:not(.has-live) .pulse { animation: none; opacity: .55; }
.tab-badge {
  position: absolute; top: -5px; inset-inline-end: 8px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--live); color: #fff; font-size: 12px; font-weight: 800; line-height: 1;
  border: 2px solid var(--bg-2);
}

/* Collapsible competition groups */
.comp-toggle {
  display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 8px 0 10px; border: 0; border-radius: 999px;
  background: var(--bg); color: var(--text-2); cursor: pointer; flex: none;
}
.comp-toggle:hover { color: var(--accent-fg); }
.comp-toggle .comp-count { background: none; min-width: 0; height: auto; padding: 0; }
.chev { transition: transform .2s; }
.league-group.is-collapsed .chev { transform: rotate(90deg); }
.league-group.is-collapsed .match-list { display: none; }
.league-group.is-collapsed .comp-head { border-bottom-color: transparent; }
/* Skip rendering off-screen competitions until they scroll near (long day lists). */
.league-group { content-visibility: auto; contain-intrinsic-size: auto 240px; }

/* Press feedback */
.match-link, .comp-card a, .club-grid a, .story, .chip, .seg button, .date-strip a { transition: transform .15s ease, background .15s, border-color .15s; }
.match-link:active, .comp-card a:active, .club-grid a:active, .date-strip a:active, .chip:active { transform: scale(.98); }
.btn:active { transform: scale(.97); }

/* Bigger tap targets */
.sec-more { padding: 7px 12px; margin-block: -7px; border-radius: 999px; }
.sec-more:hover { background: var(--card-2); }
.story-cat { padding-block: 5px; }
.crumbs { margin: 0 0 8px; }
.crumbs a { display: inline-block; padding-block: 7px; }
.seg button { min-height: 36px; }
.chip { min-height: 34px; }

/* Readable minimum text size */
.mc-date, .mc-league, .mc-clock .st, .tile-day, .tile-head, .comp-country, .pos-tag, .story-date, .mc-teams .pen, .d-mon { font-size: 12px; }
.form-guide i { font-size: 12px; }

/* Anchors land below the sticky header + section tabs */
section[id], [id].box { scroll-margin-top: 140px; }

@media (max-width: 960px) {
  .topbar-in { gap: 10px; }
  /* Filters stay reachable while scrolling a long day */
  .filters {
    position: sticky; top: 59px; z-index: 15; gap: 8px;
    margin-inline: calc(-1 * var(--pad, 12px)); padding: 8px var(--pad, 12px);
    background: var(--glass); border-block: 1px solid var(--line);
  }
  .seg { align-self: stretch; }
  .seg button { flex: 1; justify-content: center; }
  .hero { padding: 14px 0 0; }
  .hero-title { font-size: 21px; }
  .hero-days { display: none; }
  .rail { padding-top: 12px; }
  .rail-track { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-top { gap: 12px; }
  .tabs { border-radius: var(--r); }
}
@media (max-width: 640px) {
  .logo-sub { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .live-pill { min-height: 38px; padding: 0 12px; }
  .box-head h2, .sec-head h2 { font-size: 17px; }
  .comp-names h3 { font-size: 14.5px; }
  .page-h { font-size: 22px; }
  .sb-facts div { flex: 1 1 40%; }
}
.foot-cols a { padding-block: 5px; }

/* Home hero + rail header: one compact row instead of stacked blocks */
.hero { padding: 20px 0 4px; }
.hero-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.hero-text { min-width: 0; flex: 1 1 420px; }
.hero-kicker { margin-bottom: 6px; }
.hero-title { max-width: none; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.35; }
.hero-days { margin-top: 0; flex: none; }
.hero-days a { padding: 5px 14px; font-size: 13.5px; }
.rail { padding: 14px 0 4px; }
.rail .sec-head { margin-bottom: 10px; gap: 6px 12px; }
.sec-note { color: var(--dim); font-size: 13px; min-width: 0; }
.rail-track { padding-bottom: 10px; }
@media (max-width: 960px) {
  .hero { padding: 12px 0 0; }
  .hero-title { font-size: 19px; }
  .rail { padding-top: 10px; }
}
@media (max-width: 640px) {
  .rail .sec-head { row-gap: 2px; }
  .sec-note { order: 3; flex-basis: 100%; font-size: 12.5px; }
}

/* Language switch */
.lang-btn { font-weight: 800; font-size: 14px; line-height: 1; }
.lang-btn:hover { color: var(--accent-fg); }
.foot-lang { align-self: flex-start; margin-top: 6px; font-weight: 700; color: var(--accent-fg); }

/* ==========================================================================
   LTR (English edition, yalla-score.net): mirror direction-specific details
   ========================================================================== */
[dir="ltr"] .match.is-live:not(.tile) .match-link { background: linear-gradient(90deg, rgba(255, 61, 110, .08), transparent 45%); }
[dir="ltr"] .timeline::before { transform: translateX(-50%); }
[dir="ltr"] .league-group.is-collapsed .chev { transform: rotate(-90deg); }
[dir="ltr"] .mc-go svg, [dir="ltr"] .date-arrow svg { transform: scaleX(-1); }
[dir="ltr"] body { letter-spacing: -.005em; }
[dir="ltr"] .hero-title, [dir="ltr"] .page-h { letter-spacing: -.015em; }
@media (max-width: 960px) {
  [dir="ltr"] .rail-track { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); }
}

/* Arabic text never gets letter-spacing (it breaks letter joining) */
.logo-sub:lang(ar) { letter-spacing: 0; font-size: 11.5px; margin-top: 1px; }
