:root {
  --brand: #0d5a45; --brand-deep: #083a2d; --brand-rgb: 13, 90, 69;
  --bg: #f2f6f4; --surface: #ffffff; --ink: #11231d; --muted: #55675f; --line: #dbe5e0;
  --live: #d93a3f; --top: #0d8a62; --down: #d93a3f; --tint: #e8f2ee;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1512; --surface: #12211c; --ink: #e6f0ec; --muted: #9bb0a7; --line: #22372f;
    --tint: #16302a; --live: #ff6b70; --top: #35c999; --down: #ff6b70;
  }
}
body { font-family: 'Cairo', system-ui, Tahoma, sans-serif; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.8; }
small { font-size: 15px; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.fb-wrap { max-width: 1440px; margin-inline: auto; padding-inline: 16px; }

/* header */
.fb-top { background: linear-gradient(135deg, var(--brand-deep), var(--brand)); color: #fff; position: sticky; top: 0; z-index: 20; }
.fb-top-in { display: flex; align-items: center; gap: 20px; padding-block: 10px; }
.fb-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 26px; flex: none; }
.fb-logo { height: 44px; width: auto; background: #fff; border-radius: 12px; padding: 3px 6px; }
.fb-ball { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 45%, #cfe3db 46% 100%); box-shadow: inset -3px -3px 0 rgba(0,0,0,.18); }
.fb-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.fb-nav::-webkit-scrollbar { display: none; }
.fb-nav a { color: rgba(255,255,255,.86); text-decoration: none; padding: 6px 16px; border-radius: 99px; white-space: nowrap; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.fb-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.fb-nav a.on { background: #fff; color: var(--brand-deep); }
.fb-nav a:focus-visible, .fb-day:focus-visible, .fb-round-nav a:focus-visible { outline: 3px solid #7be3bd; outline-offset: 2px; }

.fb-main { padding-block: 24px 48px; }

/* day strip */
.fb-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin-bottom: 24px; }
.fb-day { display: flex; flex-direction: column; align-items: center; line-height: 1.4; padding: 10px 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; min-height: 44px; }
.fb-day > span { font-size: 15px; color: var(--muted); }
.fb-day b { font-size: 24px; font-weight: 800; }
.fb-day.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fb-day.on > span { color: rgba(255,255,255,.85); }

/* blocks and matches */
.fb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 20px; align-items: start; }
.fb-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.fb-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px 12px; margin: 0; }
.fb-block h2 { font-size: 20px; font-weight: 800; margin: 0; padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.fb-block h2 a { color: var(--ink); text-decoration: none; }
.fb-block h2 a:hover { color: var(--brand); }
.fb-match { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.fb-match:last-child { border-bottom: 0; }
.fb-match.is-live { background: linear-gradient(90deg, transparent, rgba(217,58,63,.07), transparent); }
.fb-side { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.fb-side-away { flex-direction: row-reverse; justify-content: flex-start; text-align: end; }
.fb-cw { position: relative; display: inline-flex; flex: none; }
.fb-hbadge { position: absolute; inset-block-end: -4px; inset-inline-start: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface); }
.fb-tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-win .fb-tname { font-weight: 800; }
.fb-crest { width: 32px; height: 32px; object-fit: contain; flex: none; }
.fb-crest-tla { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--tint); color: var(--brand); font-size: 15px; font-weight: 800; direction: ltr; }
.fb-mid { display: flex; flex-direction: column; align-items: center; min-width: 76px; line-height: 1.4; }
.fb-score { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 800; }
.fb-score i { font-style: normal; color: var(--muted); }
.fb-time { font-size: 18px; font-weight: 700; color: var(--brand); }
.fb-badge { font-size: 15px; color: var(--muted); font-weight: 600; }
.fb-live { color: #fff; background: var(--live); border-radius: 99px; padding: 0 12px; animation: fbpulse 1.6s ease-in-out infinite; }
.fb-off { color: var(--down); }
@keyframes fbpulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .fb-live { animation: none; } }

/* league page */
.fb-lhead { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.fb-lhead h1 { font-size: 32px; font-weight: 800; margin: 0; }
.fb-lsub { color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.fb-scroll { overflow-x: auto; }
.fb-table { width: 100%; border-collapse: collapse; }
.fb-table th { font-size: 15px; font-weight: 600; color: var(--muted); padding: 12px 8px; text-align: center; white-space: nowrap; }
.fb-table td { padding: 10px 8px; text-align: center; border-top: 1px solid var(--line); }
.fb-table .tm { text-align: start; width: 100%; }
.fb-table .pos { width: 44px; }
.fb-tcell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.fb-table .pts b { font-size: 18px; }
.fb-trow.z-top .pos { box-shadow: inset -4px 0 0 var(--top); }
.fb-trow.z-down .pos { box-shadow: inset -4px 0 0 var(--down); }
.fb-grp { font-size: 17px; font-weight: 700; margin: 16px 0 0; color: var(--brand); }
.fb-roundbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.fb-roundbar h2 { border: 0; }
.fb-round-nav { display: flex; gap: 8px; }
.fb-round-nav a { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--tint); color: var(--brand); text-decoration: none; }
.fb-dayhead { font-size: 15px; font-weight: 700; color: var(--muted); padding: 14px 0 0; }
.fb-empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 12px; }
.fb-foot { border-top: 1px solid var(--line); padding-block: 20px; color: var(--muted); font-size: 15px; }

@media (max-width: 991px) { .fb-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575px) {
  .fb-top-in { flex-direction: column; align-items: stretch; gap: 6px; }
  .fb-block { padding-inline: 14px; }
  .fb-days { gap: 6px; }
  .fb-day b { font-size: 20px; }
  .hide-s { display: none; }
  .fb-match { gap: 8px; }
  .fb-side { flex-direction: column; text-align: center; gap: 4px; }
  .fb-side-away { flex-direction: column; text-align: center; }
  .fb-tname { white-space: normal; font-size: 15px; line-height: 1.4; }
  .fb-mid { min-width: 64px; }
}

/* followed teams + notifications */
.fb-bell { margin-inline-start: auto; }
.fb-nav { flex: 1; }
.fb-star { background: none; border: 0; padding: 0; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; margin-inline-start: auto; color: var(--line); cursor: pointer; border-radius: 50%; flex: none; }
.fb-star svg { fill: currentColor; }
.fb-star:hover { color: var(--muted); }
.fb-star[aria-pressed="true"] { color: var(--brand); }
.fb-star:focus-visible, .fb-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.fb-tcell .fb-star { margin-inline-start: auto; }
.fb-push { margin-bottom: 20px; }
.fb-push-text { margin: 12px 0 8px; }
.fb-push-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fb-btn { background: var(--brand); color: #fff; border: 0; border-radius: 99px; padding: 8px 22px; min-height: 44px; font-family: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.fb-push-status { min-height: 1.8em; margin: 8px 0 0; color: var(--muted); }
.fb-teams-block { margin-top: 20px; }
.fb-teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px 20px; padding-top: 8px; }
.fb-teamcell { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); padding: 4px 0; min-width: 0; font-weight: 600; }
.fb-toast { position: fixed; inset-inline: 16px; bottom: 20px; z-index: 50; max-width: 480px; margin-inline: auto; background: var(--brand-deep); color: #fff; padding: 12px 18px; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
@media (max-width: 575px) { .fb-bell { margin-inline-start: 0; } }
.fb-push-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-btn-soft { background: var(--tint); color: var(--brand); }
.fb-btn[hidden] { display: none; }

/* bottom tab bar (phones) */
.fb-tabs { display: none; }
@media (max-width: 575px) {
  body { padding-bottom: 76px; }
  .fb-top { position: static; }
  .fb-top-in { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-block: 10px 12px; }
  .fb-brand { font-size: 24px; }
  .fb-logo { height: 40px; }
  .fb-nav { flex: 1 1 100%; order: 3; margin-inline: -16px; padding-inline: 16px; mask-image: linear-gradient(to left, #000 92%, transparent); }
  .fb-nav a { min-height: 40px; padding-inline: 14px; background: rgba(255,255,255,.1); }
  .fb-nav a.on { background: #fff; }
  .fb-nav .fb-bell { display: none; }
  .fb-days { display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; margin-inline: -16px; padding: 2px 16px 6px; scroll-snap-type: x proximity; }
  .fb-days::-webkit-scrollbar { display: none; }
  .fb-day { flex: 0 0 74px; scroll-snap-align: center; padding: 8px 4px; }
  .fb-day b { font-size: 22px; }
  .fb-main { padding-block: 16px 32px; }
  .fb-lhead h1 { font-size: 26px; }
  .fb-tabs { display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 18px rgba(0,0,0,.06); }
  .fb-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; min-height: 56px; justify-content: center; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 700; line-height: 1.5; border-radius: 14px; }
  .fb-tabs a.on { color: var(--brand); background: var(--tint); }
  .fb-toast { bottom: 90px; }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fb-nav a.on { color: var(--brand-deep); } }
@media (max-width: 575px) {
  .fb-table th, .fb-table td { padding-inline: 3px; }
  .fb-table .pos { width: 30px; }
  .fb-table .fb-star { width: 36px; height: 36px; }
  .fb-tcell { gap: 6px; }
  .fb-table .fb-crest { width: 28px; height: 28px; }
}

/* league hero + logo tiles */
.fb-hero { background: linear-gradient(135deg, var(--brand-deep), var(--brand)); color: #fff; border-radius: var(--radius); padding: 36px 28px 72px; margin-bottom: -48px; }
.fb-hero h1 { font-size: 34px; font-weight: 800; margin: 0 0 6px; }
.fb-hero p { margin: 0; color: rgba(255,255,255,.88); font-size: 18px; }
.fb-tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.fb-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 14px 8px 12px; text-align: center; line-height: 1.4; color: var(--ink); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .15s, border-color .15s, box-shadow .15s; }
.fb-tile:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 24px rgba(var(--brand-rgb), .14); color: var(--ink); }
.fb-tile:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.fb-tile > b { font-size: 16px; font-weight: 700; }
.fb-tile-logo { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }
.fb-llogo { object-fit: contain; max-width: 70%; max-height: 70%; width: auto; height: auto; }
.fb-tile-en { font-size: 15px; color: var(--muted); direction: ltr; unicode-bidi: isolate; }
.fb-tiles-big { position: relative; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding-inline: 20px; margin-bottom: 0; }
.fb-tiles-big .fb-tile { padding: 22px 12px 18px; box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.fb-tiles-big .fb-tile-logo { width: 112px; height: 112px; }
.fb-tiles-big .fb-tile > b { font-size: 19px; }
.fb-lhead .fb-llogo { width: 56px; height: 56px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 50%; align-self: center; max-width: none; max-height: none; object-fit: contain; }
@media (max-width: 991px) { .fb-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 575px) {
  .fb-nav { display: none; }
  .fb-top-in { padding-block: 10px; }
  .fb-tiles { gap: 8px; }
  .fb-tile { padding: 8px 4px 6px; gap: 2px; }
  .fb-tile-logo { width: 46px; height: 46px; }
  .fb-tile > b { font-size: 15px; }
  .fb-hero { padding: 24px 18px 64px; margin-bottom: -44px; }
  .fb-hero h1 { font-size: 26px; }
  .fb-hero p { font-size: 16px; }
  .fb-tiles-big { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 10px; gap: 10px; }
  .fb-tiles-big .fb-tile-logo { width: 88px; height: 88px; }
  .fb-tiles-big .fb-tile > b { font-size: 17px; }
}

/* install as app */
.fb-top-in { position: relative; }
.fb-install { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 6px 16px; border-radius: 99px; border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.1); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.fb-install[hidden] { display: none; }
.fb-install:hover { background: #fff; color: var(--brand-deep); }
.fb-install:focus-visible { outline: 3px solid #7be3bd; outline-offset: 2px; }
@media (max-width: 575px) {
  .fb-install { position: absolute; inset-inline-end: 0; top: 0; padding: 6px 12px; }
}
.fb-help { border: 0; border-radius: var(--radius); padding: 24px; width: min(92vw, 420px); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.fb-help::backdrop { background: rgba(8,58,45,.55); }
.fb-help h2 { font-size: 20px; font-weight: 800; margin: 0 0 12px; }
.fb-help ol { margin: 0 0 18px; padding-inline-start: 22px; display: grid; gap: 8px; }
.fb-help button { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
