/* =========================================================================
   SportBaseline — global stylesheet (v3 — full-width, density, sortable)
   ========================================================================= */
:root {
  --ff-bg:        #fafbfc;
  --ff-bg-soft:   #f3f4f6;
  --ff-bg-card:   #ffffff;
  --ff-line:      #e5e7eb;
  --ff-line-2:    #d1d5db;
  --ff-text:      #111827;
  --ff-text-soft: #4b5563;
  --ff-muted:     #6b7280;
  --ff-accent:    #15803d;
  --ff-accent-2:  #22c55e;
  --ff-accent-3:  #16a34a;
  --ff-success:   #059669;
  --ff-warn:      #d97706;
  --ff-danger:    #dc2626;
  --ff-radius:    10px;
  --ff-shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --ff-shadow-lg: 0 10px 30px rgba(0,0,0,.08);

  --ff-header-h: 60px;
  --ff-pad-x:    24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ff-text);
  background: var(--ff-bg);
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--ff-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: 'Sora', 'Inter', sans-serif; line-height: 1.2; margin: 0 0 .5em; color: #0b1220; font-weight: 800; }

/* container — centered, max ~80% on large screens */
.ff-container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 0 var(--ff-pad-x); }
.ff-main      { min-height: 60vh; flex: 1 0 auto; }
.ff-footer    { flex-shrink: 0; }

/* ---------- header ---------- */
.ff-header {
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ff-line);
  position: sticky; top: 0; z-index: 50;
}
.ff-header__inner {
  width: 100%; max-width: none; margin: 0;
  padding: 0 28px;
  display: flex; align-items: center; gap: 18px;
  height: var(--ff-header-h);
}
.ff-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Sora', sans-serif; font-weight: 800;
  font-size: 1.55rem; letter-spacing: -0.02em;
  color: var(--ff-text); margin-right: 16px;
}
.ff-logo:hover { text-decoration: none; }
.ff-logo__text { display: inline-flex; align-items: baseline; line-height: 1; }
.ff-logo__sport    { color: #0b1220; font-weight: 800; }
.ff-logo__baseline { color: var(--ff-accent); font-weight: 800; }
.ff-search-wrap, .ff-search { margin-left: auto; }
@media (max-width: 900px) {
  .ff-logo { font-size: 1.3rem; margin-right: 8px; }
  .ff-header__inner { padding: 0 16px; }
}
.ff-logo__mark {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--ff-accent) 0%, var(--ff-accent-3) 100%);
  color: #fff; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 900; letter-spacing: -0.5px;
  box-shadow: 0 4px 10px rgba(22,163,74,.25);
}
.ff-nav { display: flex; gap: 2px; flex: 1; align-items: center; }
.ff-nav__link, .ff-nav__dropdown button {
  color: var(--ff-text); padding: 7px 12px; border-radius: 6px;
  font-weight: 600; font-size: .88rem; background: transparent;
  border: 0; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.ff-nav__link:hover, .ff-nav__dropdown button:hover { background: var(--ff-bg-soft); text-decoration: none; }
.ff-nav__link.is-active, .ff-nav__dropdown button.is-active { background: transparent; color: var(--ff-text); }

.ff-nav__dropdown { position: relative; }
.ff-nav__menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  background: #fff; border: 1px solid var(--ff-line); border-radius: 10px;
  min-width: 240px; padding: 6px; box-shadow: var(--ff-shadow-lg);
  z-index: 100;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .12s, transform .12s, visibility .12s;
}
.ff-nav__dropdown.is-open .ff-nav__menu { opacity: 1; visibility: visible; transform: translateY(0); }
.ff-nav__menu a {
  display: block; padding: 8px 12px; border-radius: 6px;
  color: var(--ff-text); font-size: .86rem; font-weight: 500;
}
.ff-nav__menu a:hover { background: var(--ff-bg-soft); text-decoration: none; color: var(--ff-accent); }

/* mega menu */
.ff-nav__dropdown--mega { position: relative; }
.ff-nav__dropdown--mega .ff-mega {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  transform: translateY(-4px);
  background: #fff;
  border: 1px solid var(--ff-line);
  border-radius: 12px;
  padding: 22px 8px;
  display: grid;
  gap: 0;
  box-shadow: var(--ff-shadow-lg);
  z-index: 100;
  opacity: 0; visibility: hidden;
  transition: opacity .14s, transform .14s, visibility .14s;
}
.ff-nav__dropdown--mega .ff-mega[data-cols="2"] { grid-template-columns: repeat(2, minmax(220px, 260px)); width: 540px; }
.ff-nav__dropdown--mega .ff-mega[data-cols="3"] { grid-template-columns: repeat(3, minmax(220px, 260px)); width: 800px; }
.ff-nav__dropdown--mega .ff-mega[data-cols="4"] { grid-template-columns: repeat(4, minmax(210px, 240px)); width: 1000px; }
.ff-nav__dropdown--mega.is-open .ff-mega {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}
.ff-mega__col { padding: 0 14px; display: flex; flex-direction: column; }
.ff-mega__col + .ff-mega__col { border-left: 1px solid var(--ff-line); }
.ff-mega__title {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--ff-muted); text-transform: uppercase;
  margin: 0 0 12px 8px;
  font-family: 'Inter', sans-serif;
}
.ff-mega__col a {
  display: block; padding: 8px 8px; border-radius: 6px;
  color: var(--ff-text); font-size: .85rem;
  text-decoration: none;
}
.ff-mega__col a:hover { background: var(--ff-bg-soft); text-decoration: none; }
.ff-mega__col a:hover .ff-mega__name { color: var(--ff-accent); }
.ff-mega__name { display: block; font-weight: 600; line-height: 1.25; }
.ff-mega__desc {
  display: block; font-size: .76rem; color: var(--ff-muted);
  margin-top: 2px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ff-mega__viewall {
  color: var(--ff-accent) !important; font-weight: 600 !important;
  font-size: .8rem !important; margin-top: auto;
  padding-top: 10px !important; padding-bottom: 4px !important;
}
.ff-mega__viewall:hover { background: transparent !important; text-decoration: underline !important; }

/* smart paginator */
.ff-pager {
  display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;
  margin: 24px 0;
}
.ff-pager__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border: 1px solid var(--ff-line); border-radius: 8px;
  background: #fff; color: var(--ff-text);
  font-size: .88rem; font-weight: 600; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.ff-pager__btn:hover {
  background: var(--ff-bg-soft); border-color: var(--ff-line-2);
  text-decoration: none; color: var(--ff-accent);
}
.ff-pager__btn.is-current {
  background: var(--ff-accent); color: #fff; border-color: var(--ff-accent);
  cursor: default;
}
.ff-pager__btn.is-disabled {
  color: var(--ff-muted); background: #f9fafb; cursor: not-allowed;
  border-color: var(--ff-line);
}
.ff-pager__ellipsis {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 38px; color: var(--ff-muted);
  user-select: none;
}

.ff-hamburger { display: none; background: none; border: 0; cursor: pointer; width: 36px; height: 36px; padding: 8px; flex-direction: column; gap: 4px; }
.ff-hamburger span { display: block; height: 2px; background: var(--ff-text); border-radius: 2px; transition: transform .2s; }
.ff-hamburger.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ff-hamburger.is-active span:nth-child(2) { opacity: 0; }
.ff-hamburger.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.ff-search-wrap { position: relative; }
.ff-search { display: flex; align-items: center; gap: 6px; }
.ff-search input {
  border: 1px solid var(--ff-line-2); padding: 8px 14px; border-radius: 999px;
  font: inherit; width: 240px; outline: none; background: var(--ff-bg-soft); transition: all .2s;
}
.ff-search input:focus { border-color: var(--ff-accent); background: #fff; box-shadow: 0 0 0 4px rgba(21,128,61,.08); }
.ff-search button,
.ff-search button[type="submit"] {
  width: 38px !important; height: 38px !important;
  padding: 0 !important;
  border: 0 !important; border-radius: 50% !important;
  background: var(--ff-accent) !important; color: #fff !important;
  cursor: pointer; font-size: 1rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(21,128,61,.4);
  transition: transform .12s, filter .15s;
  flex-shrink: 0;
}
.ff-search button:hover { transform: translateY(-1px); filter: brightness(1.1); }
.ff-ac-results {
  position: absolute; top: calc(100% + 6px); right: 0; width: 420px;
  background: #fff; border: 1px solid var(--ff-line); border-radius: 12px;
  box-shadow: var(--ff-shadow-lg); display: none; z-index: 200;
  max-height: 480px; overflow-y: auto;
}
.ff-ac-section { padding: 8px 14px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--ff-muted); background: var(--ff-bg-soft); }
.ff-ac-results a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-top: 1px solid var(--ff-line);
  color: var(--ff-text);
}
.ff-ac-results a:hover { background: var(--ff-bg-soft); text-decoration: none; }
.ff-ac-results img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #f3f4f6; flex-shrink: 0; }
.ff-ac-results strong { display: block; font-size: .88rem; }
.ff-ac-results span   { display: block; font-size: .74rem; color: var(--ff-muted); }

/* ---------- buttons ---------- */
.ff-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; font-weight: 600;
  border: 1px solid var(--ff-line-2); background: #fff; color: var(--ff-text);
  cursor: pointer; font-size: .88rem; transition: all .15s;
}
.ff-btn:hover { background: var(--ff-bg-soft); text-decoration: none; }
.ff-btn--primary {
  background: linear-gradient(135deg, var(--ff-accent) 0%, var(--ff-accent-3) 100%);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(22,163,74,.2);
}
.ff-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(22,163,74,.3); }
.ff-btn--ghost { background: transparent; border-color: var(--ff-line); }
.ff-btn--sm { padding: 6px 12px; font-size: .78rem; }

/* ---------- hero (home) ---------- */
.ff-hero {
  position: relative;
  color: #fff;
  padding: 60px 0 50px;
  min-height: calc(80vh - 400px);
  display: flex; flex-direction: column; justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.ff-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -2;
  background-image: url('../img/hero.webp');
  background-size: cover; background-position: center;
  filter: saturate(1.05) contrast(1.05);
}
.ff-hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(3,7,18,.55) 0%, rgba(3,7,18,.4) 45%, rgba(3,7,18,.88) 100%);
}
.ff-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0 0 18px;
  color: #fff; letter-spacing: -1px; font-weight: 800;
  text-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.ff-hero p  { font-size: 1.15rem; opacity: .9; max-width: 720px; margin: 0 auto 36px; }
.ff-hero__stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; max-width: 880px; margin: 40px auto 0;
}
.ff-hero__stat {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
}
.ff-hero__stat strong {
  display: block; font-size: 1.7rem; font-weight: 800; font-family: 'Sora', sans-serif;
  color: #fff;
}
.ff-hero__stat span { font-size: .72rem; opacity: .7; text-transform: uppercase; letter-spacing: 1.5px; }
.ff-hero__search { max-width: 680px; margin: 0 auto; display: flex; gap: 8px; }
.ff-hero__search input {
  flex: 1; padding: 16px 22px; border: 0; border-radius: 999px;
  font: inherit; font-size: 1rem; outline: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.ff-hero__search button {
  padding: 16px 32px; border: 0; border-radius: 999px;
  background: #fff; color: #111827; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
@media (max-width: 700px) {
  .ff-hero__stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- page hero (interior pages) ---------- */
.ff-page-hero {
  background: #fff;
  color: var(--ff-fg);
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--ff-line);
}
.ff-page-hero h1 { color: var(--ff-fg); font-size: 1.85rem; margin: 0 0 4px; letter-spacing: -.5px; font-weight: 800; }
.ff-page-hero p  { color: #111827; font-size: 1.05rem; margin: 0; font-weight: 500; }
.ff-page-hero__meta { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 12px; font-size: .85rem; color: var(--ff-muted); }
.ff-page-hero__meta strong { color: var(--ff-fg); font-weight: 700; }

/* In-page country / league switcher (sits between breadcrumb and h1 on competition profile). */
.ff-comp-switcher { display: inline-block; position: relative; margin: 8px 0 6px; }
.ff-comp-switcher > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: #f3f4f6; border: 1px solid var(--ff-line); border-radius: 18px;
  font-size: .82rem; font-weight: 600; color: var(--ff-fg); user-select: none;
}
.ff-comp-switcher > summary::-webkit-details-marker { display: none; }
.ff-comp-switcher > summary:hover { background: #e5e7eb; }
.ff-comp-switcher > summary img { height: 14px; width: auto; border-radius: 2px; }
.ff-comp-switcher__count { color: var(--ff-muted); font-weight: 500; font-size: .76rem; }
.ff-comp-switcher__chev { font-size: .7rem; color: var(--ff-muted); transition: transform .15s; }
.ff-comp-switcher[open] > summary .ff-comp-switcher__chev { transform: rotate(180deg); }
.ff-comp-switcher__menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  background: #fff; border: 1px solid var(--ff-line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  min-width: 280px; max-width: 360px; max-height: 60vh; overflow-y: auto; padding: 4px;
}
.ff-comp-switcher__menu a {
  display: flex; flex-direction: column; padding: 8px 12px; border-radius: 6px;
  text-decoration: none; color: var(--ff-fg);
}
.ff-comp-switcher__menu a:hover { background: #f3f4f6; }
.ff-comp-switcher__menu a.is-current { background: #e0f2fe; color: #0c4a6e; }
.ff-comp-switcher__menu a.is-current::after { content: ' ✓'; }
.ff-comp-switcher__name { font-weight: 600; font-size: .88rem; }
.ff-comp-switcher__meta { color: var(--ff-muted); font-size: .72rem; margin-top: 1px; }

/* Inverted variant for hero sections with a dark/gradient background (continent pages). */
.ff-page-hero--dark { color: #fff; border-bottom: 0; }
.ff-page-hero--dark h1 { color: #fff; }
.ff-page-hero--dark p { color: rgba(255, 255, 255, .92); }
.ff-page-hero--dark .ff-breadcrumb { color: rgba(255, 255, 255, .75); }
.ff-page-hero--dark .ff-breadcrumb:hover { color: #fff; }
.ff-page-hero--dark .ff-page-hero__meta { color: rgba(255, 255, 255, .8); }
.ff-page-hero--dark .ff-page-hero__meta strong { color: #fff; }
.ff-breadcrumb {
  color: var(--ff-muted); font-size: .8rem; font-weight: 600;
  display: inline-block; margin-bottom: 10px;
}
.ff-breadcrumb:hover { color: var(--ff-fg); text-decoration: none; }

/* ---------- section ---------- */
.ff-section { padding: 48px 0; }
.ff-section--soft { background: var(--ff-bg-soft); }
.ff-section--narrow { padding: 28px 0 8px; }

/* Wikipedia-sourced intro paragraph at top of competition pages */
.ff-intro {
  max-width: 880px;
  background: #fff;
  border: 1px solid var(--ff-border, #e5e7eb);
  border-left: 3px solid var(--ff-accent, #15803d);
  border-radius: 8px;
  padding: 22px 26px 18px;
}
.ff-intro__title { font-size: 1.15rem; margin: 0 0 10px; color: #111827; }
.ff-intro__body  { font-size: 1rem; line-height: 1.6; color: #1f2937; }
.ff-intro__body p { margin: 0 0 10px; }
.ff-intro__body p:last-child { margin-bottom: 0; }
.ff-intro__body a { color: var(--ff-accent, #15803d); text-decoration: none; }
.ff-intro__body a:hover { text-decoration: underline; }
.ff-intro__source { font-size: .82rem; color: var(--ff-muted, #6b7280); margin: 14px 0 0; }
.ff-intro__source a { color: var(--ff-muted, #6b7280); text-decoration: underline; }
.ff-section__head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.ff-section__head h2 { font-size: 1.55rem; margin: 0; }
.ff-section__head p  { color: var(--ff-muted); margin: 6px 0 0; font-size: .92rem; }
.ff-section__head a  { font-weight: 600; font-size: .88rem; }

/* ---------- card grids ---------- */
.ff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.ff-card {
  background: var(--ff-bg-card);
  border: 1px solid var(--ff-line);
  border-radius: var(--ff-radius);
  padding: 16px;
  box-shadow: var(--ff-shadow);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.ff-card:hover { transform: translateY(-2px); box-shadow: var(--ff-shadow-lg); border-color: var(--ff-line-2); }

.ff-player-card { display: flex; gap: 14px; align-items: center; }
.ff-player-card img {
  width: 60px; height: 60px; object-fit: cover; border-radius: 50%;
  background: var(--ff-bg-soft); border: 2px solid var(--ff-line);
  flex-shrink: 0;
}
.ff-player-card__name { font-weight: 700; font-size: .98rem; margin: 0; color: var(--ff-text); }
.ff-player-card__meta { font-size: .78rem; color: var(--ff-muted); margin-top: 2px; }
.ff-player-card__value { font-weight: 700; font-size: 1rem; color: var(--ff-success); margin-top: 6px; }

.ff-pos {
  display: inline-block; padding: 0;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  background: transparent !important;
}

/* ---------- featured competition cards (big 6) ---------- */
.ff-feat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .ff-feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .ff-feat-grid { grid-template-columns: 1fr; } }
.ff-feat-card {
  display: block; background: #fff; border: 1px solid var(--ff-line);
  border-radius: 12px; overflow: hidden;
  color: inherit; text-decoration: none; transition: all .15s;
}
.ff-feat-card:hover { transform: translateY(-3px); box-shadow: var(--ff-shadow-lg); text-decoration: none; border-color: var(--ff-accent); }
.ff-feat-card__head {
  padding: 14px 18px; background: var(--ff-bg-soft);
  color: var(--ff-text); display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--ff-line);
}
.ff-feat-card__head h3 { color: var(--ff-text); font-size: 1.02rem; margin: 0; font-weight: 700; }
.ff-feat-card__head small { font-size: .7rem; color: var(--ff-muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.ff-feat-card__body { padding: 6px 16px 12px; }
.ff-feat-card__row {
  display: grid;
  grid-template-columns: 22px 32px minmax(0, 1fr) auto;
  column-gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--ff-line);
}
.ff-feat-card__row:last-child { border-bottom: 0; }
.ff-feat-card__row > .ff-table__rank {
  font-size: .78rem; color: var(--ff-muted); font-weight: 600; font-variant-numeric: tabular-nums;
}
.ff-feat-card__row img {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: #f3f4f6; border: 1px solid var(--ff-line);
}
.ff-feat-card__row__id { min-width: 0; }   /* alias if needed */
.ff-feat-card__row strong {
  display: block;
  font-weight: 700; font-size: .88rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ff-feat-card__row span {
  display: block;
  font-size: .72rem; color: var(--ff-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.ff-feat-card__row b {
  color: var(--ff-success); font-weight: 800; font-size: 1rem;
  font-variant-numeric: tabular-nums; min-width: 28px; text-align: right;
}

/* ---------- DENSE TABLE (FBref-style modern) ---------- */
.ff-table-wrap {
  background: #fff; border: 1px solid var(--ff-line); border-radius: var(--ff-radius);
  overflow: hidden;
}
.ff-table-toolbar {
  display: flex; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--ff-line); background: var(--ff-bg-soft);
  flex-wrap: wrap; align-items: center;
}
.ff-table-toolbar input {
  flex: 1; min-width: 200px; padding: 7px 12px;
  border: 1px solid var(--ff-line-2); border-radius: 6px; font: inherit; font-size: .85rem;
  background: #fff; outline: none;
}
.ff-table-toolbar input:focus { border-color: var(--ff-accent); }

.ff-table {
  width: 100%; border-collapse: collapse; background: #fff;
  font-size: .82rem;
}
.ff-table th, .ff-table td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--ff-line);
  vertical-align: middle; white-space: nowrap;
}
.ff-table thead th {
  background: linear-gradient(180deg, var(--ff-bg-soft) 0%, #e5e7eb 100%);
  font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .5px; color: var(--ff-text-soft);
  position: sticky; top: 0; z-index: 2; user-select: none;
}
.ff-th-sortable:hover { background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%); cursor: pointer; }
.ff-th-sortable::after { content: '↕'; opacity: .35; margin-left: 4px; font-size: .85em; }
.ff-th-sortable.is-sorted-asc::after  { content: '↑'; opacity: 1; color: var(--ff-accent); }
.ff-th-sortable.is-sorted-desc::after { content: '↓'; opacity: 1; color: var(--ff-accent); }
.ff-table tbody tr:nth-child(odd)  { background: #fafbfc; }
.ff-table tbody tr:nth-child(even) { background: #fff; }
.ff-table tbody tr:hover { background: #f0fdf4; }
.ff-table tbody tr:last-child td { border-bottom: 0; }
/* numeric column alignment is now opt-in via .num (auto-applied by main.js to numeric columns) */
.ff-table__player { display: flex; align-items: center; gap: 8px; }
.ff-table__player img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--ff-bg-soft); flex-shrink: 0; }
.ff-table__rank { color: var(--ff-muted); font-weight: 700; font-variant-numeric: tabular-nums; }

.ff-table-scroll { max-height: 700px; overflow-y: auto; }

/* ---------- player profile ---------- */
.ff-pp-hero {
  background: linear-gradient(135deg, #052e16 0%, #15803d 50%, #14532d 100%);
  color: #fff; padding: 40px 0;
}
.ff-pp-hero__inner {
  display: grid; grid-template-columns: 220px 1fr 260px;
  gap: 32px; align-items: start;
}
.ff-pp-hero__img {
  width: 220px; height: 220px; border-radius: 18px; object-fit: cover;
  border: 4px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05);
  box-shadow: 0 12px 32px rgba(0,0,0,.3);
}
.ff-pp-hero h1 { color: #fff; font-size: 2.6rem; margin: 0 0 8px; letter-spacing: -1px; }
.ff-pp-hero__sub { opacity: .9; font-size: 1rem; margin-bottom: 18px; }
.ff-pp-hero__meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px; max-width: 720px; }
.ff-pp-hero__meta div span { display: block; font-size: .68rem; opacity: .65; text-transform: uppercase; letter-spacing: 1px; }
.ff-pp-hero__meta div strong { font-size: 1rem; font-weight: 700; }

/* Right-side stack: market value on top, pitch below */
.ff-pp-hero__side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ff-pp-hero__value {
  background: linear-gradient(135deg, rgba(22,163,74,.2) 0%, rgba(34,197,94,.2) 100%);
  padding: 20px 24px; border-radius: 14px; text-align: center;
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
}
.ff-pp-hero__value span { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: 1.5px; opacity: .8; }
.ff-pp-hero__value strong {
  font-size: 2rem; font-weight: 800; font-family: 'Sora', sans-serif;
  background: linear-gradient(135deg, #fff 0%, #86efac 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* tabs */
.ff-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--ff-line); margin: 32px 0 24px;
  overflow-x: auto; overflow-y: hidden;
}
.ff-tabs button {
  border: 0; background: transparent; padding: 10px 12px;
  font: inherit; font-weight: 600; color: var(--ff-muted); font-size: .82rem;
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px;
  white-space: nowrap; line-height: 1.2;
}
.ff-tabs button.is-active {
  color: var(--ff-accent); border-bottom-color: var(--ff-accent);
  background: rgba(21, 128, 61, .08);
  border-radius: 4px 4px 0 0;
}
.ff-tabs button:hover { color: var(--ff-text); background: rgba(0,0,0,.03); }
.ff-tabs button.is-active:hover { background: rgba(21, 128, 61, .12); color: var(--ff-accent); }
.ff-tab { display: none; }
.ff-tab.is-active { display: block; }

/* Sidebar variant — left vertical nav, content right.
   Opt-in by wrapping .ff-tabs + tab panels in .ff-tab-layout. */
.ff-tab-layout { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; margin: 28px 0; }
.ff-tab-layout > .ff-tabs {
  display: flex; flex-direction: column; gap: 2px;
  margin: 0; border-bottom: 0; border-right: 2px solid var(--ff-line);
  padding-right: 0;
  position: sticky; top: 80px; max-height: calc(100vh - 100px);
  overflow-x: hidden; overflow-y: auto;
}
.ff-tab-layout > .ff-tabs button {
  text-align: left; padding: 10px 14px;
  border-bottom: 0; border-right: 3px solid transparent;
  margin: 0 -2px 0 0; border-radius: 4px 0 0 4px;
}
.ff-tab-layout > .ff-tabs button:hover { background: var(--ff-bg-alt, #f9fafb); }
.ff-tab-layout > .ff-tabs button.is-active {
  color: var(--ff-accent); border-right-color: var(--ff-accent);
  background: rgba(21, 128, 61, .08); border-bottom-color: transparent;
}
.ff-tab-layout > .ff-tab-content { min-width: 0; }
@media (max-width: 860px) {
  .ff-tab-layout { grid-template-columns: 1fr; gap: 16px; }
  .ff-tab-layout > .ff-tabs {
    flex-direction: row; overflow-x: auto; overflow-y: hidden;
    border-right: 0; border-bottom: 2px solid var(--ff-line);
    position: static; max-height: none;
  }
  .ff-tab-layout > .ff-tabs button {
    border-right: 0; border-bottom: 3px solid transparent;
    border-radius: 0; margin: 0 0 -2px 0; padding: 12px 16px; white-space: nowrap;
  }
  .ff-tab-layout > .ff-tabs button.is-active {
    border-right-color: transparent; border-bottom-color: var(--ff-accent);
    background: transparent;
  }
}

/* Player-profile fact cards: uniform 2x2 stat layout */
.ff-fact-card { padding: 18px; display: flex; flex-direction: column; }
.ff-fact-card__title {
  font-size: .9rem; margin: 0 0 12px; color: var(--ff-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.ff-fact-card__grid {
  flex: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.ff-fact-cell {
  text-align: center; background: #f9fafb; padding: 12px 8px;
  border-radius: 6px; min-height: 70px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.ff-fact-cell__num { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.ff-fact-cell__lbl { font-size: .7rem; color: var(--ff-muted); line-height: 1.2; }
.ff-fact-card__foot {
  font-size: .72rem; color: var(--ff-muted);
  margin: 10px 0 0; text-align: center;
}
.ff-fact-card__list { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ff-fact-twin {
  display: flex; align-items: center; gap: 10px; padding: 6px;
  background: #f9fafb; border-radius: 6px;
  text-decoration: none; color: inherit;
}
.ff-fact-twin:hover { background: #ecfdf5; }
.ff-fact-twin img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ff-fact-twin__body { flex: 1; min-width: 0; }
.ff-fact-twin__name {
  font-weight: 600; font-size: .86rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ff-fact-twin__meta {
  font-size: .72rem; color: var(--ff-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ff-fact-twin__val { font-size: .78rem; color: var(--ff-success); font-weight: 600; }

/* Achievement badges */
.ff-badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 16px 0 0;
}
.ff-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px; border-radius: 999px;
  background: rgba(255,255,255,.10); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  font-size: .78rem; font-weight: 600;
  backdrop-filter: blur(8px);
}
.ff-badge--gold   { background: linear-gradient(135deg, rgba(251,191,36,.25), rgba(251,191,36,.10)); border-color: rgba(251,191,36,.55); }
.ff-badge--silver { background: linear-gradient(135deg, rgba(148,163,184,.25), rgba(148,163,184,.10)); border-color: rgba(148,163,184,.55); }
.ff-badge--bronze { background: linear-gradient(135deg, rgba(180,83,9,.25), rgba(180,83,9,.10)); border-color: rgba(180,83,9,.45); }
.ff-badge--info   { background: rgba(22,163,74,.15); border-color: rgba(22,163,74,.5); }
.ff-badge__icon   { font-size: .92rem; line-height: 1; }

/* Tenure pill (Days at club) */
.ff-tenure {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(16, 185, 129, .15); border: 1px solid rgba(16, 185, 129, .4);
  color: #fff; font-size: .78rem; font-weight: 600;
  margin-top: 12px;
}
.ff-tenure strong { color: #6ee7b7; }
.ff-tenure__sep   { width: 1px; height: 12px; background: rgba(255,255,255,.25); }

/* Pitch widget (lives in hero __side stack) */
.ff-pitch-card {
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 12px;
  display: grid; grid-template-columns: 90px 1fr; gap: 12px; align-items: center;
}
.ff-pitch-card__svg {
  aspect-ratio: 1 / 1.4;
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.ff-pitch-card__label {
  font-size: .76rem; color: rgba(255,255,255,.92);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 700;
  line-height: 1.3;
}
.ff-pitch-card__label small {
  display: block; font-size: .66rem; font-weight: 500;
  color: rgba(255,255,255,.6); margin-top: 4px; letter-spacing: .04em;
  text-transform: none;
}

/* Goals by competition table */
.ff-comp-split { display: flex; flex-direction: column; gap: 6px; }
.ff-comp-row {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 14px; align-items: center;
  padding: 8px 12px; background: var(--ff-bg-card);
  border: 1px solid var(--ff-line); border-radius: 8px;
}
.ff-comp-row__name { font-weight: 600; font-size: .88rem; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-comp-row__bar  {
  width: 160px; height: 8px; border-radius: 4px;
  background: var(--ff-bg-soft); position: relative; overflow: hidden;
}
.ff-comp-row__bar--g { background: linear-gradient(90deg, #dc2626 var(--g, 0%), var(--ff-bg-soft) var(--g, 0%)); }
.ff-comp-row__mini { font-size: .78rem; color: var(--ff-muted); min-width: 60px; text-align: right; }
.ff-comp-row__mini strong { color: var(--ff-text); }

/* stats grid */
.ff-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px; margin: 24px 0;
}
.ff-stat-box {
  background: #fff; border: 1px solid var(--ff-line); border-radius: 10px;
  padding: 16px; text-align: center;
}
.ff-stat-box strong { display: block; font-size: 1.7rem; font-weight: 800; color: var(--ff-accent); font-family: 'Sora', sans-serif; }
.ff-stat-box span   { font-size: .72rem; color: var(--ff-muted); text-transform: uppercase; letter-spacing: .5px; }

/* ---------- tool cards ---------- */
.ff-tool-card {
  display: block; background: #fff; border: 1px solid var(--ff-line);
  border-radius: var(--ff-radius); padding: 20px 22px; text-decoration: none; color: inherit;
  transition: border-color .15s, transform .15s;
  border-left: 3px solid var(--ff-line);
}
.ff-tool-card:hover { border-left-color: var(--ff-accent); transform: translateX(2px); text-decoration: none; }
.ff-tool-card__icon { display: none; }
.ff-tool-card h3 { font-size: 1.02rem; margin: 0 0 6px; color: var(--ff-text); font-weight: 700; }
.ff-tool-card p  { margin: 0; font-size: .85rem; color: var(--ff-muted); line-height: 1.45; }

/* ---------- compare ---------- */
.ff-compare-form {
  display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 16px;
  align-items: end; background: #fff; padding: 22px; border: 1px solid var(--ff-line);
  border-radius: 16px; margin-bottom: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.05);
}
.ff-compare-form label,
.ff-multi-form label {
  display: block; font-size: .72rem; font-weight: 700; margin-bottom: 8px;
  color: var(--ff-muted); text-transform: uppercase; letter-spacing: .06em;
}
.ff-compare-form input[type=search],
.ff-multi-form input[type=search] {
  width: 100%; height: 46px; padding: 0 18px;
  border: 1.5px solid #d4d4d4; background: #fff; color: var(--ff-fg);
  border-radius: 999px !important; font: inherit; font-size: .95rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.ff-compare-form input[type=search]:focus,
.ff-multi-form input[type=search]:focus {
  border-color: var(--ff-accent);
  box-shadow: 0 0 0 4px rgba(21,128,61,.12);
}
.ff-compare-form input[type=search]::-webkit-search-cancel-button,
.ff-multi-form input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.ff-compare-form .ff-btn,
.ff-multi-form .ff-btn {
  height: 46px !important; border-radius: 999px !important;
  padding: 0 28px !important; font-weight: 700; font-size: .92rem;
  box-shadow: 0 1px 3px rgba(21,128,61,.35);
  transition: transform .12s, filter .15s;
}
.ff-compare-form .ff-btn:hover,
.ff-multi-form .ff-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.ff-compare-vs {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.1rem;
  color: #fff; background: var(--ff-accent);
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  align-self: end; margin-bottom: 2px;
  box-shadow: 0 2px 6px rgba(21,128,61,.4);
}
.ff-autocomplete { position: relative; }
.ff-autocomplete .ff-ac-results { position: absolute; left: 0; right: auto; width: 100%; }

.ff-compare-grid {
  display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 24px; align-items: start;
}
.ff-compare-card {
  background: #fff; border: 1px solid var(--ff-line); border-radius: var(--ff-radius);
  padding: 24px; text-align: center;
}
.ff-compare-card img {
  width: 140px; height: 140px; object-fit: cover; border-radius: 50%;
  margin: 0 auto 16px; border: 4px solid var(--ff-bg-soft);
}
.ff-compare-card h2 { margin: 0 0 10px; font-size: 1.2rem; }
.ff-compare-card h2 a { color: var(--ff-text); }
.ff-compare-table .ff-table th { width: 50%; }

/* ---------- competition leader tiles ---------- */
.ff-leader-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 900px) { .ff-leader-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .ff-leader-grid { grid-template-columns: 1fr; } }
.ff-leader-tile {
  display: block; background: #fff; border: 1px solid var(--ff-line);
  border-radius: 10px; padding: 14px; color: inherit; text-decoration: none;
  transition: border-color .12s, transform .12s;
}
.ff-leader-tile:hover { border-color: var(--ff-accent); transform: translateY(-2px); text-decoration: none; }
.ff-leader-tile__label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--ff-muted); font-weight: 700; margin-bottom: 10px;
}
.ff-leader-tile__inner { display: flex; align-items: center; gap: 12px; }
.ff-leader-tile__inner img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #f3f4f6; flex-shrink: 0; }
.ff-leader-tile__inner div { flex: 1; min-width: 0; overflow: hidden; }
.ff-leader-tile__inner strong { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-leader-tile__inner span { display: block; font-size: .76rem; color: var(--ff-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ff-leader-tile__inner b { font-size: 1.5rem; font-weight: 800; font-family: 'Sora', sans-serif; flex-shrink: 0; }

/* ---------- competition card ---------- */
.ff-comp-card { display: flex; gap: 14px; align-items: center; }
.ff-comp-card__badge {
  width: 50px; height: 50px; border-radius: 10px;
  background: linear-gradient(135deg, var(--ff-accent) 0%, var(--ff-accent-3) 100%);
  color: #fff; font-family: 'Sora', sans-serif; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .82rem; flex-shrink: 0; letter-spacing: -.5px;
}

/* ---------- browse list (6 columns separated by dividers) ---------- */
.ff-browse-list {
  list-style: none; margin: 0; padding: 0;
  column-count: 5; column-gap: 0;
  column-rule: 1px solid var(--ff-line);
  background: #fff; border: 1px solid var(--ff-line); border-radius: 10px; overflow: hidden;
}
.ff-browse-list > li { break-inside: avoid; }
.ff-browse-list > li > a {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 0 14px; height: 38px;
  color: var(--ff-text); font-size: .88rem;
  border-bottom: 1px solid var(--ff-line);
  transition: background .12s;
}
.ff-browse-list > li > a:hover { background: var(--ff-bg-soft); text-decoration: none; color: var(--ff-accent); }
.ff-browse-list > li > a > span {
  font-weight: 500;
  flex: 1 1 auto; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ff-browse-list > li > a > b {
  font-weight: 600; color: var(--ff-muted); font-size: .8rem;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
@media (max-width: 1100px) { .ff-browse-list { column-count: 3; } }
@media (max-width: 700px)  { .ff-browse-list { column-count: 2; } }
@media (max-width: 500px)  { .ff-browse-list { column-count: 1; } }

/* ---------- footer ---------- */
.ff-footer { background: #052e16; color: #cbd5e1; margin-top: 60px; }
.ff-footer__inner {
  width: 100%; max-width: 1500px; margin: 0 auto; padding: 40px var(--ff-pad-x) 24px;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr 1fr; gap: 32px;
  align-items: start;
}
.ff-footer h4 { color: #fff; margin: 0 0 10px; font-size: .92rem; }
.ff-footer a { display: block; color: #cbd5e1; padding: 2px 0; font-size: .84rem; }
.ff-footer a:hover { color: #fff; }
.ff-footer__bottom {
  border-top: 1px solid #1f2937; padding: 18px var(--ff-pad-x);
  max-width: 1500px; margin: 0 auto;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: .78rem; color: #6b7280;
}

/* ---------- finder form ---------- */
.ff-finder {
  background: #fff; border: 1px solid var(--ff-line); border-radius: var(--ff-radius);
  padding: 22px; margin-bottom: 28px;
}
.ff-finder__row { display: flex; flex-wrap: wrap; gap: 14px; }
.ff-finder__row > div { flex: 1 1 160px; min-width: 0; }
.ff-finder__row > div.ff-finder__col--wide   { flex: 2 1 230px; }
.ff-finder__row > div.ff-finder__col--narrow { flex: 0 1 90px; }
.ff-finder label { display: block; font-size: .78rem; font-weight: 600; margin-bottom: 4px; color: var(--ff-text-soft); }
.ff-finder input, .ff-finder select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--ff-line-2);
  border-radius: 6px; font: inherit; background: #fff;
}
.ff-finder__actions { margin-top: 16px; display: flex; gap: 10px; }

/* pills / badges */
.ff-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--ff-bg-soft); color: var(--ff-text-soft); border: 1px solid var(--ff-line); }
.ff-pill--success { background: #ecfdf5; color: var(--ff-success); border-color: #a7f3d0; }
.ff-pill--warn    { background: #fffbeb; color: var(--ff-warn);    border-color: #fcd34d; }
.ff-pill--active  {
  border: 2px solid currentColor;
  background: color-mix(in srgb, currentColor 14%, #fff);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
  padding: 3px 11px; /* compensate for thicker border so chip height stays put */
}
a.ff-pill:hover { text-decoration: none; transform: translateY(-1px); }

/* responsive */
@media (max-width: 1100px) {
  .ff-nav__link, .ff-nav__dropdown button { padding: 7px 8px; font-size: .82rem; }
  .ff-search input { width: 160px; }
  .ff-ac-results { width: 320px; }
  .ff-footer__inner { grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .ff-footer__col:first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  :root { --ff-pad-x: 14px; }
  .ff-hamburger { display: flex; order: 99; }
  .ff-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 12px; gap: 4px;
    border-bottom: 1px solid var(--ff-line); box-shadow: var(--ff-shadow-lg);
  }
  .ff-nav.is-open { display: flex; }
  .ff-nav__dropdown { width: 100%; }
  .ff-nav__menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 20px; display: none; }
  .ff-nav__dropdown.is-open .ff-nav__menu { display: block; }
  .ff-nav__dropdown--mega .ff-mega {
    position: static; transform: none; opacity: 1; visibility: visible;
    display: none; width: 100% !important; grid-template-columns: 1fr !important;
    box-shadow: none; border: 0; padding: 0 0 0 20px; background: transparent;
  }
  .ff-nav__dropdown--mega.is-open .ff-mega { display: block; }
  .ff-mega__col { padding: 8px 0; }
  .ff-mega__col + .ff-mega__col { border-left: 0; border-top: 1px solid var(--ff-line); }
  .ff-mega__title { margin-left: 0; }
  .ff-mega__desc { white-space: normal; }
  .ff-search input { width: 130px; }
  .ff-pp-hero__inner { grid-template-columns: 1fr; text-align: center; }
  .ff-pp-hero__img { margin: 0 auto; }
  .ff-pp-hero__meta { justify-content: center; }
  .ff-footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .ff-compare-form { grid-template-columns: 1fr; }
  .ff-compare-vs   { text-align: center; padding: 8px 0; }
  .ff-compare-grid { grid-template-columns: 1fr; }
  .ff-table { font-size: .78rem; }
  .ff-table th, .ff-table td { padding: 7px 8px; }
}

/* ---------- Knockout bracket ---------- */
.ff-bracket {
  --bk-line: #d2d6dd;
  --bk-gap-x: 28px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--bk-gap-x);
  align-items: stretch;
  overflow-x: auto;
  padding: 4px 2px 8px;
  min-height: 760px; /* gives R16 pairs visible breathing room */
}
.ff-bracket__col {
  display: grid;
  grid-template-rows: auto repeat(16, 1fr);
  min-width: 200px;
  min-height: 0;
}
.ff-bracket__head {
  grid-row: 1;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ff-muted);
  padding: 6px 4px;
  border-bottom: 1px solid var(--ff-line);
  margin-bottom: 10px;
}
.ff-bracket__col--final .ff-bracket__head { color: #b08800; }
/* Body is just a logical wrapper — pairs flow into the col grid directly. */
.ff-bracket__body { display: contents; }
/* Each stage occupies a different row span so pair midpoints across stages
   align: R16 pair = 4 rows, QF pair = 8 rows, SF pair = 16 rows, Final = 16 rows. */
.ff-bracket__col--last-16        .ff-bracket__pair { grid-row: span 4; }
.ff-bracket__col--quarter-finals .ff-bracket__pair { grid-row: span 8; }
.ff-bracket__col--semi-finals    .ff-bracket__pair { grid-row: span 16; }
.ff-bracket__col--final          .ff-bracket__pair { grid-row: span 16; }
.ff-bracket__pair {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around; /* puts the two ties' midpoints at 25%/75% */
  min-height: 0;
  /* Subtle visual grouping — horizontal padding keeps vertical math intact. */
  background: rgba(48, 76, 138, 0.04);
  border: 1px solid rgba(48, 76, 138, 0.12);
  border-radius: 8px;
  padding: 0 5px;
  box-sizing: border-box;
}
.ff-bracket__pair.is-solo {
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
}
/* Vertical `]` connector between the two ties of a pair, anchored on tie
   midpoints (which are at 25% / 75% of the pair height thanks to space-around). */
.ff-bracket__col:not(.ff-bracket__col--final) .ff-bracket__pair:not(.is-solo)::after {
  content: '';
  position: absolute;
  right: calc(var(--bk-gap-x) / -2);
  top: 25%;
  bottom: 25%;
  width: calc(var(--bk-gap-x) / 2);
  border-top: 1px solid var(--bk-line);
  border-right: 1px solid var(--bk-line);
  border-bottom: 1px solid var(--bk-line);
  pointer-events: none;
}
/* Horizontal feed from pair midpoint (50%) to next col's tie midpoint */
.ff-bracket__col:not(.ff-bracket__col--final) .ff-bracket__pair:not(.is-solo)::before {
  content: '';
  position: absolute;
  right: calc(var(--bk-gap-x) / -1);
  top: 50%;
  width: calc(var(--bk-gap-x) / 2);
  height: 1px;
  background: var(--bk-line);
  pointer-events: none;
}
.ff-bracket__tie {
  background: #fff;
  border: 1px solid var(--ff-line);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.ff-bracket__row {
  display: grid;
  grid-template-columns: 22px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 7px 10px;
  font-size: .82rem;
  color: #555;
  border-bottom: 1px solid var(--ff-line);
}
.ff-bracket__legs {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.ff-bracket__legs b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 10px;
  text-align: right;
  color: #888;
  font-size: .78rem;
}
.ff-bracket__row.is-winner .ff-bracket__legs b { color: #2a8a44; font-weight: 600; }
.ff-bracket__total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--ff-line);
  border-radius: 4px;
  background: #fafbfc;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: .9rem;
  color: #222;
}
.ff-bracket__row.is-winner .ff-bracket__total {
  background: #e9f5ec;
  border-color: #b8dcc2;
  color: #0a7d2c;
}
.ff-bracket__tie.is-upcoming .ff-bracket__total {
  color: #999;
  background: #f5f5f6;
}
.ff-bracket__row:last-child { border-bottom: 0; }
.ff-bracket__row img {
  width: 20px; height: 20px;
  object-fit: contain;
  display: block;
}
.ff-bracket__row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ff-bracket__row.is-winner {
  background: #f8faf6;
  color: #1a1a1a;
}
.ff-bracket__row.is-winner span { font-weight: 600; }
.ff-bracket__tie.is-upcoming { background: #fafbfc; border-style: dashed; }
.ff-bracket__meta {
  padding: 5px 10px;
  font-size: .68rem;
  color: var(--ff-muted);
  background: #fafafa;
  border-top: 1px dashed var(--ff-line);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 900px) {
  .ff-bracket { grid-template-columns: repeat(4, 220px); }
}

/* ---------- Group stage (WC/EM) ---------- */
.ff-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) { .ff-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .ff-groups { grid-template-columns: 1fr; } }
.ff-group--league { grid-column: 1 / -1; }
.ff-group--league .ff-group__table { font-size: .9rem; }
.ff-group {
  background: #fff;
  border: 1px solid var(--ff-line);
  border-radius: 10px;
  overflow: hidden;
}
.ff-group__head {
  padding: 9px 12px;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f6f7f9;
  border-bottom: 1px solid var(--ff-line);
  color: #2a3447;
}
.ff-group__table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.ff-group__table th,
.ff-group__table td {
  padding: 6px 7px;
  text-align: right;
  color: #555;
  border-bottom: 1px solid var(--ff-line);
  font-variant-numeric: tabular-nums;
}
.ff-group__table tbody tr:last-child td { border-bottom: 0; }
.ff-group__table th {
  font-size: .68rem;
  font-weight: 700;
  color: var(--ff-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #fafbfc;
}
.ff-group__table { table-layout: fixed; }
.ff-group__pos { width: 24px !important; text-align: center; color: var(--ff-muted); padding-right: 2px !important; padding-left: 4px !important; }
.ff-group__table th, .ff-group__table td { padding: 6px 4px; }
.ff-group__table th:not(:nth-child(1)):not(:nth-child(2)),
.ff-group__table td:not(:nth-child(1)):not(:nth-child(2)) { width: 26px; }
.ff-group__table th.ff-group__team-h { text-align: left; padding-left: 4px; }
.ff-group__team {
  text-align: left !important;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1a1a1a;
  min-width: 0;
  overflow: hidden;
}
.ff-group__team img { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.ff-group__team span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0; font-size: .82rem;
}
.ff-group__pts { color: #1a1a1a; }
.ff-group__table tr.is-advance { background: rgba(10, 125, 44, 0.04); }
.ff-group__table tr.is-advance .ff-group__team span { font-weight: 600; }
.ff-group__table tr.is-advance .ff-group__pts strong { color: #0a7d2c; }

/* ---------- Match detail hero ---------- */
.ff-match-hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 20px 0;
}
.ff-match-hero__team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  opacity: .82;
}
.ff-match-hero__team.is-winner { opacity: 1; }
.ff-match-hero__team img {
  width: 80px; height: 80px;
  object-fit: contain;
  display: block;
}
.ff-match-hero__team h2 {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 700;
  color: #fff;
}
.ff-match-hero__score {
  text-align: center;
  min-width: 140px;
}
.ff-match-hero__main {
  font-size: 3rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  letter-spacing: -.02em;
  line-height: 1;
}
.ff-match-hero__pens {
  font-size: .85rem;
  color: #cbd5e1;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.ff-match-hero__status {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  margin-top: 10px;
}
@media (max-width: 700px) {
  .ff-match-hero { grid-template-columns: 1fr; }
  .ff-match-hero__main { font-size: 2.2rem; }
}

/* ---------- Match list (Recent results / Upcoming) ---------- */
.ff-matchlist {
  background: #fff;
  border: 1px solid var(--ff-line);
  border-radius: 10px;
  overflow: hidden;
}
.ff-matchlist__item {
  padding: 8px 12px;
  border-bottom: 1px solid var(--ff-line);
  font-size: .85rem;
}
.ff-matchlist__item:last-child { border-bottom: 0; }
.ff-matchlist__date {
  color: var(--ff-muted);
  font-size: .7rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ff-matchlist__teams {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ff-matchlist__team {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #555;
}
.ff-matchlist__team img {
  width: 16px; height: 16px;
  object-fit: contain;
  display: block;
}
.ff-matchlist__team span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ff-matchlist__team b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 14px;
  text-align: right;
  color: #222;
}
.ff-matchlist__team.is-winner { color: #1a1a1a; }
.ff-matchlist__team.is-winner span { font-weight: 600; }
.ff-matchlist__team.is-winner b { color: #0a7d2c; }

/* Single-row schedule layout: date | home | score | away on one line */
.ff-matchrow {
  display: grid;
  grid-template-columns: 130px 1fr 80px 1fr;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--ff-line);
  font-size: .9rem;
  color: #444;
  text-decoration: none;
  background: #fff;
}
.ff-matchrow:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
.ff-matchrow:last-child { border-bottom: 0; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
.ff-matchrow:hover { background: #fafbfc; }
.ff-matchrow__date {
  color: var(--ff-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ff-matchrow__home { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-matchrow__away { text-align: left;  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-matchrow__score {
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1a1a1a;
  white-space: nowrap;
}
.ff-matchrow__home.is-winner,
.ff-matchrow__away.is-winner { color: #0a7d2c; font-weight: 600; }
@media (max-width: 640px) {
  .ff-matchrow { grid-template-columns: 90px 1fr 60px 1fr; gap: 8px; font-size: .82rem; padding: 8px 10px; }
  .ff-matchrow__date { font-size: .66rem; }
}

/* ============ Live now widget ============ */
.ff-live-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: #e11d48;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(225, 29, 72, .55);
  animation: ff-live-pulse 1.6s ease-out infinite;
}
@keyframes ff-live-pulse {
  0%   { box-shadow: 0 0 0 0    rgba(225, 29, 72, .6); }
  70%  { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0    rgba(225, 29, 72, 0); }
}
.ff-live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.ff-live-card {
  display: block;
  background: linear-gradient(180deg, #fff 0%, #fff5f5 100%);
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.ff-live-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, .12);
}
.ff-live-card.is-paused {
  background: linear-gradient(180deg, #fff 0%, #fffbeb 100%);
  border-color: #fde68a;
}
.ff-live-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ff-muted);
  margin-bottom: 6px;
}
.ff-live-card__status {
  background: #e11d48;
  color: #fff;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .62rem;
}
.ff-live-card.is-paused .ff-live-card__status {
  background: #d97706;
}
.ff-live-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: .9rem;
}
.ff-live-card__team {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.ff-live-card__row b {
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  color: #111;
  margin-left: 10px;
}

/* ============ Today's matches grid ============ */
.ff-today-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) { .ff-today-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .ff-today-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .ff-today-grid { grid-template-columns: 1fr; } }

/* Global live ticker iframe wrapper */
.ff-livewidget {
  background: #fff; border: 1px solid var(--ff-line); border-radius: 12px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.05);
  margin-bottom: 28px;
}
.ff-livewidget iframe { display: block; width: 100%; border: 0; }

/* Single-match card (replaces grouped-by-league columns) */
.ff-today-card {
  display: block; padding: 12px 14px;
  background: #fff; border: 1px solid var(--ff-line); border-radius: 10px;
  color: var(--ff-fg); text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .12s, box-shadow .15s, border-color .15s;
}
.ff-today-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-color: var(--ff-accent);
  text-decoration: none;
}
.ff-today-card.is-live { border-color: #dc2626; box-shadow: 0 0 0 1px rgba(220,38,38,.25); }
.ff-today-card__head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--ff-line);
  font-size: .7rem;
}
.ff-today-card__comp {
  color: var(--ff-muted); font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0; margin-right: 8px;
}
.ff-today-card__comp:hover { color: var(--ff-accent); }
.ff-today-card__time { color: var(--ff-muted); font-weight: 700; flex-shrink: 0; }
.ff-today-card.is-live .ff-today-card__time { color: #dc2626; }
.ff-today-card__teams { display: flex; flex-direction: column; gap: 4px; }
.ff-today-card__row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .9rem; line-height: 1.3;
}
.ff-today-card__row span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0; margin-right: 8px;
}
.ff-today-card__row b { font-weight: 700; color: var(--ff-muted); }
.ff-today-card__row.is-winner span { font-weight: 700; }
.ff-today-card__row.is-winner b { color: var(--ff-fg); }
.ff-today-col h3 {
  font-size: .82rem;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ff-muted);
}
.ff-today-col h3 a {
  color: inherit;
  text-decoration: none;
}
.ff-today-col h3 a:hover { color: var(--ff-accent); }
.ff-matchlist a.ff-matchlist__item {
  display: block;
  color: inherit;
  text-decoration: none;
}
.ff-matchlist a.ff-matchlist__item:hover {
  background: #f9fafb;
}

/* ============ Career timeline ============ */
.ff-timeline {
  position: relative;
  padding-left: 8px;
}
.ff-timeline::before {
  content: "";
  position: absolute;
  left: 96px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--ff-line);
}
.ff-timeline__row {
  display: grid;
  grid-template-columns: 90px 16px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  position: relative;
}
.ff-timeline__date {
  text-align: right;
  font-size: .8rem;
  color: var(--ff-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-top: 2px;
}
.ff-timeline__dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  margin-top: 4px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px #fff;
}
.ff-timeline__body strong {
  font-size: .95rem;
  display: block;
}
.ff-timeline__detail {
  font-size: .82rem;
  color: var(--ff-muted);
  margin-top: 2px;
}

/* ============ Match: form widget ============ */
.ff-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .ff-form-grid { grid-template-columns: 1fr; }
}
.ff-form-side h3 {
  font-size: .95rem;
  margin: 0 0 10px;
}
.ff-form-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.ff-form-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-weight: 700;
  font-size: .75rem;
  color: #fff;
}
.ff-form-pill--w { background: #16a34a; }
.ff-form-pill--d { background: #6b7280; }
.ff-form-pill--l { background: #dc2626; }
.ff-form-list {
  background: #fff;
  border: 1px solid var(--ff-line);
  border-radius: 8px;
  overflow: hidden;
}
.ff-form-list__row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: .85rem;
  border-bottom: 1px solid var(--ff-line);
  color: inherit;
  text-decoration: none;
}
.ff-form-list__row:last-child { border-bottom: 0; }
.ff-form-list__row:hover { background: #f9fafb; }
.ff-form-list__date {
  color: var(--ff-muted);
  font-size: .72rem;
  text-transform: uppercase;
}
.ff-form-list__opp {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============ Scouting / percentile rows ============ */
.ff-pct-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
}
.ff-pct-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: center;
}
.ff-pct-label strong {
  display: block;
  font-size: .9rem;
}
.ff-pct-label span {
  font-size: .72rem;
  color: var(--ff-muted);
}
.ff-pct-bar {
  position: relative;
  height: 22px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}
.ff-pct-fill {
  height: 100%;
  transition: width .4s ease;
}
.ff-pct-num {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: .8rem;
  font-weight: 700;
  color: #1a1a1a;
}
@media (max-width: 560px) {
  .ff-pct-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ============ H2H summary cards ============ */
.ff-h2h-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.ff-h2h-card {
  background: #fff;
  border: 1px solid var(--ff-line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ff-h2h-card__label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ff-muted);
}
.ff-h2h-card strong {
  font-size: 1.6rem;
  font-weight: 800;
}

/* ============ Team aggregates tiles ============ */
.ff-agg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.ff-agg-tile {
  background: #fff;
  border: 1px solid var(--ff-line);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ff-agg-tile span {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ff-muted);
}
.ff-agg-tile strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a1a1a;
}
.ff-agg-tile small {
  font-size: .75rem;
  color: var(--ff-muted);
}

/* ============ Results grid (round-robin matrix) ============ */
.ff-matrix-wrap {
  overflow-x: auto;
  max-width: 100%;
}
.ff-matrix {
  border-collapse: collapse;
  font-size: .78rem;
}
.ff-matrix th, .ff-matrix td {
  padding: 4px 6px;
  text-align: center;
  border: 1px solid #e5e7eb;
  font-weight: 500;
  white-space: nowrap;
}
.ff-matrix thead th {
  background: #f9fafb;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #555;
}
.ff-matrix tbody th {
  background: #f9fafb;
  font-size: .78rem;
  font-weight: 600;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ff-matrix__self {
  background: #f3f4f6;
  color: #9ca3af;
}
.ff-matrix__empty {
  color: #9ca3af;
}
.ff-matrix__cell a {
  color: inherit;
  text-decoration: none;
  display: block;
}
.ff-matrix__cell.is-win  { background: #dcfce7; color: #14532d; }
.ff-matrix__cell.is-draw { background: #f3f4f6; color: #374151; }
.ff-matrix__cell.is-loss { background: #fee2e2; color: #7f1d1d; }
.ff-matrix__cell:hover { filter: brightness(.95); }

/* =========================================================================
   v4 polish — image quality, denser tables, refined cards, mobile padding
   ========================================================================= */

/* Player & team images — subtle ring + soft shadow, larger thumbs in tables */
.ff-table__player img {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ff-table__player:hover img { transform: scale(1.08); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.ff-table__player strong { font-weight: 600; }

/* Table density: tighter row padding on big leaderboards */
.ff-table th, .ff-table td { padding: 7px 11px; font-size: .85rem; }
.ff-table thead th { padding-top: 9px; padding-bottom: 9px; }

/* Hover row: brand-tinted, not generic blue */
.ff-table tbody tr:hover { background: #f1f5f9; box-shadow: inset 3px 0 0 var(--ff-accent-2); }

/* Numeric columns get tabular-nums always */
.ff-table .num, .ff-table th.num { font-variant-numeric: tabular-nums; text-align: right; }

/* Light page-hero form controls (now matches white hero background) */
.ff-page-hero select,
.ff-page-hero input[type="text"],
.ff-page-hero input[type="search"],
.ff-page-hero input[type="number"] {
  background: #fff;
  color: var(--ff-fg);
  border: 1px solid var(--ff-line);
  padding: 7px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: .88rem;
}
.ff-page-hero select:focus,
.ff-page-hero input:focus { outline: 2px solid var(--ff-accent); outline-offset: 1px; border-color: var(--ff-accent); }

/* Pills in page-hero — light variant */
.ff-page-hero .ff-pill {
  background: var(--ff-bg-soft); color: var(--ff-fg); border-color: var(--ff-line);
  transition: background .15s ease, transform .15s ease;
}
.ff-page-hero .ff-pill:hover { background: var(--ff-accent); color: #fff; border-color: var(--ff-accent); transform: translateY(-1px); text-decoration: none; }

/* Pill on light section */
.ff-section .ff-pill { padding: 5px 12px; font-size: .77rem; transition: background .15s ease; }
.ff-section .ff-pill:hover { background: var(--ff-accent); color: #fff; border-color: var(--ff-accent); text-decoration: none; }

/* ================================================================
   Universal "current view" state for any tab-like nav element.
   Covers pills (.ff-pill--success / --active / is-active / aria-current),
   chips (.ff-chip.is-active), and link buttons elsewhere. Strong contrast
   so the user can see at a glance which tab they're on.
   ================================================================ */
a.ff-pill.is-active,
a.ff-pill.ff-pill--success,
a.ff-pill.ff-pill--active,
a.ff-pill[aria-current="page"],
a.ff-chip.is-active,
a.ff-chip[aria-current="page"],
button.ff-pill.is-active,
button.ff-chip.is-active {
  background: var(--ff-accent) !important;
  color: #fff !important;
  border-color: var(--ff-accent) !important;
  box-shadow: 0 1px 3px rgba(21, 128, 61, .35);
}
a.ff-pill.is-active:hover,
a.ff-pill.ff-pill--success:hover,
a.ff-pill.ff-pill--active:hover,
a.ff-pill[aria-current="page"]:hover,
a.ff-chip.is-active:hover,
a.ff-chip[aria-current="page"]:hover {
  background: var(--ff-accent) !important;
  color: #fff !important;
  transform: none;
  filter: brightness(1.08);
}

/* Sticky tab navigation (records page tabs) refined */
.rb-tab {
  padding: 6px 14px; border-radius: 999px;
  transition: background .15s ease, transform .1s ease, border-color .15s ease;
  font-size: .8rem; font-weight: 600;
}
.rb-tab:hover { transform: translateY(-1px); }
.rb-tab.is-active { background: var(--ff-accent); color: #fff !important; border-color: var(--ff-accent); }

/* "Did you know?" hero stripe */
.ff-hero > .ff-container > div[style*="margin-top:24px"] {
  /* legacy inline-style div, see views/home/index.php */
}

/* Section spacing: reduce on lb/* density-first pages */
.ff-section { padding: 36px 0; }

/* Card grid for game hub + viz world-map */
.ff-feat-grid > a { transition: transform .15s ease, box-shadow .15s ease; }
.ff-feat-grid > a:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(15,23,42,.18); }

/* Buttons in views (form submits) */
button[type="submit"]:not(.rb-tab):not(.ff-hero__search button) {
  cursor: pointer;
  background: var(--ff-accent);
  color: #fff !important;
  border: 1px solid var(--ff-accent);
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  font: inherit; font-size: .9rem;
  transition: background .15s ease, transform .1s ease;
}
button[type="submit"]:hover { background: #0f5f2e; }

/* Mobile padding */
@media (max-width: 720px) {
  :root { --ff-pad-x: 14px; }
  .ff-page-hero h1 { font-size: 1.55rem; }
  .ff-page-hero { padding: 28px 0 24px; }
  .ff-table th, .ff-table td { padding: 6px 8px; font-size: .78rem; }
  .ff-table__player img { width: 24px; height: 24px; }
  .ff-section { padding: 24px 0; }
}

/* Image error fallback (broken image → placeholder) */
.ff-table__player img[src=""], .ff-feat-card img[src=""] {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

/* Bigger images on hero/featured player cards in viz/career-arc + viz/world-map */
.ff-viz-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }

/* Highlight numeric "value" cells subtly */
.ff-table td strong { color: var(--ff-text); }

/* Sortable header chevron position polish */
.ff-th-sortable { padding-right: 22px; position: relative; }
.ff-th-sortable::after { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

/* Page hero CTA chip row spacing */
.ff-page-hero nav, .ff-page-hero form { gap: 6px; }
.ff-page-hero nav.rb-tabs { gap: 4px; }

/* Tab chips inside page hero (shirt/N, decade/Y, awards filter, AZ index) */
.ff-page-hero .ff-chip,
.ff-page-hero a[href][style*="border-radius:6px"][style*="padding:6px"] {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--ff-line);
  background: #fff;
  color: var(--ff-text) !important;
  font-weight: 700;
  font-size: .82rem;
  text-decoration: none;
  transition: all .15s ease;
}
.ff-page-hero a[href][style*="border-radius:6px"][style*="padding:6px"]:hover { background: var(--ff-bg-soft); color: var(--ff-accent) !important; border-color: var(--ff-line-2); }
.ff-page-hero a[href][style*="background:#1f2937"] {
  background: var(--ff-accent-2) !important;
  border-color: var(--ff-accent-2);
  color: #fff !important;
}

/* Empty state polish */
.ff-section p[style*="color:var(--ff-muted)"] { padding: 24px 0; font-size: .95rem; }

/* Proper tab chip class for shirt/decade/awards/league filters */
.ff-chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--ff-line);
  background: #fff;
  color: var(--ff-text) !important;
  font-weight: 700;
  font-size: .82rem;
  text-decoration: none;
  transition: all .15s ease;
}
.ff-chip:hover { background: var(--ff-bg-soft); color: var(--ff-accent) !important; border-color: var(--ff-line-2); transform: translateY(-1px); text-decoration: none; }
.ff-chip.is-active {
  background: var(--ff-accent-2) !important;
  border-color: var(--ff-accent-2);
  color: #fff !important;
}
.ff-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* Logo-with-name cell — used by teamCell() */
.ff-table img[loading="lazy"][style*="width:18px"] { background: #fff; }

/* Player image hover on cards */
.ff-card { transition: transform .15s ease, box-shadow .15s ease; }
.ff-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,.12); }

/* "More on this player" cross-link cards */
section .ff-card a:hover { text-decoration: none; }

/* CSV / pill in body sections */
.ff-section .ff-pill[href*="/csv/"] {
  background: #f3f4f6;
  color: #15803d;
  border-color: #d1d5db;
  font-size: .72rem;
  padding: 3px 10px;
}
.ff-section .ff-pill[href*="/csv/"]:hover {
  background: var(--ff-accent);
  color: #fff;
}

/* Polish "Did you know?" stripe on home page */
.ff-hero > .ff-container > div[style*="margin-top:24px"] {
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
}
.ff-hero > .ff-container > div[style*="margin-top:24px"] strong { font-family: 'Sora', sans-serif; }

/* Subtle table caption / sub-info */
.ff-section .ff-container > p[style*="color:#9ca3af;font-size:.9rem"] {
  color: var(--ff-muted) !important;
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}


/* ============ A11y: skip-to-content link ============ */
.ff-skip-link{position:absolute;left:8px;top:-40px;background:#15803d;color:#fff;padding:8px 14px;border-radius:6px;text-decoration:none;font-weight:600;z-index:9999;transition:top .15s}
.ff-skip-link:focus{top:8px;outline:2px solid #fbbf24;outline-offset:2px}
