:root {
  --red: #1b5e20;
  --red-dark: #0f3d13;
  --bg: #f4f4f6;
  --card: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --border: #e3e3e8;
}
body.dark {
  --bg: #121214;
  --card: #1e1e22;
  --text: #f2f2f5;
  --muted: #9a9aa2;
  --border: #2c2c32;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  transition: background .2s, color .2s;
}
.top {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; }
.top h1 { font-size: 24px; font-weight: 800; }
.tagline { font-size: 12px; opacity: .9; }
.icon-btn {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  font-size: 18px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn .ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .ic-moon { fill: currentColor; stroke: none; }
body.dark .icon-btn .ic-moon { display: none; }
body:not(.dark) .icon-btn .ic-sun { display: none; }
.chips {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-padding-inline: 12px;
}
.chips::-webkit-scrollbar { display: none; }
.chips-track { display: flex; gap: 8px; padding: 12px 12px 6px; width: max-content; min-width: 100%; }
.chip {
  white-space: nowrap; border: 1px solid var(--border); background: var(--card);
  color: var(--text); padding: 7px 14px; border-radius: 999px;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.chip.on { background: var(--red); color: #fff; border-color: var(--red); font-weight: 700; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 10px; gap: 10px;
}
.toolbar select {
  font-family: inherit; font-size: 13px; padding: 7px 10px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); max-width: 60%;
}
.updated { font-size: 11px; color: var(--muted); }
.feed { padding: 4px 12px 90px; max-width: 720px; margin: 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px; margin-bottom: 10px;
  display: flex; gap: 12px; align-items: flex-start;
  text-decoration: none; color: inherit;
  transition: transform .1s;
}
.card .thumb { flex-shrink: 0; }
.card .thumb img {
  width: 92px; height: 92px; border-radius: 10px;
  object-fit: cover; display: block; background: #e9f1e9;
}
body.dark .card .thumb img { background: #18251a; }
.card .thumb img.ph { object-fit: contain; padding: 12px; }
.card .body { flex: 1; min-width: 0; }
.card:active { transform: scale(.99); }
.meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.src {
  font-size: 11px; font-weight: 700; color: var(--red);
  background: rgba(183,28,28,.08); padding: 3px 10px; border-radius: 999px;
}
body.dark .src { background: rgba(76,175,80,.15); color: #a5d6a7; }
.time { font-size: 11px; color: var(--muted); }
.card h2 { font-size: 16px; line-height: 1.6; margin-bottom: 6px; }
.card p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.read {
  display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--red);
}
body.dark .read { color: #a5d6a7; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.install-bar {
  position: static; flex: 0 0 auto; z-index: 30;
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(0,0,0,.10);
}
.install-go {
  flex: 1; background: var(--red); color: #fff; border: none; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; font-weight: 700; font-family: inherit;
  line-height: 1.2; cursor: pointer;
}
.install-close {
  background: transparent; border: none; color: var(--muted);
  font-size: 15px; line-height: 1; padding: 10px 8px; cursor: pointer;
}
/* the page scrolls inside #scroll so the install bar can never sit on a headline */
html, body { height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }
#scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }
.foot {
  text-align: center; color: var(--muted); font-size: 11px;
  padding: 20px 16px 100px; line-height: 1.9;
}

/* view toggle */
.vtoggle { display: flex; gap: 8px; padding: 10px 16px 0; }
.vt {
  flex: 1; padding: 9px 0; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 14px; font-weight: 700; cursor: pointer;
}
.vt.on { background: var(--red); color: #fff; border-color: var(--red); }

/* matches */
.matches { padding: 12px 16px 80px; max-width: 640px; margin: 0 auto; }
.comp { margin-bottom: 18px; }
.comp h3 { font-size: 14px; color: var(--muted); margin: 8px 4px; }
.match {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.match.fav { border-color: var(--red); }
.match .side { flex: 1; font-size: 13px; font-weight: 700; }
.match .side.a { text-align: left; }
.match .mid { text-align: center; min-width: 96px; }
.match .kickoff { font-size: 11px; color: var(--muted); }
.match .score { font-size: 16px; font-weight: 800; color: var(--text); }
.match .score.live { color: var(--red); }
.match .status { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }
.match .status.live { color: var(--red); font-weight: 700; }

/* archive paging */
.more-wrap { padding: 6px 16px 34px; text-align: center; }
.more-btn {
  background: var(--card); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 11px 28px; font-family: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.more-btn:disabled { opacity: .55; }

/* lead story */
.lead-wrap { margin: 2px 0 14px; }
.sec-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  margin: 0 4px 8px; letter-spacing: .2px;
}
.lead {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.lead:active { transform: scale(.995); }
.lead-img { aspect-ratio: 16 / 9; background: #e9f1e9; overflow: hidden; }
body.dark .lead-img { background: #18251a; }
.lead-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lead-img img.ph { object-fit: contain; padding: 34px; }
.lead-body { padding: 12px 14px 14px; }
.lead h2 { font-size: 20px; line-height: 1.5; font-weight: 800; margin-bottom: 8px; }
.lead p {
  font-size: 14px; color: var(--muted); line-height: 1.75;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lead .read { margin-top: 10px; }

/* empty state */
.empty-state {
  text-align: center; padding: 48px 18px 30px; margin: 0 auto; max-width: 420px;
}
.empty-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.empty-sub { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 18px; }
