/* PAGE
   (.page/.page__card/.page__header/.page__title/.page__back
   vivent dans main.css — ici juste la largeur specifique) */
.page{ --page-w: 1320px; }

.page__meta{
  max-width: 640px;
  line-height: 1.4;
}

.stats{
  padding: 18px;
  display: grid;
  gap: 22px;
}

/* =========================
   TOOLBAR (recherche + legende)
========================= */
.stats__toolbar{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.statsSearch__input{
  width: min(360px, 100%);
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(219,219,219,.14);
  background: rgba(12,15,16,.50);
  color: rgba(219,219,219,.92);
  font-size: 12px;
  letter-spacing: .06em;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.statsSearch__input::placeholder{ color: rgba(219,219,219,.40); }
.statsSearch__input:focus{
  border-color: rgba(61,206,97,.45);
  box-shadow: 0 0 0 1px rgba(61,206,97,.14);
}

.statsLegend{
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(219,219,219,.65);
}
.statsLegend__item{ display: inline-flex; align-items: center; }
.statsLegend__dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 6px;
}
.statsLegend__dot--min{ background: linear-gradient(90deg, rgba(82,56,119,.85), rgba(150,100,215,.95)); }
.statsLegend__dot--max{ background: linear-gradient(90deg, rgba(61,206,97,.55), rgba(61,206,97,.98)); }
.statsLegend__dot--ext{ background: linear-gradient(90deg, rgba(255,90,90,.6), rgba(255,90,90,.98)); }
.statsLegend__dot--hunt{ background: linear-gradient(90deg, rgba(255,190,90,.6), rgba(255,190,90,.98)); }

/* =========================
   TABLEAU
========================= */
.statsTableWrap{
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid rgba(219,219,219,.12);
  background: rgba(12,15,16,.44);
  box-shadow: 0 16px 44px rgba(0,0,0,.35);
}

.statsTable{
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

.statsTable thead th{
  text-align: left;
  padding: 14px 14px;
  font-family: "ZombiesBrainless","LazyDog",system-ui,sans-serif;
  font-weight: lighter;
  letter-spacing: .12em;
  font-size: 13px;
  color: var(--green);
  border-bottom: 1px solid rgba(219,219,219,.12);
  white-space: nowrap;
}
.statsTable thead th[data-sort]{
  cursor: pointer;
  user-select: none;
  transition: color .15s ease;
}
.statsTable thead th[data-sort]:hover{ color: rgba(219,219,219,.95); }
.statsTable thead th.is-asc::after{ content: " \25B2"; font-size: 10px; }
.statsTable thead th.is-desc::after{ content: " \25BC"; font-size: 10px; }

.statsTable tbody tr{
  border-bottom: 1px solid rgba(219,219,219,.06);
  transition: background .15s ease;
}
.statsTable tbody tr:hover{ background: rgba(61,206,97,.04); }
.statsTable tbody tr:last-child{ border-bottom: none; }

/* Ligne ciblee depuis un lien "1.7 M/S" / "50%" venant d'une fiche fantome */
.statsTable tbody tr.is-focused{
  background: rgba(61,206,97,.10);
  box-shadow: inset 0 0 0 1px rgba(61,206,97,.45);
  animation: statRowPulse 1.1s ease-out 2;
}
@keyframes statRowPulse{
  0%{ background: rgba(61,206,97,.28); }
  100%{ background: rgba(61,206,97,.06); }
}

.statsTable td{
  padding: 12px 14px;
  vertical-align: middle;
  font-size: 12px;
  letter-spacing: .04em;
  color: rgba(219,219,219,.82);
}

.cell-name{
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
}
.cell-name__img{
  width: 132px;
  height: 132px;
  border-radius: 999px;
  object-fit: contain;
  flex: none;
  transition: transform .18s ease, filter .18s ease;
}
.cell-name a:hover .cell-name__img,
.barRow a:hover .barRow__img{
  transform: scale(1.06);
  filter: drop-shadow(0 0 14px rgba(61,206,97,.35));
}

.cell-notes{
  max-width: 380px;
  line-height: 1.5;
}

/* Barres min/max/extreme + seuil de chasse (reutilisees table + graphiques) */
.statBlock{
  display: grid;
  gap: 6px;
  min-width: 220px;
}
.statBlock__sub{
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: .05em;
  color: rgba(219,219,219,.50);
}

.statLine{
  display: grid;
  grid-template-columns: 60px 1fr 68px;
  align-items: center;
  gap: 10px;
}
.statLine__label{
  font-size: 11px;
  letter-spacing: .08em;
  color: rgba(219,219,219,.55);
}
.statLine__val{
  font-size: 12px;
  text-align: right;
  color: rgba(219,219,219,.75);
  white-space: nowrap;
}

.statBar{
  height: 16px;
  border-radius: 999px;
  background: rgba(12,15,16,.55);
  border: 1px solid rgba(219,219,219,.08);
  overflow: hidden;
}
.statBar__fill{ display: block; height: 100%; border-radius: 999px; }

.bar-min{ background: linear-gradient(90deg, rgba(82,56,119,.80), rgba(150,100,215,.95)); }
.bar-max{ background: linear-gradient(90deg, rgba(61,206,97,.55), rgba(61,206,97,.98)); }
.bar-ext{ background: linear-gradient(90deg, rgba(255,90,90,.60), rgba(255,90,90,.98)); }
.bar-hunt{ background: linear-gradient(90deg, rgba(255,190,90,.60), rgba(255,190,90,.98)); }

.statVarie{
  font-size: 12px;
  letter-spacing: .08em;
  color: rgba(255,190,90,.92);
  text-shadow: 0 0 10px rgba(255,190,90,.30);
}

/* =========================
   GRAPHIQUES (barres maison, sans dependance externe)
========================= */
.statsCharts{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.chartCard{
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(219,219,219,.12);
  background: rgba(12,15,16,.44);
  box-shadow: 0 16px 44px rgba(0,0,0,.35);
  padding: 16px;
  display: grid;
  gap: 14px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.chartCard:hover{
  transform: translateY(-2px);
  border-color: rgba(61,206,97,.30);
  box-shadow: 0 0 0 1px rgba(61,206,97,.10), 0 16px 44px rgba(0,0,0,.45);
}

.chartCard__head{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.chartCard__title{
  margin: 0;
  font-family: "ZombiesBrainless","LazyDog",system-ui,sans-serif;
  font-weight: lighter;
  letter-spacing: .12em;
  font-size: 14px;
  color: var(--green);
}

.chartCard__toggle{ display: flex; gap: 6px; flex-wrap: wrap; }
.chartBtn{
  border: 1px solid rgba(219,219,219,.14);
  background: rgba(12,15,16,.50);
  color: rgba(219,219,219,.72);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.chartBtn:hover{ border-color: rgba(61,206,97,.35); color: rgba(219,219,219,.95); }
.chartBtn.is-active{
  background: rgba(61,206,97,.14);
  border-color: rgba(61,206,97,.50);
  color: var(--green);
}

.barChart{
  display: grid;
  gap: 14px;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 4px;
}
.barChart__empty{
  margin: 0;
  text-align: center;
  color: rgba(219,219,219,.50);
  font-size: 12px;
  padding: 24px 0;
}

.barRow{
  display: grid;
  grid-template-columns: 84px auto;
  align-items: center;
  gap: 16px;
}
.barRow__img{
  width: 84px;
  height: 84px;
  border-radius: 999px;
  object-fit: contain;
}
.barRow__body{
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 300px;
  max-width: 100%;
}
.barRow__body--dual{
  display: flex;
  justify-content: center;
  gap: 24px;
  width: auto;
  max-width: 100%;
}
.barRow__stat{
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 210px;
  max-width: 100%;
}
.barRow__track{
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(12,15,16,.55);
  border: 1px solid rgba(219,219,219,.08);
  overflow: hidden;
}
.barRow__fill{ display: block; height: 100%; border-radius: 999px; }
.barRow__val{
  font-size: 16px;
  font-family: "LazyDog",system-ui,sans-serif;
  letter-spacing: .04em;
  text-align: center;
  color: rgba(219,219,219,.92);
  white-space: nowrap;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px){
  .statsCharts{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .stats{ padding: 14px; gap: 16px; }
  .cell-notes{ max-width: 220px; }
  .statBlock{ min-width: 160px; }
  .statLine{ grid-template-columns: 44px 1fr 54px; }
  .statBar{ height: 12px; }
  .cell-name__img{ width: 92px; height: 92px; }
  .barRow{ grid-template-columns: 60px auto; gap: 12px; }
  .barRow__img{ width: 60px; height: 60px; }
  .barRow__body{ width: 170px; }
  .barRow__body--dual{ gap: 12px; }
  .barRow__stat{ width: 130px; }
  .barRow__track{ height: 14px; }
  .barRow__val{ font-size: 13px; }
}
