:root {
  --bg: #0E1634; --card: #1B2550; --card-hi: #243063; --border: #34457E; --rail: #0A1028;
  --text: #F4F7FF; --muted: #AEB8D8; --accent: #D7FF3A; --blue: #2E6BFF; --green: #1ED38A; --red: #FF5A5F;
  --legend: #FFD24A; --legend-fg: #3D2E00; --superstar: #FF9F43; --superstar-fg: #3D1E00; --star: #5B8CFF; --star-fg: #0B1E4D;
  --regular: #33427A; --squad: #252F56; --gem-bg: #3A1F5E; --gem-fg: #D5B8FF; --prospect-bg: #0F4A44; --prospect-fg: #7EF0D8;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, .title { font-family: Unbounded, Inter, sans-serif; font-weight: 800; letter-spacing: .01em; margin: 0 0 .6rem; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }

/* Barre du haut */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--rail); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-family: Unbounded, sans-serif; font-weight: 800; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a.active, .nav a:hover { color: var(--text); background: var(--card-hi); }
.nav a.active { box-shadow: inset 0 -2px 0 var(--accent); }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 1.2rem; }
main { max-width: 1360px; margin: 0 auto; padding: 24px; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 24px; }

/* Cartes et grilles */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card.hero { border-left: 4px solid var(--accent); background: var(--card-hi); }
.stack > * + * { margin-top: 10px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat b { display: block; font-family: Unbounded, sans-serif; font-size: 1.4rem; color: var(--accent); }
.stat span { color: var(--muted); font-size: .8rem; }

/* Tableaux */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 7px 8px; border-bottom: 1px solid rgba(52, 69, 126, .45); }
tr:hover td { background: rgba(36, 48, 99, .6); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos-top td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.table-wrap { overflow-x: auto; }
td.num, th.num { white-space: nowrap; }
/* Standings: the same column widths everywhere (league, home, cup groups); long club names end with "…" */
table.standings { table-layout: fixed; min-width: 480px; }
table.standings col.c-pos { width: 30px; } table.standings col.c-num { width: 31px; }
table.standings col.c-pts { width: 38px; } table.standings col.c-form { width: 88px; }
table.standings td, table.standings th { padding-left: 4px; padding-right: 4px; }
table.standings td:last-child { white-space: nowrap; }
table.standings td:nth-child(2) { overflow: hidden; }
.club { max-width: 100%; min-width: 0; vertical-align: middle; }
.club span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.club img { flex: none; }
table.list td { white-space: nowrap; }
tr.is-fav td { background: rgba(215, 255, 58, .06); }
/* Follow button */
.fav { background: none; border: 0; padding: 0 4px; cursor: pointer; color: var(--muted); font-size: 1.05rem; line-height: 1; }
.fav:hover { color: var(--accent); }
.fav.on { color: var(--legend); }
h1 .fav { font-size: 1.4rem; vertical-align: middle; }

/* Clubs, joueurs */
.club { display: inline-flex; align-items: center; gap: 8px; }
.club img { width: 24px; height: 24px; object-fit: contain; }
.face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--card-hi); vertical-align: middle; }
.face.big { width: 140px; height: 140px; border-radius: 16px; }
.pill { display: inline-block; min-width: 34px; text-align: center; border-radius: 6px; padding: 1px 6px; font-family: Unbounded, sans-serif; font-weight: 800; font-size: .82rem; }
.pill.Legend { background: var(--legend); color: var(--legend-fg); }
.pill.Superstar { background: var(--superstar); color: var(--superstar-fg); }
.pill.Star { background: var(--star); color: var(--star-fg); }
.pill.Regular { background: var(--regular); color: #E9EDFA; }
.pill.Squad { background: var(--squad); color: var(--muted); }
.badge { display: inline-block; border-radius: 10px; padding: 1px 9px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge.Legend { background: #4A3B05; color: #FFE07A; } .badge.Superstar { background: #4A2A0C; color: #FFC184; }
.badge.Star { background: #1C2E66; color: #A9C2FF; } .badge.Wonderkid, .badge.rising { background: var(--gem-bg); color: var(--gem-fg); }
.badge.Top { background: var(--prospect-bg); color: var(--prospect-fg); }
.badge.kind { background: var(--card-hi); color: var(--muted); }
.badge.upset, .badge.hattrick { background: #4A2A0C; color: #FFC184; } .badge.form, .badge.season { background: #4A3B05; color: #FFE07A; }
.badge.flop, .badge.streak { background: #5A1A1E; color: #FFA3A6; } .badge.rumour, .badge.transfer { background: var(--prospect-bg); color: var(--prospect-fg); }

/* Matchs */
.match { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(52, 69, 126, .45); }
.match .home { justify-content: flex-end; text-align: right; }
.score { font-family: Unbounded, sans-serif; font-weight: 800; min-width: 64px; text-align: center; color: var(--accent); }
.score.pending { color: var(--muted); font-weight: 600; }
.scorers { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); text-align: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button, select, input { background: var(--card-hi); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font: inherit; }
.tabs button.on { background: var(--accent); color: #0A1230; border-color: var(--accent); font-weight: 600; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }

/* News */
.news { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(52, 69, 126, .45); }
.news:last-child { border-bottom: 0; }
.news .logos img { width: 30px; height: 30px; object-fit: contain; display: block; margin-bottom: 4px; }
.news h3 { font-family: Inter, sans-serif; font-weight: 600; font-size: 1.02rem; margin: 2px 0; }
.news p { margin: 0; color: var(--muted); font-size: .9rem; }

/* Tableau de coupe */
.bracket { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.bracket .round { min-width: 200px; display: flex; flex-direction: column; gap: 8px; }
.bracket .ties { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.tie { background: var(--card-hi); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: .85rem; }
.tie div { display: flex; justify-content: space-between; gap: 8px; }
.tie .lost { color: var(--muted); }

/* Fiches */
.profile { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile .logo { width: 120px; height: 120px; object-fit: contain; }
.bars div { display: grid; grid-template-columns: 90px 1fr 34px; gap: 8px; align-items: center; margin: 4px 0; font-size: .85rem; }
.bars i { display: block; height: 8px; border-radius: 4px; background: var(--card-hi); overflow: hidden; }
.bars i b { display: block; height: 100%; background: var(--accent); }

@media (max-width: 900px) {
  .cols-2, .cols-3, .cols-even { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: block; }
  .nav { display: none; width: 100%; }
  body.menu-open .nav { display: flex; flex-direction: column; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  main { padding: 16px; }
}
