:root {
  --sun:   #F97316;
  --gold:  #FBBF24;
  --grass: #16A34A;
  --sky:   #0EA5E9;
  --dark:  #1C1917;
  --mid:   #44403C;
  --white: #FFFBF5;
  --bg:    #F5F3EE;
  --border:#E7E5E4;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--dark);
  min-height: 100vh;
}


/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  box-shadow: 0 2px 16px rgba(0,0,0,.4);
}

.nav-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: .1em;
  color: var(--gold);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: .25rem;
}

.nav-links a {
  color: #A8A29E;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  padding: .4rem .9rem;
  border-radius: 6px;
  transition: all .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--white);
  background: rgba(255,255,255,.1);
}

.nav-links a.active {
  color: var(--gold);
}


/* ── PAGE HEADER ── */
.page-header {
  background: var(--dark);
  padding: 2.5rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(249,115,22,.18) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 30%, rgba(14,165,233,.12) 0%, transparent 50%);
  pointer-events: none;
}

.page-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--white);
  letter-spacing: .08em;
  position: relative;
}

.page-header h1 span {
  color: var(--sun);
}

.page-header p {
  color: #A8A29E;
  font-size: .9rem;
  margin-top: .5rem;
  position: relative;
}


/* ── MAIN ── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}


/* ── SECTION TITLE ── */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: .08em;
  color: var(--dark);
  margin-bottom: .25rem;
}

.section-sub {
  font-size: .85rem;
  color: #78716C;
  margin-bottom: 1.5rem;
}


/* ═══════════════════════════════════
   TIMELINE
═══════════════════════════════════ */
.timeline-section {
  margin-bottom: 3rem;
}

.timeline-scroll {
  overflow-x: auto;
  padding-bottom: .75rem;
}

.timeline-chart {
  min-width: 700px;
}


/* ── Header années / mois ── */
.tl-axis {
  display: flex;
  height: 28px;
  margin-bottom: 4px;
  position: relative;
}

.tl-year-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: .85rem;
  letter-spacing: .1em;
  color: var(--dark);
  position: absolute;
  top: 0;
  white-space: nowrap;
}

.tl-months {
  display: flex;
  width: 100%;
}

.tl-month {
  flex: 1;
  font-size: .6rem;
  color: #A8A29E;
  text-align: center;
  border-left: 1px solid var(--border);
  padding-top: 10px;
  white-space: nowrap;
  overflow: hidden;
}


/* ── Une ligne = une compétition ── */
.tl-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  gap: 8px;
}

.tl-label {
  width: 190px;
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 600;
  color: var(--mid);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-bar-wrap {
  flex: 1;
  height: 20px;
  background: #F5F3EE;
  border-radius: 4px;
  position: relative;
  overflow: visible;
}

.tl-segment {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  cursor: default;
  transition: opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl-segment:hover {
  opacity: .85;
  z-index: 10;
}

.tl-count {
  font-size: .6rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  padding: 0 3px;
}

.tl-count-out {
  display: none;
}


/* ── Légende des compétitions ── */
.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  margin-top: 1rem;
}

.tl-leg-item {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  color: var(--mid);
  font-weight: 500;
}

.tl-leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}


/* ── Barre résumé matchs/mois ── */
.tl-density-row {
  display: flex;
  align-items: flex-end;
  height: 40px;
  margin-bottom: 2px;
}

.tl-density-label {
  width: 190px;
  flex-shrink: 0;
  text-align: right;
  font-size: .65rem;
  color: #A8A29E;
  padding-right: 8px;
  line-height: 40px;
}

.tl-density-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 1px;
}

.tl-density-bar {
  flex: 1;
  background: var(--sun);
  border-radius: 2px 2px 0 0;
  opacity: .7;
  min-height: 2px;
}


/* ═══════════════════════════════════
   STATS CARDS
═══════════════════════════════════ */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  text-align: center;
  min-width: 130px;
}

.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--sun);
  letter-spacing: .04em;
  line-height: 1;
}

.stat-label {
  font-size: .72rem;
  color: #78716C;
  margin-top: .25rem;
  font-weight: 500;
}


/* ═══════════════════════════════════
   FILTRES
═══════════════════════════════════ */
.filters-bar {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: .75rem;
  align-items: end;
}

@media (max-width: 700px) {
  .filters-bar {
    grid-template-columns: 1fr 1fr;
  }
}

.filter-group label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #78716C;
  display: block;
  margin-bottom: .3rem;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: .45rem .6rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: border-color .2s;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--sun);
}

.filter-group input::placeholder {
  color: #A8A29E;
}

.btn-reset {
  padding: .45rem 1rem;
  background: var(--dark);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}

.btn-reset:hover {
  background: #44403C;
}


/* ── Résumé résultats ── */
.results-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .75rem;
  flex-wrap: wrap;
}

.res-count {
  font-size: .82rem;
  color: #78716C;
}

.res-count strong {
  color: var(--dark);
}

.res-dist {
  display: flex;
  gap: .5rem;
}

.res-pill {
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 99px;
}

.res-H {
  background: #DCFCE7;
  color: #15803D;
}

.res-D {
  background: #FEF3C7;
  color: #B45309;
}

.res-A {
  background: #FEE2E2;
  color: #DC2626;
}


/* ═══════════════════════════════════
   TABLE MATCHS
═══════════════════════════════════ */
.matches-table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.matches-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}

.matches-table thead th {
  background: var(--dark);
  color: #78716C;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .55rem .75rem;
  text-align: left;
  white-space: nowrap;
}

.matches-table tbody tr {
  border-bottom: 1px solid #F5F3EE;
  transition: background .12s;
}

.matches-table tbody tr:hover {
  background: #FFFBF5;
}

.matches-table tbody tr:last-child {
  border-bottom: none;
}

.matches-table td {
  padding: .5rem .75rem;
  vertical-align: middle;
}

.td-date {
  color: #A8A29E;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}

.td-comp {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.comp-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .4rem;
  border-radius: 4px;
  white-space: nowrap;
}

.td-stage {
  color: #78716C;
  font-size: .72rem;
}

.td-teams {
  font-weight: 500;
  white-space: nowrap;
}

.td-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
}

.result-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 4px;
}

.neutral-icon {
  font-size: .7rem;
  color: #A8A29E;
  margin-left: .25rem;
}


/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.page-btn {
  padding: .35rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  color: var(--mid);
  cursor: pointer;
  transition: all .15s;
}

.page-btn:hover {
  border-color: var(--sun);
  color: var(--sun);
}

.page-btn.active {
  background: var(--sun);
  border-color: var(--sun);
  color: white;
  font-weight: 700;
}

.page-btn:disabled {
  opacity: .35;
  cursor: default;
}

.page-info {
  font-size: .78rem;
  color: #78716C;
}