/* Terra Soccer — "Pitchside Studio".
   Clean, modern, airy: white surfaces, hairline borders, soft layered
   shadows, pill controls, one confident pitch-green accent. */

:root {
  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #f2f4f0;
  --ink: #101913;
  --ink-soft: #4b564f;
  --ink-faint: #8b958e;
  --line: #e7e9e3;
  --line-strong: #d8dbd3;
  --green: #0fa958;
  --green-deep: #0a7c42;
  --green-tint: #e9f7ef;
  --terra: #e0613c;
  --win: #12b76a;
  --draw: #eab308;
  --loss: #ef4444;
  --display: "Schibsted Grotesk", "Hanken Grotesk", sans-serif;
  --body: "Hanken Grotesk", "Helvetica Neue", sans-serif;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 25, 19, 0.05);
  --shadow-md: 0 1px 2px rgba(16, 25, 19, 0.04), 0 10px 28px -12px rgba(16, 25, 19, 0.16);
}

/* Chinese: the brand fonts have no CJK glyphs — keep them first so Latin
   text and numerals stay on-brand, with Noto Sans SC catching the hanzi. */
html[lang="zh"] {
  --display: "Schibsted Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Hanken Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
::selection { background: var(--green); color: #fff; }

/* ---------- header ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.9rem clamp(1.25rem, 4vw, 3rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; }

.brand-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-name em { font-style: normal; color: var(--green-deep); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem clamp(0.2rem, 1vw, 0.5rem);
}

.site-nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--ink-soft);
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover { background: var(--surface-2); color: var(--ink); }

.lang-select {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  margin-left: 0.4rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}

.lang-select:hover { border-color: var(--ink-faint); }

/* ---------- live wire ---------- */

.ticker {
  display: flex;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.ticker-label {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 1rem 0.32rem clamp(1.25rem, 4vw, 3rem);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-deep);
}

.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: live-pulse 1.8s ease-in-out infinite;
}

.ticker-viewport { overflow: hidden; flex: 1; }

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker-roll 70s linear infinite;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-roll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker-item {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.32rem 0;
  font-variant-numeric: tabular-nums;
}

.ticker-item::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); margin: 0 1.4rem; vertical-align: 2px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 4rem;
  padding: 1.6rem clamp(1.25rem, 4vw, 3rem);
  color: var(--ink-faint);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer p { margin: 0.25rem 0; }
.footer-meta b { color: var(--ink-soft); font-weight: 700; }
.footer-meta a { color: var(--ink-soft); text-decoration: none; }
.footer-meta a:hover { color: var(--green-deep); text-decoration: underline; }

.footer-logo { display: inline-block; margin-top: 1.1rem; }

.footer-logo img {
  height: 84px;
  transition: transform 0.18s;
}

.footer-logo:hover img { transform: scale(1.05); }

main { padding: 0 clamp(1.25rem, 4vw, 3rem); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  max-width: 920px;
  padding: clamp(2rem, 5vw, 3.6rem) 0 clamp(1.25rem, 2.5vw, 2rem);
}

.hero--compact { padding-bottom: 0.75rem; }

.hero--home {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
}

.hero-visual { position: relative; display: flex; justify-content: center; }

/* the render is cut to true alpha; glow + grounding live here in CSS so
   they blend with whatever sits behind the ball */
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 8% 14%;
  background: radial-gradient(closest-side, rgba(15, 169, 88, 0.16), transparent 72%);
  pointer-events: none;
}

.hero-visual img {
  position: relative;
  width: min(100%, 460px);
  filter: drop-shadow(0 26px 26px rgba(16, 25, 19, 0.16));
  animation: float-in 0.9s cubic-bezier(0.22, 0.8, 0.3, 1) backwards, hover-float 7s ease-in-out 1s infinite;
}

@keyframes float-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes hover-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (max-width: 980px) {
  .hero--home { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { display: none; }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1.1rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--green-deep);
  background: var(--green-tint);
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
}

.hero h1, .team-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero h1 em { font-style: normal; color: var(--green-deep); }

.hero-sub {
  margin: 1.2rem 0 0;
  max-width: 33rem;
  font-size: 1.04rem;
  color: var(--ink-soft);
}

.hero-sub a { color: var(--green-deep); font-weight: 600; }

/* ---------- landing layout ---------- */

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 30vw, 420px);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
  padding-bottom: 2rem;
}

@media (max-width: 980px) {
  .landing-grid { grid-template-columns: minmax(0, 1fr); }
  .table-pane { position: static; }
  .table-card { max-height: 70vh; }
}

/* ---------- cards pane ---------- */

.cards-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.2rem;
}

.cards-search {
  flex: 1 1 220px;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.6rem 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cards-search::placeholder { color: var(--ink-faint); }
.cards-search:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15, 169, 88, 0.16); }

.conf-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; background: var(--surface-2); padding: 0.25rem; border-radius: 999px; }

.chip {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.34rem 0.7rem;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover { color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }

.cards-empty { color: var(--ink-soft); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 1rem;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.team-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.1rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  animation: card-rise 0.45s cubic-bezier(0.22, 0.8, 0.3, 1) backwards;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.team-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-top-right { display: flex; align-items: center; gap: 0.45rem; }
.card-flag { font-size: 1.9rem; line-height: 1; }

.card-code {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  background: var(--surface-2);
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

.follow-star {
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--line-strong);
  transition: color 0.15s, transform 0.15s;
}

.follow-star:hover { color: var(--green); transform: scale(1.2); }
.follow-star.on { color: var(--green); }

.card-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.22rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.card-blurb {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* star player + in-form top performer — identical row style for consistency */
.card-perf { display: flex; align-items: center; gap: 0.55rem; margin-top: 0.5rem; }
.card-perf + .card-perf { padding-top: 0.5rem; border-top: 1px dashed var(--line); }

.perf-photo {
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--green-tint);
  background: var(--surface-2);
}

.perf-monogram {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--green-deep);
}

.perf-label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green-deep);
}
.perf-label strong { font-size: 0.86rem; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.perf-points { display: flex; flex-direction: column; align-items: center; margin-left: auto; font-size: 0.62rem; font-weight: 600; color: var(--ink-faint); }
.perf-points b { font-size: 0.98rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--green-deep); }

.card-record {
  display: flex;
  gap: 0.9rem;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
}

.record-cell { display: flex; flex-direction: column; font-size: 0.62rem; font-weight: 600; color: var(--ink-faint); }
.record-cell b { font-size: 0.98rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.record-pts { margin-left: auto; }
.record-pts b { color: var(--green-deep); font-weight: 800; }

.host-pill {
  align-self: center;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-deep);
  background: var(--green-tint);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

/* ---------- league table ---------- */

.table-pane { position: sticky; top: 1.25rem; }

.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2.5rem);
}

.table-head { padding: 1rem 1.2rem 0.8rem; border-bottom: 1px solid var(--line); }

.table-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.table-head p { margin: 0.2rem 0 0; font-size: 0.72rem; color: var(--ink-faint); }

.league-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  display: block;
  overflow-y: auto;
}

.league-table thead, .league-table tbody { display: table; width: 100%; table-layout: fixed; }

.league-table thead {
  position: sticky;
  top: 0;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
  z-index: 1;
}

.league-table th {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
  padding: 0.55rem 0.45rem;
}

.league-table td {
  padding: 0.5rem 0.45rem;
  text-align: right;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}

.league-table th, .league-table td { width: 11%; }
.league-table .col-pos { width: 9%; text-align: center; }
.league-table th.col-team, .league-table td.col-team { width: 36%; text-align: left; }
.league-table .col-pts { width: 12%; padding-right: 1rem; }

.league-table td.col-pos { font-weight: 700; color: var(--ink-faint); }

.league-table td.col-team a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.league-table td.col-team a:hover { color: var(--green-deep); }
.row-flag { font-size: 1rem; flex: none; }
.league-table td.col-pts { font-weight: 800; color: var(--ink); }

/* leader */
.league-table tbody tr:first-child td { background: var(--green-tint); border-top-color: transparent; }
.league-table tbody tr:first-child td.col-pos { color: var(--green-deep); }
.league-table tbody tr:first-child td.col-pts { color: var(--green-deep); }

/* followed / own team */
.league-table tr.is-highlighted td,
.league-table tr.is-followed td { background: #fdf3ef; color: var(--ink); }

.league-table tr.is-highlighted td:first-child,
.league-table tr.is-followed td:first-child { box-shadow: inset 3px 0 0 var(--terra); }

.league-table tr.is-highlighted td.col-team a,
.league-table tr.is-followed td.col-team a { font-weight: 800; }

/* ---------- section titles ---------- */

.stat-section-title, .squad-title {
  margin: 2.1rem 0 0.7rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.stat-section-note { margin: 0.2rem 0 0.9rem; font-size: 0.84rem; color: var(--ink-faint); }

/* ---------- team detail ---------- */

.team-hero {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(2rem, 5vw, 3.2rem) 0 1.25rem;
}

.team-hero-flag { font-size: clamp(3.2rem, 7vw, 5rem); line-height: 1; }

.team-facts { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.25rem; }

.fact {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  min-width: 200px;
  max-width: 100%;
}

.fact--person { flex-direction: row; align-items: center; gap: 0.8rem; }
.fact--person > div { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }

.fact-photo {
  flex: none;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--surface-2);
  background: var(--surface-2);
}

.fact-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-deep);
}

.fact-value { font-weight: 700; }
.fact-bio { font-size: 0.78rem; color: var(--ink-faint); max-width: 24rem; }

.follow-btn, .pick-btn {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 1.1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.follow-btn { margin-top: 1rem; }
.pick-btn { margin-top: 0.8rem; }

.follow-btn:hover, .pick-btn:hover { border-color: var(--green); color: var(--green-deep); }

.follow-btn.on, .pick-btn.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* matches & qualifying */
.team-matches { margin-top: 2.1rem; }

.team-match-list {
  display: flex;
  flex-direction: column;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.team-match {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.12s;
}

.team-match:first-child { border-top: none; }
a.team-match:hover { background: var(--surface-2); }
.team-match--static { cursor: default; }

.tm-stage { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.tm-opp { font-weight: 600; }
.tm-opp small { color: var(--ink-faint); margin-right: 0.2rem; }

.tm-result { display: flex; align-items: center; gap: 0.45rem; font-variant-numeric: tabular-nums; font-size: 0.9rem; font-weight: 700; color: var(--ink); }

.tm-letter {
  width: 1.35rem;
  height: 1.35rem;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 800;
  color: #fff;
  border-radius: 7px;
}

.tm-W { background: var(--win); }
.tm-D { background: var(--draw); }
.tm-L { background: var(--loss); }

.qual-details summary {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 0.4rem 0;
  margin-bottom: 0.5rem;
}

.qual-details summary:hover { color: var(--green-deep); }
.qual-details .team-match-list { margin-top: 0.25rem; }

/* community picks */
.community { margin-top: 2.1rem; }

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 560px;
}

.community-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.2rem 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.community-rank {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.3rem;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}

.community-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.community-count { font-size: 0.92rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.community-count b { color: var(--ink); font-weight: 800; }

.pick-status { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--terra); }

.modal-link {
  margin-top: 1rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--green-deep);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.modal-link:hover { text-decoration: underline; }

/* squad */
.squad { margin-top: 2.1rem; }

.squad-group {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.squad-table, .stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-table { max-width: 720px; }

.squad-table th, .stat-table th {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.squad-table td, .stat-table td {
  padding: 0.48rem 0.8rem;
  text-align: right;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
}

.squad-table tr:first-child td, .stat-table tr:first-child td { border-top: none; }

/* Fixed column widths so the four position tables line up: No. and the
   numeric columns are constant, Club is capped, Player takes the rest. */
.squad-table { table-layout: fixed; }
.squad-table .col-no { width: 3rem; text-align: center; }
.squad-table th.col-caps, .squad-table th.col-goals { width: 4.2rem; }
.squad-table th.col-club { width: 30%; }
.squad-table td.col-player, .squad-table td.col-club {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 560px) {
  .squad-table th, .squad-table td { padding-left: 0.45rem; padding-right: 0.45rem; }
  .squad-table .col-no { width: 2rem; }
  .squad-table th.col-caps, .squad-table th.col-goals { width: 2.9rem; }
  .squad-table th.col-club { width: 27%; }
  .squad-table td.col-player { white-space: normal; }  /* names wrap, never truncate */
}
.squad-table th.col-player, .squad-table td.col-player,
.squad-table th.col-club, .squad-table td.col-club,
.stat-table th.col-name, .stat-table td.col-name { text-align: left; }

.squad-table td.col-player, .stat-table td.col-name { font-weight: 600; color: var(--ink); }
.stat-table td.col-name a { text-decoration: none; }
.stat-table td.col-name a:hover { color: var(--green-deep); }

.stat-table .col-rank { width: 3rem; text-align: center; font-weight: 700; color: var(--ink-faint); }

.squad-table tr.is-star td { background: var(--green-tint); }
.squad-table tr.is-star td.col-player::after { content: "★"; margin-left: 0.4rem; color: var(--green); font-size: 0.8em; }

.stat-table tr.is-followed td { background: #fdf3ef; }
.stat-table tr.is-followed td:first-child { box-shadow: inset 3px 0 0 var(--terra); }

.coming-soon {
  margin-top: 2.2rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-size: 0.9rem;
  max-width: 44rem;
}

.coming-soon code { background: var(--surface-2); padding: 0.12rem 0.4rem; border-radius: 6px; font-size: 0.85em; }

/* ---------- community analytics ---------- */
.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(1rem, 3vw, 1.8rem);
  padding-bottom: 2rem;
}

.community-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem 1.2rem 1.3rem;
}

.community-board { list-style: none; margin: 0.6rem 0 0; padding: 0; }

.community-board li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) 4.5rem auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.4rem;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
}

.cb-rank { text-align: center; font-weight: 700; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.cb-team { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cb-bar { height: 7px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cb-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; }

.cb-count { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--green-deep); }

.community-board li.is-followed { background: #fdf3ef; box-shadow: inset 3px 0 0 var(--terra); }

/* player star rating widget */
.player-rating { margin-top: 0.7rem; }
.stars { display: inline-flex; gap: 0.1rem; }
.star {
  background: none;
  border: none;
  padding: 0 0.05rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--line-strong);
  transition: color 0.1s, transform 0.1s;
}
.star:hover { transform: scale(1.12); }
.star.on { color: var(--draw); }  /* gold */
.star:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

.rating-summary { margin: 0.25rem 0 0; font-size: 0.82rem; color: var(--ink-faint); }
.rating-summary b { font-size: 1rem; color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.rating-of { color: var(--ink-faint); }
.rating-mine { color: var(--green-deep); font-weight: 600; }

/* top-rated players board (stars instead of a bar) */
.community-rated { margin-top: 1.4rem; }
.community-rated .community-board li { grid-template-columns: 1.6rem minmax(0, 1fr) auto; }
.cb-stars { color: var(--draw); letter-spacing: -1px; white-space: nowrap; font-size: 0.92rem; }
.cb-stars small { color: var(--ink-faint); margin-left: 0.4rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.cb-team a { text-decoration: none; color: inherit; }
.cb-team a:hover { color: var(--green-deep); }

/* ---------- modal ---------- */

.modal {
  margin: auto;
  width: min(620px, calc(100vw - 2rem));
  max-height: min(78vh, 640px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px -16px rgba(16, 25, 19, 0.25);
}

.modal::backdrop { background: rgba(16, 25, 19, 0.4); backdrop-filter: blur(3px); }
.modal[open] { animation: card-rise 0.22s cubic-bezier(0.22, 0.8, 0.3, 1); }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }

.modal-close {
  font: inherit;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.modal-close:hover { background: var(--ink); color: #fff; }

.boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem 1.4rem;
  overflow-y: auto;
  max-height: calc(min(78vh, 640px) - 4.5rem);
}

@media (max-width: 560px) { .boards { grid-template-columns: minmax(0, 1fr); } }

.board { margin: 0; padding: 0; list-style: none; counter-reset: board; font-variant-numeric: tabular-nums; }

.board li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.88rem;
  border-top: 1px solid var(--line);
}

.board li:first-child { border-top: none; }

.board li::before {
  counter-increment: board;
  content: counter(board);
  min-width: 1.5rem;
  font-weight: 700;
  color: var(--ink-faint);
  font-size: 0.78rem;
}

.board li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li b { color: var(--ink); font-weight: 800; }
.board-empty { color: var(--ink-faint); }
.board-empty::before { content: none !important; }

a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- statistics & fixtures ---------- */

.stat-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0.5rem 0 1.8rem;
  background: var(--surface-2);
  padding: 0.25rem;
  border-radius: 999px;
}

.stat-tabs a {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 1.05rem;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: all 0.15s;
}

.stat-tabs a:hover { color: var(--ink); }
.stat-tabs a.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.fixture-day {
  margin: 1.6rem 0 0.5rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.fixture-list { display: flex; flex-direction: column; gap: 0.6rem; max-width: 720px; }

.fixture {
  display: grid;
  /* minmax(0,…) lets long team names wrap instead of widening the card */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 0.8rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.fixture.is-followed { box-shadow: inset 3px 0 0 var(--terra), var(--shadow-sm); }

.fixture-team { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; min-width: 0; }
.fixture-home { justify-content: flex-end; text-align: right; }
.fixture-team a { text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.fixture-team a:hover { color: var(--green-deep); }
.fixture-flag { font-size: 1.25rem; }

.fixture-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 5.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.fixture-score { font-family: var(--display); font-weight: 800; font-size: 1.25rem; color: var(--ink); }

.fixture-meta {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-faint);
}

.fixture-link { color: var(--green-deep); font-weight: 600; text-decoration: none; }
.fixture-link:hover { text-decoration: underline; }

.followed-fixtures {
  padding: 1rem 1.2rem 1.2rem;
  background: var(--green-tint);
  border: 1px solid #cdebd9;
  border-radius: var(--r-lg);
  max-width: 720px;
}

.followed-fixtures .stat-section-title { margin-top: 0; }

/* ---------- fixture dashboard ---------- */

.fixture-hero { padding: clamp(2rem, 4.5vw, 3rem) 0 1rem; text-align: center; }
.fixture-hero .hero-kicker { margin-bottom: 1.25rem; }

.fixture-hero-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  max-width: 760px;
  margin: 0 auto;
}

.fixture-hero-team { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-decoration: none; }
.fixture-hero-flag { font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; }

.fixture-hero-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  letter-spacing: -0.02em;
}

.fixture-hero-center { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.fixture-hero-score { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.1rem); letter-spacing: -0.02em; color: var(--ink); }
.fixture-hero-vs { font-weight: 600; font-size: 1.2rem; color: var(--ink-faint); }

.hashtag-chip {
  display: inline-block;
  margin-top: 1.1rem;
  font-weight: 700;
  font-size: 0.84rem;
  padding: 0.45rem 1.1rem;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s, transform 0.15s;
}

.hashtag-chip:hover { background: var(--green-deep); transform: translateY(-1px); }

.fixture-scorers { margin: 0.7rem auto 0; max-width: 560px; font-size: 0.85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.live-badge {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--terra);
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  animation: live-pulse 1.6s ease-in-out infinite;
}

.dashboard { max-width: 1040px; margin: 1.5rem auto 0; }

.dash-headline-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.dash-headline-row .dash-headline { margin-bottom: 0; }

.motm-badge {
  flex: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.motm-badge-photo { display: block; line-height: 0; }

.motm-badge img, .motm-mono {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--green);
  box-shadow: var(--shadow-sm);
  background: var(--surface-2);
}

.motm-mono {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--green-deep);
}

.motm-badge figcaption {
  display: flex;
  flex-direction: column;
  margin-top: 0.45rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  max-width: 9rem;
}

.motm-badge figcaption strong {
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.motm-standalone { display: flex; justify-content: center; margin: 1.5rem 0; }

@media (max-width: 640px) {
  .dash-headline-row { flex-direction: column-reverse; align-items: center; }
}

/* MOTM leaderboard (right rail of /statistics/fixtures) */
.fixtures-pane { min-width: 0; }
.landing-grid--wide { grid-template-columns: minmax(0, 1fr) clamp(480px, 46vw, 700px); }

/* who's-here pill in the home hero */
.hero-presence {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1rem 0 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--green-deep);
  font-size: 0.8rem;
  font-weight: 600;
}

.hero-presence b { font-weight: 800; font-variant-numeric: tabular-nums; }

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: presence-pulse 1.6s ease-in-out infinite;
}

@keyframes presence-pulse {
  50% { opacity: 0.35; transform: scale(0.75); }
}
.landing-grid--wide > .table-pane { min-width: 0; }

.motm-scroll { overflow-x: auto; }

.motm-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.motm-table th {
  padding: 0.55rem 0.55rem 0.4rem;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.motm-table td {
  padding: 0.45rem 0.55rem;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

th.motm-rank, td.motm-rank { width: 1.8rem; text-align: center; font-weight: 700; color: var(--ink-faint); padding-left: 0.8rem; }

.motm-photo-cell { width: 38px; padding-right: 0; }

.motm-photo {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid var(--green-tint);
  background: var(--surface-2);
}

.motm-photo--mono {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--green-deep);
}

td.motm-name { font-weight: 600; max-width: 0; min-width: 7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.motm-country { white-space: nowrap; color: var(--ink-soft); }
td.motm-club { color: var(--ink-soft); font-size: 0.8rem; max-width: 0; min-width: 5.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pott-table { min-width: 620px; }
.pott-table td.pott-bad { color: var(--terra); font-weight: 700; }
.pott-table th.num { text-align: right; width: 2.2rem; }
.pott-table td.num { text-align: right; color: var(--ink-soft); }
.pott-table th:nth-child(11) { width: 3.2rem; }  /* MOTM header needs the extra room */

.pott-table td.motm-name small {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pott-legend {
  margin: 0;
  padding: 0.7rem 0.9rem 0.85rem;
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

.pott-legend b { color: var(--ink-soft); }

th.motm-count, td.motm-count { text-align: right; padding-right: 0.9rem; }
td.motm-count { font-weight: 800; color: var(--green-deep); font-size: 1rem; }

.motm-empty { padding: 1rem 1.2rem; margin: 0; font-size: 0.85rem; color: var(--ink-faint); }

.motm-table tr.is-followed td { background: #fdf3ef; }
.motm-table tr.is-followed td:first-child { box-shadow: inset 3px 0 0 var(--terra); }

@media (max-width: 980px) {
  .landing-grid--wide { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  /* let kickoff times wrap so team names keep room to breathe */
  .fixture { gap: 0.25rem 0.6rem; }
  .fixture-center { min-width: 4.5rem; max-width: 6rem; text-align: center; }
}

.dash-headline {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  max-width: 46rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 32vw, 380px);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
}

.dash-para { max-width: 40rem; color: var(--ink-soft); }
.dash-para:first-of-type { color: var(--ink); font-size: 1.05rem; }

.dash-players {
  display: flex;
  flex-direction: column;
  max-width: 40rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dash-player { display: flex; gap: 0.75rem; padding: 0.8rem 1rem; border-top: 1px solid var(--line); }
.dash-player:first-child { border-top: none; }
.dash-player-flag { font-size: 1.4rem; }
.dash-player b { font-weight: 700; }
.dash-player p { margin: 0.15rem 0 0; font-size: 0.86rem; color: var(--ink-soft); }

.dash-facts { max-width: 40rem; margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.55rem; color: var(--ink-soft); }
.dash-facts li::marker { color: var(--green); }

.dash-charts { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 1.25rem; }

.dash-chart-card {
  padding: 1.05rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.dash-chart-card h3 { margin: 0 0 0.2rem; font-family: var(--display); font-weight: 800; font-size: 0.95rem; letter-spacing: -0.01em; }
.dash-chart-card svg { display: block; }

.form-row { display: flex; align-items: center; gap: 0.45rem; margin-top: 0.6rem; }
.form-row b { width: 2.6rem; font-size: 0.76rem; font-weight: 700; }

.form-chip {
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  border-radius: 7px;
}

.form-bar { flex: 1; height: 0.6rem; border-radius: 999px; }
.form-row small { font-size: 0.7rem; color: var(--ink-faint); white-space: nowrap; }

.dash-meta { font-size: 0.72rem; color: var(--ink-faint); margin: 0; }

/* post-match facts card */
.mstat-teams {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.mstat-row {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr) 3.6rem;
  gap: 0.6rem;
  align-items: center;
  padding: 0.32rem 0;
  border-top: 1px solid var(--line);
}

.mstat-val { font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.mstat-val:last-child { text-align: right; }

.mstat-mid { display: flex; flex-direction: column; gap: 0.22rem; min-width: 0; }

.mstat-label {
  text-align: center;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mstat-bars {
  display: flex;
  gap: 2px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
}

.mstat-bars i { border-radius: 999px; }
.mstat-bar-home { background: var(--ink); }
.mstat-bar-away { background: var(--green); }

.mstat-duration {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.mstats-standalone { max-width: 460px; margin: 1.5rem auto; display: flex; flex-direction: column; gap: 1rem; }

.radar-chart svg { width: 100%; height: auto; display: block; }

/* team Form strip — one radar card per played match, most recent first */
.team-form { margin-top: 2.1rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  max-width: 760px;
}

.form-card {
  margin: 0;
  padding: 0.6rem 0.6rem 0.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.form-cap { font-size: 0.8rem; font-weight: 600; }
.form-cap a { display: flex; align-items: center; gap: 0.4rem; text-decoration: none; color: var(--ink); }
.form-cap a:hover .form-score { color: var(--green-deep); }
.form-cap small { color: var(--ink-faint); }
.form-cap .tm-letter { margin-left: auto; }
.form-score { font-variant-numeric: tabular-nums; font-weight: 700; }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .dash-charts { position: static; }
}

/* ---------- groups ---------- */

.groups-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

@media (max-width: 1200px) { .groups-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .groups-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .groups-grid { grid-template-columns: minmax(0, 1fr); } }

.group-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
}

.group-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.group-title {
  margin: 0;
  padding: 0.7rem 1rem 0.55rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.group-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  table-layout: fixed;
}

.group-table th {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: right;
  padding: 0.42rem 0.55rem;
}

.group-table td { padding: 0.42rem 0.55rem; text-align: right; color: var(--ink-soft); border-top: 1px solid var(--line); }

.group-table th, .group-table td { width: 14%; }
.group-table .col-pos { width: 11%; text-align: center; }
.group-table th.col-team, .group-table td.col-team { width: 47%; text-align: left; }

.group-table td.col-pos { font-weight: 700; color: var(--ink-faint); }

.group-table td.col-team a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-table td.col-team a:hover { color: var(--green-deep); }
.group-table td.col-pts { font-weight: 800; color: var(--ink); }

.group-table tbody tr:first-child td { background: var(--green-tint); border-top-color: transparent; }
.group-table tbody tr:first-child td.col-pos { color: var(--green-deep); }

.group-table tr.is-followed td { background: #fdf3ef; }
.group-table tr.is-followed td:first-child { box-shadow: inset 3px 0 0 var(--terra); }

/* ---------- knockout & prediction ---------- */

.fixture--tbd { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.tbd-label { font-size: 0.85rem; color: var(--ink-faint); }

.bracket-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(270px, 25vw, 330px);
  gap: 1.5rem;
  align-items: start;
  padding-bottom: 2rem;
}

.bracket-grid > .fixture-list, .bracket-grid > .coming-soon { order: 1; }
.bracket-grid > #bracket-panel { order: 2; position: sticky; top: 1.25rem; }

@media (max-width: 900px) {
  .bracket-grid { grid-template-columns: minmax(0, 1fr); }
  .bracket-grid > #bracket-panel { order: 0; position: static; }
}

.mode-toggle { display: inline-flex; gap: 0.25rem; background: var(--surface-2); padding: 0.25rem; border-radius: 999px; margin-bottom: 0.9rem; }

.mode-toggle button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.42rem 1rem;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.mode-toggle button.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }

.predict-panel {
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.predict-panel h2 { margin: 0 0 0.75rem; font-family: var(--display); font-weight: 800; font-size: 1.1rem; letter-spacing: -0.01em; }

.predict-slot { margin-bottom: 0.9rem; }

.predict-slot label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.3rem;
}

.predict-slot select {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 0.7rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
}

.predict-slot select:focus { border-color: var(--green); }
.predict-slot small { color: var(--terra); font-size: 0.75rem; }

.predict-clear {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--terra);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.predict-clear:hover { text-decoration: underline; }

.predict-clear--all {
  display: block;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  width: 100%;
  text-align: left;
  color: var(--ink-faint);
}

.predict-clear--all:hover { color: var(--terra); }

.predict-hint { margin: 0; font-size: 0.85rem; color: var(--ink-soft); }

.fixture--tbd.is-predictable { cursor: pointer; }
.fixture--tbd.is-predictable:hover { border-color: var(--green); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.fixture--tbd.is-editing { border-style: solid; border-color: var(--green); box-shadow: 0 0 0 3px rgba(15, 169, 88, 0.15); }

.predicted-team {
  font-weight: 700;
  color: var(--green-deep);
}

/* ---------- analytics dashboard ---------- */

.ana-tabs {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0.5rem 0 1.6rem;
  background: var(--surface-2);
  padding: 0.25rem;
  border-radius: 999px;
}

.ana-tab {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 1.1rem;
  color: var(--ink-soft);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}

.ana-tab:hover { color: var(--ink); }
.ana-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

.tile b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.tile span { font-size: 0.72rem; font-weight: 600; color: var(--ink-faint); }
.tile--text b { font-size: 1.05rem; line-height: 1.25; }

/* squad name links + player profile page */
.player-link { text-decoration: none; }
.player-link:hover { color: var(--green-deep); text-decoration: underline; }

.player-hero {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.8rem);
  max-width: 920px;
  padding: clamp(1.5rem, 4vw, 2.6rem) 0 1rem;
}

.player-photo {
  flex: none;
  width: clamp(84px, 14vw, 120px);
  height: clamp(84px, 14vw, 120px);
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--green-tint);
  background: var(--surface-2);
}

.player-photo--mono {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--green-deep);
}

.player-headings h1 { margin: 0.1rem 0; }
.player-team { margin: 0; font-weight: 600; }
.player-team a { text-decoration: none; }
.player-team a:hover { color: var(--green-deep); }

.player-pts {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.player-pts-total {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 1.6rem;
  min-width: 8rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-md);
}

.player-pts-total b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 2.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.player-pts-total span { font-size: 0.74rem; color: rgba(255, 255, 255, 0.65); margin-top: 0.3rem; }

.player-pts-grid {
  flex: 1 1 22rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.player-pts-grid li {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.player-pts-grid li b { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.player-pts-grid li span { font-size: 0.66rem; font-weight: 600; color: var(--ink-faint); }
.player-pts-grid li.is-bad b { color: var(--terra); }

.career-table { table-layout: auto; max-width: 640px; }
.career-table .col-years { width: 8rem; text-align: left; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.career-table tfoot td { border-top: 2px solid var(--line-strong); font-weight: 800; color: var(--ink); }
.career-loan {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.player-match { grid-template-columns: minmax(0, 1fr) auto auto; }

.player-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; justify-content: flex-end; }

.chip-stat {
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.12rem 0.42rem;
  border-radius: 999px;
  white-space: nowrap;
}

.chip-goal { background: var(--green-tint); color: var(--green-deep); }
.chip-assist { background: #eef4ff; color: #2456b8; }
.chip-motm { background: #fff4d6; color: #9a6b00; }
.chip-yellow { background: #fbf2c8; color: #8a6d00; }
.chip-red { background: #fde2e0; color: #c0341d; }
.chip-played { color: var(--ink-faint); font-size: 0.72rem; }

/* fun-fact cards (analytics field pane) */
.funfact-title {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.funfact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

/* inverted: near-black cards, white text, yellow standing in for green */
.funfact {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.15rem;
  background: var(--ink);
  color: #fff;
  border: 1px solid #2a352e;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
}

.funfact-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--draw);
}

.funfact-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.9rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

.funfact-value small {
  margin-left: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.55);
}

.funfact-person { display: flex; align-items: center; gap: 0.55rem; margin-top: auto; }

.funfact-photo {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 2px solid rgba(234, 179, 8, 0.55);
  background: #243029;
}

.funfact-photo--mono {
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--draw);
}

.funfact-who { display: flex; flex-direction: column; font-weight: 700; font-size: 0.88rem; min-width: 0; }
.funfact-who small { font-size: 0.72rem; font-weight: 500; color: rgba(255, 255, 255, 0.55); }

.funfact-extra { font-size: 0.74rem; color: rgba(255, 255, 255, 0.7); }

.ana-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 2rem;
}

.ana-card {
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.ana-card--wide { grid-column: 1 / -1; }

.ana-card h3 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.ana-note { margin: 0 0 0.7rem; font-size: 0.78rem; color: var(--ink-faint); }
.ana-note [data-map-filter] { color: var(--green-deep); font-weight: 700; }

.ana-subtitle {
  margin: 1.6rem 0 0.9rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.ana-subtitle span { font-family: var(--body); font-weight: 600; font-size: 0.78rem; color: var(--ink-faint); }

.gx-compare { display: flex; gap: 0.8rem; }
.gx-cell { flex: 1; display: flex; flex-direction: column; padding: 0.7rem 0.9rem; background: var(--surface-2); border-radius: var(--r-sm); }
.gx-cell b { font-family: var(--display); font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.gx-cell span { font-size: 0.68rem; font-weight: 600; color: var(--ink-faint); }
.gx-diff b { color: var(--green-deep); }

.ana-card svg { display: block; max-width: 100%; }

@media (max-width: 860px) { .ana-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- legal & faq ---------- */

.legal { max-width: 44rem; padding-bottom: 2rem; }

.legal h2 {
  margin: 2.1rem 0 0.5rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.legal p, .legal li { color: var(--ink-soft); }
.legal b { color: var(--ink); }
.legal a { color: var(--green-deep); font-weight: 600; }
.legal ul { padding-left: 1.2rem; }
.legal li { margin-bottom: 0.4rem; }
.legal li::marker { color: var(--green); }
