:root {
  --bleu: #0f263c;
  --rouge: #E01E13;
  --blanc: #fff;
  --carte: #132d44;
  --bord: rgba(255,255,255,.08);
  --muted: #b7c2cf;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bleu);
  color: var(--blanc);
  font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  overflow-x: hidden;
}

/* HEADER */
header {
  text-align: center;
  background: var(--bleu);
  padding: 0 0 8px;
}
header img {
  width: 120px;
  height: auto;
  display: block;
  margin: 30px auto 0;
}
.site-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.6rem;
  letter-spacing: 3px;
  margin-top: 1px;
  text-transform: uppercase;
  line-height: 1;
}
.site-title .losc { color: #fff; }
.site-title .n360 { color: var(--rouge); }

/* BANNIÈRE BARRES */
.stats-banner {
  position: relative;
  width: 100%;
  height: 50px;
  background: var(--bleu);
  overflow: hidden;
  margin-bottom: 8px;
}
.stats-banner .bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 14px;
}
.stats-banner .bar {
  width: 10px;
  background: var(--rouge);
  border-radius: 4px 4px 0 0;
  height: 0;
  transform-origin: bottom;
  animation: growUp .8s ease-out forwards;
  box-shadow: 0 0 10px rgba(224,30,19,.35);
  opacity: .95;
}
@keyframes growUp { from { height: 0; } to { height: var(--h); } }

/* MENU COLLANT */
nav {
  background: var(--rouge);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 6px 14px rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 14px 16px;
}
.nav-inner a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: opacity .25s, transform .2s;
}
.nav-inner a:hover {
  opacity: .9;
  transform: scale(1.04);
}
.nav-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
}
select.select {
  appearance: none;
  background: #0f263c;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 6px 8px;
  font-weight: 600;
  min-width: 190px;
}

/* GRIDS & CARDS */
.wrap {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}
.grid {
  display: grid;
  column-gap: 24px;
  row-gap: 24px;
}
.grid + .grid { margin-top: 24px; }

.row-2 { grid-template-columns: 2fr 1.2fr; }
/* Correction de la hauteur des cartes Matchs + Classement */
/* Grille Matchs + Classement */
.row-3 {
  display: grid;
  grid-template-columns: 1.6fr 1.2fr;
  align-items: stretch;
  gap: 24px;
}

/* Chaque carte (Matchs / Classement) s’étire également */
.row-3 .card {
  display: flex;
  flex-direction: column;
  min-height: 800px;   /* visible même si peu de contenu */
}

/* Le corps des cartes défilant, sans cacher le contenu */
.row-3 .card .card-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  max-height: none;
}

/* Scrollbar stylée */
.row-3 .card .card-body::-webkit-scrollbar {
  width: 8px;
}
.row-3 .card .card-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}
.row-3 .card .card-body:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
}

.card {
  background: var(--carte);
  border: 1px solid var(--bord);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card h3 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: .08em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
.card .card-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  max-height: 500px;
}

/* BARRES DE SCROLL */
.card-body::-webkit-scrollbar { width: 8px; }
.card-body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 10px;
}
.card-body:hover::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
}

/* TABLEAUX GÉNÉRAUX */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 10px 8px;
  font-size: 14px;
}
thead th {
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--bord);
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.06);
}
tbody tr.highlight {
  background: rgba(255,255,255,.05);
}

/* MATCHES TABLE */
.matches-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.matches-table thead th {
  position: sticky;
  top: 0;
  background: var(--carte);
  z-index: 1;
}
.match-row {
  cursor: pointer;
  transition: background 0.2s ease;
}
.match-row:hover {
  background: rgba(255, 255, 255, 0.05);
}
.col-date, .col-md, .col-score { text-align: center; }
.col-date { width: 92px; }
.col-md { width: 40px; }
.col-score { width: 76px; }

.team-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.team-cell img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border: none;
  background: transparent !important;
}
.score-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.score-stack .score-badge {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .5px;
}
.score-stack .time {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

/* CLASSEMENT TABLE */
.standings-table th, .standings-table td {
  text-align: center;
  padding: 8px;
}
.standings-table th:nth-child(2),
.standings-table td:nth-child(2) {
  text-align: left;
}

/* Sélecteurs compétition & saison */
.comp-select {
  background: #0b1d2d;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 15px;
  margin-left: 6px;
  outline: none;
  cursor: pointer;
}
.comp-select option {
  background: #0b1d2d;
  color: #fff;
  font-weight: 500;
}
.card h3 select {
  background-color: #0b1d2d;
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  padding: 4px 28px 4px 8px;
  cursor: pointer;
  appearance: none;
  outline: none;
  transition: background 0.2s ease-in-out;
  position: relative;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='white' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.card h3 select:hover {
  background: #0b1d2d;
}
.card h3 select:disabled {
  opacity: 1;
  cursor: default;
}
.divider {
  opacity: 0.4;
  font-weight: 400;
  font-size: 1rem;
  color: #fff;
  margin: 0 2px;
}

/* OVERVIEW */
.overview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  min-height: 160px;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
}
.kpi {
  background: #0f2436;
  border: 1px solid var(--bord);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.kpi .lbl { color: var(--muted); font-size: 12px; }
.kpi .val { font-size: 22px; font-weight: 800; }
.crest-lg {
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 12px;
  background: #0a1d2c;
  padding: 8px;
  border: 1px solid var(--bord);
}

/* PROCHAIN MATCH */
.last-match {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.lm-team {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}
.lm-team.right { justify-content: flex-start; }
.lm-team img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border: none;
  background: transparent;
}
.lm-score .score { font-size: 32px; font-weight: 900; }
.lm-score .date { font-size: 12px; color: var(--muted); }

/* RESPONSIVE */
@media (max-width:980px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2,1fr); }
  .last-match { grid-template-columns: 1fr; row-gap: 8px; }
  .lm-team, .lm-team.right { justify-content: center; }
  .nav-inner { justify-content: center; }
  .nav-right { position: static; transform: none; margin-left: auto; }
  .card h3 { flex-direction: column; align-items: flex-start; gap: 6px; }
  .divider { display: none; }
}

.stats-box {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.team-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-side img {
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
}

.stats-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.stat-line {
  display: grid;
  grid-template-columns: 50px 160px 50px;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  width: 260px;
}

.stat-line .label {
  color: #aaa;
  font-weight: 600;
  font-size: 0.9rem;
}

.stat-line .value {
  font-weight: 700;
}

.stat-line .value.home {
  color: #e41b23; /* rouge LOSC */
}

.stat-line .value.away {
  color: #1e90ff; /* bleu neutre pour l'adversaire */
}

.stat-bar {
  display: flex;
  height: 6px;
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
  background: rgba(255,255,255,0.1);
  margin-top: 4px;
}

.stat-bar .home {
  background: #e41b23;
}

.stat-bar .away {
  background: #1e90ff;
}

/* === Classement Europa League avec scroll === */
.standings-container {
  max-height: 650px; /* limite la hauteur visible (≈18 lignes) */
  overflow-y: auto;  /* active le défilement vertical */
  scrollbar-width: thin; /* scrollbar fine sur Firefox */
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}

/* Scrollbar pour Chrome / Edge / Safari */
.standings-container::-webkit-scrollbar {
  width: 6px;
}
.standings-container::-webkit-scrollbar-track {
  background: transparent;
}
.standings-container::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.2);
  border-radius: 3px;
}
