/* ============================================================
   Pokédex GO — Feuille de style
   Thème : sombre, rouge Pokéball, accents dorés
   ============================================================ */

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

:root {
  --red:       #E3350D;
  --gold:      #F5C518;
  --green:     #3ecf6a;
  --bg:        #0f1014;
  --bg2:       #18191f;
  --bg3:       #22232c;
  --border:    rgba(255,255,255,.08);
  --text:      #e8e8ec;
  --muted:     #7a7b8a;
  --radius:    10px;
  --font-title: 'Bebas Neue', sans-serif;
  --font-body:  'DM Sans', sans-serif;
}

html { font-size: 15px; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* ── Header ──────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,16,20,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.logo { display: flex; align-items: center; gap: .6rem; font-family: var(--font-title); font-size: 1.6rem; letter-spacing: .04em; }
.logo em { color: #FCD554; font-style: normal; }
.logo-ico { width: 50px;}
.back-link { color: var(--muted); font-size: .85rem; font-weight: 500; margin-right: auto; white-space: nowrap; transition: color .15s; }
.back-link:hover { color: var(--text); }
.header-trainer { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.ht-name  { font-weight: 600; font-size: .95rem; }
.ht-stats { color: var(--gold); font-size: .8rem; font-weight: 500; }

/* ── Page accueil ────────────────────────────────── */
.home-main { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
.home-title { font-family: var(--font-title); font-size: 3rem; letter-spacing: .04em; margin-bottom: .4rem; }
.home-sub { color: var(--muted); margin-bottom: 2rem; }
.trainer-grid { display: flex; flex-direction: column; gap: .75rem; }
.trainer-card { display: flex; align-items: center; gap: 1rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; transition: border-color .2s, background .2s; cursor: pointer; flex-wrap: nowrap; }
.trainer-card:hover { border-color: #FCD554; background: var(--bg3); }
.trainer-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--font-title); font-size: 1.6rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.trainer-info { flex: 1; min-width: 0; }
.trainer-name { display: block; font-weight: 600; font-size: 1.05rem; margin-bottom: .3rem; }
.trainer-progress-label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .35rem; }
.progress-bar { height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width .4s ease; }
.trainer-arrow { color: var(--muted); font-size: 1.1rem; }
.empty-state { text-align: center; padding: 3rem; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ── Progression globale ─────────────────────────── */
.global-progress { height: 3px; background: var(--bg3); }
.gp-fill { height: 100%; background: var(--gold); transition: width .6s ease; }

/* ── Navigation par région ───────────────────────── */
.region-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.region-nav::-webkit-scrollbar { display: none; }
.region-nav-inner {
  display: flex;
  max-width: 1400px; margin: 0 auto;
  padding: 0 1rem;
  gap: .25rem;
}
.region-tab {
  display: flex; flex-direction: column; align-items: center;
  padding: .65rem .9rem .5rem;
  gap: .2rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
  border-radius: 6px 6px 0 0;
  min-width: 80px;
}
.region-tab:hover { background: var(--bg3); }
.region-tab.active {
  border-bottom-color: #FCD554;
  background: var(--bg3);
}
.rt-name {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  transition: color .15s;
}
.region-tab.active .rt-name { color: var(--text); }
.rt-count { font-size: .7rem; color: var(--muted); }
.rt-bar { width: 100%; height: 2px; background: var(--border); border-radius: 1px; overflow: hidden; }
.rt-bar-fill { display: block; height: 100%; background: var(--green); border-radius: 1px; transition: width .3s; }

/* ── Barre de filtres ────────────────────────────── */
.filter-bar {
  max-width: 1400px; margin: 0 auto;
  padding: .75rem 1.5rem;
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
#search-input {
  flex: 1; min-width: 180px; max-width: 300px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  padding: .45rem .85rem; font-size: .9rem;
  font-family: var(--font-body); outline: none; transition: border-color .15s;
}
#search-input:focus { border-color: var(--red); }
#search-input::placeholder { color: var(--muted); }
.filter-btns { display: flex; gap: .4rem; }
.filter-btn { background: var(--bg2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: .4rem .9rem; font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .15s; font-family: var(--font-body); }
.filter-btn:hover { border-color: rgba(255,255,255,.2); color: var(--text); }
.filter-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.region-count { margin-left: auto; font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ── Tableau ─────────────────────────────────────── */
.table-wrap { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem 4rem; overflow-x: auto; }
.pokedex-table { width: 100%; border-collapse: collapse; font-size: .88rem; }

.pokedex-table thead tr {
  position: sticky; top: 0px; z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.pokedex-table th { padding: .55rem .5rem; text-align: center; white-space: nowrap; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.th-name, .th-num { text-align: left; }
.th-icon  { display: block; font-size: 1rem; }
.th-label { font-size: .7rem; }

.pokemon-row { border-bottom: 1px solid var(--border); transition: background .12s; }
.pokemon-row:hover { background: var(--bg2); }
.pokemon-row.is-owned { background: rgba(62,207,106,.04); }
.pokemon-row.is-owned:hover { background: rgba(62,207,106,.09); }
.pokedex-table td { padding: .35rem .5rem; vertical-align: middle; }
.td-sprite { width: 52px; text-align: center; }
.td-sprite img { display: block; margin: auto; image-rendering: pixelated; }
.td-num  { width: 58px; color: var(--muted); font-variant-numeric: tabular-nums; }
.td-name { min-width: 140px; font-weight: 500; }
.td-status { width: 52px; text-align: center; }

/* ── Bouton de statut ────────────────────────────── */
/*
   Non possédé : contour gris discret, icône grisée
   Possédé     : contour vert net, icône pleine couleur
*/
.status-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: none;
  border: 1.5px solid var(--border);
  font-size: 1.05rem; cursor: pointer;
  filter: grayscale(1); opacity: .35;
  transition: opacity .15s, filter .15s, border-color .15s, background .15s, box-shadow .15s;
  position: relative;
}
.status-btn:hover {
  opacity: .7; filter: grayscale(.3);
  border-color: rgba(255,255,255,.25);
}
.status-btn.is-active {
  filter: none;
  opacity: 1;
  border-color: var(--green);
  background: rgba(62,207,106,.1);
  box-shadow: 0 0 0 1px rgba(62,207,106,.25);
}
.status-btn.loading { pointer-events: none; }
.status-btn.loading::after {
  content: ''; position: absolute; inset: 0; border-radius: 8px;
  background: rgba(255,255,255,.15);
  animation: pulse .6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:0} 50%{opacity:1} }

/* ── Formes alternatives ─────────────────────────── */
.forme-toggle { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 4px; padding: .1rem .35rem; font-size: .75rem; cursor: pointer; margin-left: .4rem; line-height: 1; transition: color .15s, border-color .15s; font-family: var(--font-body); }
.forme-toggle:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.formes-row td { padding: 0; }
.formes-row.hidden { display: none; }
.formes-inner { display: flex; flex-wrap: wrap; gap: .5rem; padding: .6rem 1rem .6rem 52px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.forme-item { display: flex; align-items: center; gap: .4rem; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .6rem; }
.forme-name { font-size: .8rem; color: var(--muted); margin-right: .2rem; }

/* ── Toast ───────────────────────────────────────── */
.toast { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .6rem 1.1rem; font-size: .88rem; font-weight: 500; transform: translateY(10px); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.toast-success { border-color: var(--green); }
.toast.toast-error   { border-color: var(--red); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 640px) {
  .th-label  { display: none; }
  .th-icon   { font-size: .9rem; }
  .status-btn { width: 28px; height: 28px; font-size: .9rem; }
  .td-status  { width: 36px; }
  .filter-bar { padding: .75rem 1rem; }
  .table-wrap { padding: 0 .5rem 3rem; }
  .header-inner {
    padding: .5rem .75rem;
    flex-wrap: wrap;
    gap: .4rem;
  }
  .logo { font-size: 1.2rem; flex: 1; min-width: 0; }
  .logo-ico { width: 36px; }
  .back-link { font-size: .78rem; }
  .region-tab { min-width: 56px; padding: .45rem .5rem .35rem; }
  .rt-name { font-size: .72rem; }

  /* Session : masquer le nom, ne garder que le bouton */
  .header-session { margin-left: 0; gap: .4rem; }
  .session-name { display: none; }
  .session-btn { padding: .3rem .65rem; font-size: .78rem; }

  /* header-trainer : réduire */
  .header-trainer { display: none; }

  /* Filtres tri-état : plus compact */
  .filter-group-label { display: none; }
  .tri-btn { min-width: 28px; height: 26px; font-size: .78rem; padding: 0 .4rem; }
}
/* ── Session (header) ────────────────────────────── */
.header-session { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.session-name { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.session-btn { padding: .35rem .85rem; border-radius: 6px; font-size: .82rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all .15s; border: 1px solid var(--border); }
.session-btn-in  { background: var(--red); border-color: var(--red); color: #fff; }
.session-btn-in:hover  { background: #c42d0b; }
.session-btn-out { background: none; color: var(--muted); }
.session-btn-out:hover { color: var(--text); border-color: rgba(255,255,255,.25); }

/* ── Bandeau lecture seule ───────────────────────── */
.readonly-banner {
  max-width: 1400px; margin: 0 auto;
  padding: .55rem 1.5rem;
  background: rgba(227,53,13,.08);
  border-bottom: 1px solid rgba(227,53,13,.2);
  font-size: .85rem; color: var(--muted);
}
.readonly-banner a { color: var(--gold); text-decoration: underline; }
.readonly-banner strong { color: var(--text); }

/* ── Bouton readonly ─────────────────────────────── */
.status-btn.is-readonly { cursor: not-allowed; }
.status-btn:disabled { cursor: not-allowed; }

/* ── Page login ──────────────────────────────────── */
.login-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem;
  max-width: 420px;
}
.login-error { background: rgba(227,53,13,.12); border: 1px solid rgba(227,53,13,.3); color: #f97066; border-radius: 6px; padding: .6rem .9rem; margin-bottom: 1.2rem; font-size: .88rem; }
.login-field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.login-field label { font-size: .82rem; font-weight: 500; color: var(--muted); }
.login-field input { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: .55rem .85rem; font-size: .95rem; font-family: var(--font-body); outline: none; transition: border-color .15s; }
.login-field input:focus { border-color: var(--red); }
.login-btn { width: 100%; padding: .65rem; background: var(--red); border: none; border-radius: 8px; color: #fff; font-size: 1rem; font-weight: 600; font-family: var(--font-body); cursor: pointer; transition: background .15s; margin-top: .5rem; }
.login-btn:hover { background: #c42d0b; }
.login-hint { margin-top: 1.2rem; font-size: .8rem; color: var(--muted); line-height: 1.5; }
.login-hint code { background: var(--bg3); padding: .1rem .4rem; border-radius: 4px; font-size: .85em; color: var(--gold); }

/* ── Page administration ─────────────────────────── */
.admin-stats {
  display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.admin-stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  min-width: 110px;
}
.admin-stat-card.asc-warn { border-color: var(--gold); }
.asc-value { font-family: var(--font-title); font-size: 2rem; line-height: 1; }
.asc-label { font-size: .75rem; color: var(--muted); }
.admin-section-title {
  font-family: var(--font-title); font-size: 1.4rem;
  letter-spacing: .04em; margin-bottom: 1rem; color: var(--muted);
}
.admin-grid { display: flex; flex-direction: column; gap: .75rem; }
.admin-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  transition: border-color .2s, background .2s; cursor: pointer;
}
.admin-card:hover { border-color: var(--gold); background: var(--bg3); }
.admin-card-disabled { opacity: .4; cursor: not-allowed; }
.admin-card-disabled:hover { border-color: var(--border); background: var(--bg2); }
.admin-card-icon { font-size: 1.6rem; flex-shrink: 0; width: 40px; text-align: center; }
.admin-card-info { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.admin-card-title { font-weight: 600; font-size: 1rem; }
.admin-card-desc { font-size: .82rem; color: var(--muted); }
.admin-card-desc strong { color: var(--gold); }
.session-btn-admin {
  background: rgba(245,197,24,.15); border-color: var(--gold);
  color: var(--gold);
}
.session-btn-admin:hover { background: rgba(245,197,24,.25); }
 
/* ── Toggle switch (gestion_formes) ─────────────── */
.toggle-switch {
  display: inline-flex; align-items: center; gap: .5rem;
  cursor: pointer; user-select: none;
}
.toggle-input { display: none; }
.toggle-slider {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--bg3); border: 1px solid var(--border);
  position: relative; transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.toggle-slider::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--muted); top: 2px; left: 2px;
  transition: transform .2s, background .2s;
}
.toggle-input:checked + .toggle-slider {
  background: rgba(62,207,106,.15);
  border-color: var(--green);
}
.toggle-input:checked + .toggle-slider::after {
  background: var(--green);
  transform: translateX(18px);
}
.toggle-input:disabled + .toggle-slider { opacity: .5; cursor: not-allowed; }
.toggle-label { font-size: .8rem; color: var(--muted); min-width: 52px; }

/* ── Autocomplétion ──────────────────────────────────── */
#autocomplete-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;

  z-index: 999;
}

/* conteneur dropdown */
.autocomplete-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;

  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);

  overflow: hidden;
  z-index: 999;

  box-shadow: 0 10px 25px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}

/* item */
.autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: .55rem .75rem;
  cursor: pointer;

  font-size: .85rem;

  border-bottom: 1px solid var(--border);
  transition: background .12s, color .12s;
}

/* dernier item sans bordure */
.autocomplete-item:last-child {
  border-bottom: none;
}

/* hover / keyboard */
.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--bg3);
}

/* nom Pokémon */
.auto-name {
  font-weight: 600;
  color: var(--text);
}

/* numéro + région */
.auto-meta {
  font-size: .75rem;
  color: var(--muted);
}

/* highlight search match (optionnel mais joli) */
.auto-name strong {
  color: var(--gold);
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 300px;
}
/* ── Filtres tri-état ────────────────────────────── */
.filter-group {
  display: flex; align-items: center; gap: .3rem; flex-wrap: wrap;
}
.filter-group-label {
  font-size: .72rem; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  margin-right: .15rem; white-space: nowrap;
}
.tri-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 30px; padding: 0 .55rem;
  border-radius: 6px; border: 1.5px solid var(--border);
  background: none; color: var(--muted);
  font-size: .82rem; font-weight: 500; font-family: var(--font-body);
  cursor: pointer; transition: all .15s;
  white-space: nowrap;
}
.tri-btn:hover { border-color: rgba(255,255,255,.25); color: var(--text); }

/* État OUI → vert */
.tri-btn.tri-oui {
  border-color: var(--green);
  background: rgba(62,207,106,.12);
  color: var(--green);
  font-weight: 600;
}
/* État NON → rouge */
.tri-btn.tri-non {
  border-color: var(--red);
  background: rgba(227,53,13,.12);
  color: #f97066;
  font-weight: 600;
}

/* Indicateur visuel sur le bouton : ✓ ou ✗ en petit */
.tri-btn.tri-oui::after { content: ' ✓'; font-size: .7em; }
.tri-btn.tri-non::after { content: ' ✗'; font-size: .7em; }

/* ── Region nav : catégories spéciales ──────────── */
.region-tab-dropdown {
  cursor: pointer; user-select: none;
}
.region-tab-dropdown:hover { background: var(--bg3); }
.region-dropdown-menu {
  display: none;
  flex-direction: column;
  position: fixed; z-index: 500;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 0 8px 8px 8px;
  min-width: 210px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  overflow: hidden;
}
.region-dropdown-menu.visible { display: flex; }
.region-dropdown-item {
  display: block; padding: .65rem 1rem;
  font-size: .88rem; font-weight: 500; color: var(--muted);
  white-space: nowrap;
  transition: background .12s, color .12s;
  text-decoration: none;
}
.region-dropdown-item:hover { background: var(--bg3); color: var(--text); }
.region-tab-special { color: var(--gold); }
.region-tab-special .rt-name { color: var(--gold); }
.region-tab-special:hover { border-bottom-color: var(--gold); }

/* ── Tableau de stats ────────────────────────────── */
.stats-wrap {
  max-width: 1100px; margin: 2rem auto;
  padding: 0 1.5rem 4rem;
  overflow-x: auto;
}
.stats-table {
  width: 100%; border-collapse: collapse;
  font-size: .88rem; font-family: var(--font-body);
}
.stats-th-group {
  background: var(--bg3); color: var(--muted);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  padding: .5rem; text-align: center;
  border-bottom: 1px solid var(--border);
}
.stats-th {
  background: var(--bg2); color: var(--muted);
  font-size: .78rem; font-weight: 600; padding: .45rem .6rem;
  text-align: center; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.stats-th-region {
  background: var(--bg2); color: var(--muted);
  font-size: .78rem; font-weight: 600; padding: .45rem .8rem;
  text-align: left; border-bottom: 1px solid var(--border);
  min-width: 80px;
}
.stats-row { border-bottom: 1px solid var(--border); }
.stats-row:hover { background: var(--bg2); }
.stats-row-global { background: rgba(255,255,255,.03); font-weight: 600; }
.stats-row-pct { background: none; }
.stats-row-pct .stats-td { color: var(--muted); font-size: .8rem; }
.stats-spacer td { height: 12px; border: none; }

.stats-region-name {
  padding: .45rem .8rem;
  font-weight: 500; color: var(--text); white-space: nowrap;
}
.stats-region-complete { color: var(--green) !important; font-weight: 700; }

.stats-td {
  padding: .4rem .6rem; text-align: center;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.stats-td.stats-complete {
  color: var(--green); font-weight: 700;
}
.stats-td.stats-slash { color: var(--muted); }
.stats-td.stats-pct { color: var(--muted); font-size: .8rem; }
.stats-td.stats-pct.stats-complete { color: var(--green); }

/* ── Séparateur de groupe evo_spe ───────────────── */
.evo-group-header td {
  padding: .5rem 1rem;
  background: var(--bg3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.evo-group-label { font-weight: 600; font-size: .88rem; color: var(--text); }
.evo-group-count { float: right; font-size: .78rem; color: var(--muted); }

/* ── Carte classements (pokedex.php) ─────────────── */
.ranking-card {
  display: flex; align-items: center; gap: 1rem;
  background: linear-gradient(135deg, rgba(245,197,24,.08), rgba(245,197,24,.03));
  border: 1px solid rgba(245,197,24,.3);
  border-radius: var(--radius); padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  transition: border-color .2s, background .2s;
  text-decoration: none; color: inherit;
}
.ranking-card:hover { border-color: var(--gold); background: rgba(245,197,24,.12); }
.ranking-card-icon { font-size: 2rem; flex-shrink: 0; }
.ranking-card-info { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.ranking-card-title { font-family: var(--font-title); font-size: 1.4rem; letter-spacing: .04em; color: var(--gold); }
.ranking-card-desc  { font-size: .82rem; color: var(--muted); }

/* ── En-tête section dresseurs ───────────────────── */
.home-section-header {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: .3rem;
}
.home-section-header .home-title { margin-bottom: 0; }
#search-trainer {
  flex: 1; min-width: 160px; max-width: 280px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px;
  padding: .4rem .85rem; font-size: .9rem;
  font-family: var(--font-body); outline: none;
  transition: border-color .15s;
}
#search-trainer:focus { border-color: var(--red); }
#search-trainer::placeholder { color: var(--muted); }
.trainer-empty-search {
  text-align: center; color: var(--muted); font-size: .9rem;
  padding: 1.5rem 0;
}

/* ── Page classements ────────────────────────────── */
.ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.ranking-block {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.ranking-title {
  font-family: var(--font-title); font-size: 1.2rem;
  letter-spacing: .04em; margin: 0;
}
.ranking-empty { color: var(--muted); font-size: .85rem; }
.ranking-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .3rem;
}
.ranking-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .35rem .5rem; border-radius: 6px;
  transition: background .12s;
}
.ranking-item:hover { background: var(--bg3); }
.ranking-item-me {
  background: rgba(62,207,106,.08);
  border: 1px solid rgba(62,207,106,.2);
}
.ranking-pos {
  width: 28px; text-align: center; flex-shrink: 0;
  font-size: .88rem; font-weight: 700; color: var(--muted);
}
.ranking-name {
  flex: 1; font-size: .9rem; font-weight: 500;
  color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ranking-name:hover { color: var(--gold); }
.ranking-score {
  font-size: .88rem; font-weight: 600; color: var(--gold);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.ranking-my-rank {
  font-size: .8rem; color: var(--muted);
  background: var(--bg3); border-radius: 6px;
  padding: .45rem .7rem; margin-top: .2rem;
}
.ranking-my-rank strong { color: var(--text); }

@media (max-width: 640px) {
  .ranking-grid { grid-template-columns: 1fr; gap: 1rem; }
  .home-section-header { flex-direction: column; align-items: flex-start; }
  #search-trainer { max-width: 100%; width: 100%; }
}

/* ── Icônes statuts images (shadow/purify) ───────── */
.statut-icon {
  width: 20px; height: 20px;
  object-fit: contain; vertical-align: middle;
  display: inline-block;
}
/* Dans les boutons de statut */
.status-btn .statut-icon { width: 18px; height: 18px; }
/* Dans les en-têtes de colonnes */
.th-icon .statut-icon { width: 18px; height: 18px; }
/* Dans les boutons tri-état */
.tri-btn .statut-icon { width: 16px; height: 16px; }
/* Dans les classements */
.ranking-title .statut-icon { width: 22px; height: 22px; }

/* ── Édition inline (gestion_spe) ────────────────── */
.td-editable { min-width: 120px; }
.display-val { font-size: .88rem; }
.val-empty   { color: var(--muted); font-style: italic; }
.edit-form   { display: none; }
.edit-input {
  width: 100%; max-width: 160px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px;
  padding: .3rem .6rem; font-size: .82rem;
  font-family: var(--font-body); outline: none;
  transition: border-color .15s;
}
.edit-input:focus { border-color: var(--gold); }
.edit-btn, .save-btn, .cancel-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); background: none;
  font-size: .9rem; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.edit-btn:hover   { background: var(--bg3); border-color: var(--gold); }
.save-btn:hover   { background: rgba(62,207,106,.12); border-color: var(--green); }
.cancel-btn:hover { background: rgba(227,53,13,.1); border-color: var(--red); }

/* ── Onglet "Autres listes" sur deux lignes ──────── */
.region-tab-dropdown .rt-name {
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  max-width: 52px;
}

/* ── Titres de section stats ─────────────────────── */
.stats-section-title {
  font-family: var(--font-title); font-size: 1.4rem;
  letter-spacing: .04em; margin: 2rem 0 .75rem;
  color: var(--text);
}

/* ── Page gestion_dresseurs ──────────────────────── */
.gd-alert { padding: .65rem 1rem; border-radius: 8px; margin-bottom: 1.2rem; font-size: .9rem; }
.gd-alert-ok  { background: rgba(62,207,106,.1); border: 1px solid var(--green); color: var(--green); }
.gd-alert-err { background: rgba(227,53,13,.1);  border: 1px solid var(--red);   color: #f97066; }

.gd-grid { display: flex; flex-direction: column; gap: 1rem; }

.gd-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.gd-card-header {
  display: flex; align-items: center; gap: .85rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.gd-card-info { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.gd-pseudo    { font-weight: 600; font-size: 1rem; }
.gd-meta      { font-size: .8rem; color: var(--muted); }
.gd-discord-id { font-size: .72rem; color: var(--muted); font-family: monospace; opacity: .7; }
.gd-badge-admin      { color: var(--gold); }
.gd-badge-superadmin { color: var(--gold); font-weight: 700; }

.gd-section { border-bottom: 1px solid var(--border); }
.gd-section:last-child { border-bottom: none; }
.gd-section summary {
  padding: .65rem 1.1rem; cursor: pointer;
  font-size: .85rem; font-weight: 500; color: var(--muted);
  list-style: none; display: flex; align-items: center; gap: .4rem;
  transition: background .12s, color .12s;
}
.gd-section summary:hover { background: var(--bg3); color: var(--text); }
.gd-section[open] summary { color: var(--text); }

.gd-section-inline {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1.1rem;
}
.gd-section-label { font-size: .85rem; font-weight: 500; color: var(--muted); }
.gd-section-danger { padding: .65rem 1.1rem; }

.gd-form { display: flex; gap: .5rem; padding: .65rem 1.1rem; flex-wrap: wrap; }
.gd-input {
  flex: 1; min-width: 160px;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px;
  padding: .4rem .75rem; font-size: .88rem;
  font-family: var(--font-body); outline: none;
  transition: border-color .15s;
}
.gd-input:focus { border-color: var(--gold); }
.gd-btn {
  padding: .4rem .9rem; border-radius: 6px; border: none;
  font-size: .85rem; font-weight: 500; font-family: var(--font-body);
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.gd-btn-primary   { background: var(--gold); color: #000; }
.gd-btn-primary:hover { background: #d4a800; }
.gd-btn-secondary { background: var(--bg3); border: 1px solid var(--border); color: var(--muted); }
.gd-btn-secondary:hover { color: var(--text); }
.gd-btn-danger    { background: var(--red); color: #fff; }
.gd-btn-danger:hover { background: #c42d0b; }
.gd-btn:disabled  { opacity: .4; cursor: not-allowed; }

/* Modal suppression */
.gd-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.gd-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  max-width: 480px; width: 100%;
  display: flex; flex-direction: column; gap: 1rem;
}
.gd-modal-title { font-family: var(--font-title); font-size: 1.5rem; }
.gd-modal-body  { font-size: .9rem; color: var(--muted); line-height: 1.6; }
.gd-modal-body strong { color: var(--text); }
.gd-modal-confirm-label { font-size: .85rem; color: var(--muted); }
.gd-modal-confirm-label strong { color: var(--red); }
.gd-modal-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; }

/* ── Bouton export Excel ─────────────────────────── */
.session-btn-export {
  background: rgba(72,187,120,.15);
  border-color: #48bb78;
  color: #48bb78;
}
.session-btn-export:hover { background: rgba(72,187,120,.3); }

/* ── Wishlist ────────────────────────────────────── */
.wl-topbar {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.wl-count { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.wl-create-form { display: flex; gap: .5rem; flex: 1; }
.wl-create-form .gd-input { max-width: 280px; }

.wl-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 1.25rem;
  overflow: hidden;
}
.wl-card-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.1rem;
  background: var(--bg3); border-bottom: 1px solid var(--border);
}
.wl-card-title { font-family: var(--font-title); font-size: 1.2rem; letter-spacing: .03em; flex: 1; }
.wl-card-count { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.wl-card-actions { display: flex; gap: .3rem; }

.wl-btn {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; padding: .25rem .55rem;
  font-size: .85rem; cursor: pointer; color: var(--muted);
  transition: all .12s;
}
.wl-btn:hover { color: var(--text); border-color: rgba(255,255,255,.25); }
.wl-btn-delete:hover  { color: #f97066; border-color: var(--red); }
.wl-btn-remove-item:hover { color: #f97066; border-color: var(--red); }

.wl-table { margin: 0; }

@media (max-width: 640px) {
  .wl-table { display: block; overflow-x: auto; }
  .session-btn-export { display: none; }
}
.wl-empty, .wl-full {
  padding: .75rem 1.1rem; font-size: .85rem; color: var(--muted); font-style: italic;
}

.wl-add-form {
  padding: .65rem 1.1rem;
  border-top: 1px solid var(--border);
  position: relative;
}
.wl-search-input { max-width: 320px; }

.wl-autocomplete {
  position: fixed; z-index: 500;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; min-width: 280px;
  max-height: 260px; overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  display: none;
}
.wl-autocomplete.open { display: block; }
.wl-ac-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .75rem; cursor: pointer;
  font-size: .88rem; transition: background .1s;
}
.wl-ac-item:hover { background: var(--bg3); }

/* Bouton wishlist sur trainer-card */
.trainer-wishlist-btn {
  font-size: 1.1rem; padding: .3rem .5rem;
  border-radius: 6px; border: 1px solid var(--border);
  background: none; color: var(--muted); text-decoration: none;
  transition: all .15s; flex-shrink: 0;
}
.trainer-wishlist-btn:hover {
  background: var(--bg3); color: var(--gold); border-color: var(--gold);
}

@media (max-width: 640px) {
  .wl-create-form { flex-direction: column; }
  .wl-create-form .gd-input { max-width: 100%; }
}

/* ── Wishlist priorité & active ─────────────────── */
.wl-btn-active {
  color: var(--green); border-color: var(--green);
  background: rgba(62,207,106,.1);
  font-size: .78rem; padding: .25rem .55rem;
}
.wl-btn-active:hover { background: rgba(62,207,106,.2); }
.wl-btn-inactive {
  color: var(--muted); border-color: var(--border);
  font-size: .78rem; padding: .25rem .55rem;
}
.wl-btn-inactive:hover { color: var(--green); border-color: var(--green); }
.wl-btn-move { font-size: .9rem; padding: .2rem .45rem; }
.wl-btn-move:disabled { opacity: .25; cursor: not-allowed; }

.wl-card-inactive { opacity: .65; }
.wl-section-disabled { margin-top: 1.5rem; }
.wl-section-title {
  font-size: .82rem; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .6rem;
}

/* ── Se souvenir de moi ─────────────────────────── */
.login-remember { margin: .75rem 0 1rem; }
.remember-label {
  display: inline-flex; align-items: center; gap: .55rem;
  cursor: pointer; font-size: .88rem; color: var(--muted);
  user-select: none;
}
.remember-label input[type="checkbox"] { display: none; }
.remember-box {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid var(--border); border-radius: 4px;
  background: var(--bg3); transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.remember-label input:checked + .remember-box {
  background: var(--gold); border-color: var(--gold);
}
.remember-label input:checked + .remember-box::after {
  content: '✓'; font-size: .78rem; color: #000; font-weight: 700;
}
.remember-hint { font-size: .78rem; opacity: .6; }

/* ── Pokémon non disponibles (afficher_pokemon = 0) ── */
.pokemon-row.not-available { opacity: .45; }
.pokemon-row.not-available .status-btn { cursor: not-allowed; }

/* ── Panneau chaîne d'évolution ─────────────────── */
#chaine-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 600;
  transition: opacity .2s;
}
#chaine-overlay.visible { display: block; }

#chaine-panel {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 700;
  background: var(--bg2); border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  max-height: 70vh; display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
#chaine-panel.open { transform: translateY(0); }

.chaine-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.2rem .6rem;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.chaine-panel-title {
  font-family: var(--font-title); font-size: 1.2rem; letter-spacing: .04em;
}
#chaine-close {
  background: none; border: none; color: var(--muted);
  font-size: 1.3rem; cursor: pointer; padding: .2rem .5rem;
  border-radius: 6px; transition: background .12s;
}
#chaine-close:hover { background: var(--bg3); color: var(--text); }

#chaine-content { overflow-y: auto; padding: .75rem 1rem 1.5rem; }

.chaine-loading, .chaine-empty, .chaine-error {
  color: var(--muted); font-size: .88rem; padding: 1rem 0; text-align: center;
}
.chaine-error { color: #f97066; }

.chaine-list { display: flex; flex-direction: column; gap: .6rem; }

.chaine-membre {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; padding: .6rem .8rem;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg3); flex-wrap: wrap;
}
.chaine-membre-actif {
  border-color: var(--gold);
  background: rgba(245,197,24,.06);
}
.chaine-membre-indispo { opacity: .5; }

.chaine-membre-info {
  display: flex; align-items: center; gap: .65rem; flex-shrink: 0;
}
.chaine-membre-meta { display: flex; flex-direction: column; gap: .1rem; }
.chaine-membre-nom { font-weight: 600; font-size: .92rem; }
.chaine-membre-num { font-size: .75rem; color: var(--muted); }

.chaine-membre-statuts {
  display: grid;
  grid-template-columns: repeat(8, 36px);
  gap: .25rem;
  align-items: center;
}
.chaine-statut-placeholder {
  width: 36px; height: 36px; /* cellule vide pour aligner */
}
.chaine-indispo { font-size: .78rem; color: var(--muted); font-style: italic; }

/* Trigger cliquable sur le nom */
.chaine-trigger {
  cursor: pointer; text-decoration: none; color: inherit;
  border-bottom: 1px dashed var(--muted); transition: color .12s, border-color .12s;
  background: none; border-left: none; border-top: none; border-right: none;
  padding: 0; font: inherit;
}
.chaine-trigger:hover { color: var(--gold); border-bottom-color: var(--gold); }

@media (max-width: 640px) {
  #chaine-panel { max-height: 85vh; }
  .chaine-membre { flex-direction: column; align-items: flex-start; }
}

/* ── Badge nombre de wishlists ───────────────────── */
.wl-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 3px;
  background: var(--gold); color: #000;
  font-size: .65rem; font-weight: 700; border-radius: 8px;
  margin-left: 2px; vertical-align: middle; line-height: 1;
}

/* ── Bouton langue FR/EN ─────────────────────────── */
#lang-toggle-btn {
  padding: .3rem .65rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg3);
  color: var(--text); font-size: .78rem; font-weight: 700;
  font-family: var(--font-body); cursor: pointer; letter-spacing: .06em;
  transition: all .15s; white-space: nowrap;
}
#lang-toggle-btn:hover { border-color: var(--gold); color: var(--gold); }
.poke-name-en { }

/* ── Image drapeau dans le bouton langue ─────────── */
.lang-flag {
  width: 18px; height: 18px;
  object-fit: cover; border-radius: 2px;
  vertical-align: middle; margin-right: 2px;
}

/* ── Bouton langue sur mobile ────────────────────── */
@media (max-width: 640px) {
  #lang-toggle-btn { padding: .3rem .4rem; }
  #lang-toggle-btn .lang-flag { margin-right: 0; width: 22px; height: 22px; }
  #lang-toggle-btn .lang-text { display: none; }
}

/* ── Largeur fixe colonnes statuts ───────────────── */
.th-status, .td-status {
  width: 56px; min-width: 56px; max-width: 56px;
  text-align: center;
}

/* ── Navbar : Menu dresseur aligné gauche ────────── */
.region-tab-menu { font-weight: 600; }
.region-dropdown-separator {
  height: 1px; background: var(--border);
  margin: .35rem .5rem;
}

/* ── Navbar : onglet Dex de + page courante ─────── */
.region-tab-dex {
  flex-direction: row !important; align-items: center; gap: .4rem;
  color: var(--text) !important; white-space: normal;
}
.region-tab-dex .rt-name { color: var(--text); line-height: 1.2; white-space: normal; }
.region-tab-dex .statut-icon { width: 20px; height: 20px; flex-shrink: 0; }
.region-tab-current {
  cursor: default; pointer-events: none;
  color: var(--gold);
  justify-content: center;
}
.region-tab-current .rt-name { color: var(--gold); display: flex; align-items: center; gap: .3rem; }
