/* ═══════════════════════════════════════════════════════════════════════
   STREAMLOG — Profil, membres, classement, badges
   Prolonge le langage des fiches et du catalogue. Aucune couleur en dur :
   tout dérive des tokens, donc du thème clair ou sombre du site.
   ═══════════════════════════════════════════════════════════════════════ */

.stl-member {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px 40px;
  color: var(--stl-text);
  font-family: var(--stl-sans);
}

/* ═══ 1. En-tête ═══════════════════════════════════════════════════════ */
.stl-member-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px 40px;
  align-items: end;
  padding: 12px 0 26px;
  border-bottom: 1px solid var(--stl-border);
}

.stl-member-id {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
}
.stl-member-avatar img {
  display: block;
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 1px solid var(--stl-border);
}
.stl-member-identity { min-width: 0; }
.stl-member-name {
  font-family: var(--stl-serif);
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 600;
  letter-spacing: -.022em;
  line-height: 1.05;
  margin: 8px 0 0;
}
.stl-member-mail {
  margin: 6px 0 0;
  font-family: var(--stl-mono);
  font-size: 11.5px;
  color: var(--stl-text-muted);
}

/* ── Chiffres clés ────────────────────────────────────────────────────── */
.stl-member-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
}
.stl-member-stats > div {
  padding: 0 20px;
  border-left: 1px dotted var(--stl-border);
}
.stl-member-stats > div:first-child { padding-left: 0; border-left: none; }
.stl-member-stats > div:last-child { padding-right: 0; }
.stl-member-stats dt {
  font-family: var(--stl-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--stl-text-muted);
  margin-bottom: 5px;
}
.stl-member-stats dd {
  margin: 0;
  font-family: var(--stl-serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--stl-text);
}
.stl-member-stats dd span {
  font-family: var(--stl-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--stl-text-muted);
  margin-left: 3px;
}

/* ── Barre d'expérience ───────────────────────────────────────────────── */
.stl-member-xp { grid-column: 1 / -1; }
.stl-member-xp-label {
  margin: 8px 0 0;
  font-family: var(--stl-mono);
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--stl-text-muted);
}
.stl-member-xp-label strong { color: var(--stl-text); font-weight: 500; }

/* Jauge générique, réutilisée partout (séries, XP, badges) */
.stl-meter {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--stl-surface-3);
  overflow: hidden;
}
.stl-meter i {
  display: block;
  height: 100%;
  background: var(--stl-primary);
  border-radius: inherit;
  transition: width .5s ease;
}
.stl-meter--thin { height: 2px; margin-top: 7px; max-width: 260px; }

/* ═══ 2. Onglets ═══════════════════════════════════════════════════════ */
.stl-member-tabs { margin: 22px 0 34px; }
.stl-chips--tabs { margin-bottom: 22px; }

.stl-member-body {
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.stl-member-cta { margin: 4px 0 0; }

/* ═══ 3. Journal (onglet « Tout ») ═════════════════════════════════════ */
.stl-log {
  display: flex;
  flex-direction: column;
}
.stl-log-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--stl-border);
  color: inherit;
  text-decoration: none;
  transition: background var(--stl-transition);
}
.stl-log-row:first-child { border-top: 1px solid var(--stl-border); }
.stl-log-row:hover { background: var(--stl-surface); }

.stl-log-thumb {
  flex: 0 0 44px;
  width: 44px; height: 66px;
  border-radius: var(--stl-radius-sm);
  overflow: hidden;
  border: 1px solid var(--stl-border);
  background: var(--stl-surface-2);
}
.stl-log-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stl-log-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 19px; opacity: .35;
}

.stl-log-main { flex: 1; min-width: 0; }
.stl-log-kind {
  display: block;
  font-family: var(--stl-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--stl-text-muted);
}
.stl-log-title {
  display: block;
  font-family: var(--stl-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--stl-text);
  margin: 2px 0 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stl-log-row:hover .stl-log-title { color: var(--stl-primary); }
.stl-log-meta {
  display: block;
  font-family: var(--stl-mono);
  font-size: 11px;
  color: var(--stl-text-muted);
}
.stl-log-when {
  flex: 0 0 auto;
  font-family: var(--stl-mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  color: var(--stl-text-muted);
  text-align: right;
  white-space: nowrap;
}

/* ═══ 4. Lignes de série ═══════════════════════════════════════════════ */
.stl-rows { display: flex; flex-direction: column; gap: 8px; }
.stl-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--stl-border);
  border-radius: var(--stl-radius);
  background: var(--stl-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--stl-transition), transform var(--stl-transition);
}
.stl-row:hover { border-color: var(--stl-text); transform: translateX(2px); }

.stl-row-thumb {
  flex: 0 0 46px;
  width: 46px; height: 69px;
  border-radius: var(--stl-radius-sm);
  overflow: hidden;
  border: 1px solid var(--stl-border);
  background: var(--stl-surface-2);
}
.stl-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stl-row-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 19px; opacity: .35;
}

.stl-row-main { flex: 1; min-width: 0; }
.stl-row-title {
  display: block;
  font-family: var(--stl-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--stl-text);
  margin-bottom: 3px;
}
.stl-row:hover .stl-row-title { color: var(--stl-primary); }
.stl-row-meta {
  display: block;
  font-family: var(--stl-mono);
  font-size: 11px;
  color: var(--stl-text-muted);
}

.stl-row-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  text-align: right;
}
.stl-row-flag {
  padding: 2px 9px;
  border: 1px solid color-mix(in srgb, var(--stl-green) 40%, transparent);
  border-radius: 999px;
  background: var(--stl-green-dim);
  color: var(--stl-green);
  font-family: var(--stl-mono);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.stl-row-when {
  font-family: var(--stl-mono);
  font-size: 10.5px;
  color: var(--stl-text-muted);
  white-space: nowrap;
}

/* ═══ 5. Journal d'expérience ══════════════════════════════════════════ */
.stl-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stl-timeline-item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 8px;
  border-bottom: 1px dotted var(--stl-border);
}
.stl-timeline-item:last-child { border-bottom: none; }
.stl-timeline-icon { flex: 0 0 20px; font-size: 15px; line-height: 1.4; }
.stl-timeline-body { flex: 1; min-width: 0; }
.stl-timeline-label {
  display: block;
  font-size: 14px;
  color: var(--stl-text);
}
.stl-timeline-label a {
  color: var(--stl-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--stl-border-hover);
}
.stl-timeline-label a:hover { color: var(--stl-primary); text-decoration-color: currentColor; }
.stl-timeline-date {
  display: block;
  margin-top: 2px;
  font-family: var(--stl-mono);
  font-size: 10.5px;
  color: var(--stl-text-muted);
}
.stl-timeline-xp {
  flex: 0 0 auto;
  font-family: var(--stl-mono);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--stl-text-dim);
  white-space: nowrap;
}

/* ═══ 6. Compléments de cartes (profil) ═══════════════════════════════ */
.stl-tile-note {
  margin: 5px 0 0;
  font-family: var(--stl-serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.4;
  color: var(--stl-text-muted);
}
.stl-tile-flag {
  position: absolute;
  left: 8px; bottom: 8px;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--stl-gold-dim);
  border: 1px solid color-mix(in srgb, var(--stl-gold) 40%, transparent);
  color: var(--stl-gold);
  font-family: var(--stl-mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stl-tile.is-inert .stl-tile-link { cursor: default; }
.stl-tile.is-inert .stl-tile-frame { opacity: .72; }

@keyframes stlPop {
  0%   { transform: scale(.6); opacity: 0; }
  70%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.stl-new-item-pop { animation: stlPop .4s cubic-bezier(.36,.07,.19,.97) both; }

/* ═══ 7. Classement ════════════════════════════════════════════════════ */
.stl-leaderboard {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
  font-family: var(--stl-sans);
  color: var(--stl-text);
}
.stl-lb-head { padding: 12px 0 26px; }
.stl-lb-title {
  font-family: var(--stl-serif);
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 600;
  letter-spacing: -.022em;
  margin: 10px 0 0;
}

.stl-lb-list { display: flex; flex-direction: column; }
.stl-lb-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12px;
  border-bottom: 1px solid var(--stl-border);
  color: inherit;
  text-decoration: none;
  transition: background var(--stl-transition);
}
.stl-lb-row:first-child { border-top: 1px solid var(--stl-border); }
.stl-lb-row:hover { background: var(--stl-surface); }
.stl-lb-row.is-me { background: var(--stl-primary-dim); }

.stl-lb-rank {
  flex: 0 0 40px;
  font-family: var(--stl-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--stl-text-muted);
  text-align: center;
}
.stl-lb-row:nth-child(1) .stl-lb-rank,
.stl-lb-row:nth-child(2) .stl-lb-rank,
.stl-lb-row:nth-child(3) .stl-lb-rank { color: var(--stl-gold); }

.stl-lb-avatar img {
  display: block;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--stl-border);
}
.stl-lb-identity { flex: 1; min-width: 0; }
.stl-lb-name {
  display: block;
  font-family: var(--stl-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--stl-text);
}
.stl-lb-row:hover .stl-lb-name { color: var(--stl-primary); }
.stl-lb-level {
  display: block;
  font-family: var(--stl-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--stl-text-muted);
  margin-top: 2px;
}
.stl-lb-badges,
.stl-lb-xp {
  flex: 0 0 auto;
  font-family: var(--stl-mono);
  font-size: 11px;
  color: var(--stl-text-muted);
  white-space: nowrap;
}
.stl-lb-xp {
  font-family: var(--stl-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--stl-text);
  min-width: 84px;
  text-align: right;
}
.stl-lb-xp small {
  font-family: var(--stl-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--stl-text-muted);
  margin-left: 3px;
}

.stl-lb-mine {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1.5px solid var(--stl-text);
}
.stl-lb-mine > div {
  padding: 0 22px;
  border-left: 1px dotted var(--stl-border);
}
.stl-lb-mine > div:first-child { padding-left: 0; border-left: none; }
.stl-lb-mine dt,
.stl-lb-mine span {
  display: block;
  font-family: var(--stl-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--stl-text-muted);
  margin-bottom: 5px;
}
.stl-lb-mine dd,
.stl-lb-mine strong {
  display: block;
  margin: 0;
  font-family: var(--stl-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
  color: var(--stl-text);
}

/* ═══ 8. Badges ════════════════════════════════════════════════════════ */
.stl-badges-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px 40px;
  font-family: var(--stl-sans);
  color: var(--stl-text);
}

.stl-xp-profile-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0 26px;
  border-bottom: 1px solid var(--stl-border);
  background: none;
  border-radius: 0;
}
.stl-xp-profile-level { display: flex; align-items: center; gap: 14px; }
.stl-level-big { font-size: 34px; line-height: 1; }
.stl-xp-profile-level .stl-level-name {
  font-family: var(--stl-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--stl-text);
}
.stl-xp-profile-level .stl-level-num {
  font-family: var(--stl-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--stl-text-muted);
}
.stl-xp-profile-right { flex: 1; min-width: 240px; }
.stl-xp-big {
  font-family: var(--stl-serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--stl-text);
}
.stl-xp-big small {
  font-family: var(--stl-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--stl-text-muted);
}
.stl-xp-bar-lg { margin-top: 10px; }
.stl-xp-bar-lg small,
.stl-badges-earned-count {
  display: block;
  margin-top: 7px;
  font-family: var(--stl-mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  color: var(--stl-text-muted);
}

.stl-badges-subtitle {
  font-family: var(--stl-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--stl-text);
  margin: 44px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--stl-text);
}

.stl-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 12px;
}
.stl-badge-card {
  padding: 18px 16px;
  border: 1px solid var(--stl-border);
  border-radius: var(--stl-radius);
  background: var(--stl-surface);
  text-align: center;
  transition: border-color var(--stl-transition), transform var(--stl-transition);
}
.stl-badge-card.earned { border-color: var(--stl-border-hover); }
.stl-badge-card.earned:hover { border-color: var(--stl-text); transform: translateY(-2px); }
.stl-badge-card.locked { opacity: .42; }
.stl-badge-icon { font-size: 32px; line-height: 1; margin-bottom: 10px; }
.stl-badge-name {
  font-family: var(--stl-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--stl-text);
  margin-bottom: 4px;
}
.stl-badge-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--stl-text-muted);
}
.stl-badge-date,
.stl-badge-locked-msg,
.stl-badge-xp-bonus {
  display: block;
  margin-top: 9px;
  font-family: var(--stl-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stl-text-muted);
}
.stl-badge-card.earned .stl-badge-date { color: var(--stl-green); }

/* ═══ 9. Responsive ════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .stl-member-head { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 22px; }
  .stl-member-stats { width: 100%; }
  .stl-member-stats > div { flex: 1 0 auto; padding: 0 16px; }
}

@media (max-width: 760px) {
  .stl-member,
  .stl-leaderboard,
  .stl-badges-wrap { padding: 0 14px 32px; }

  .stl-member-avatar img { width: 62px; height: 62px; }
  .stl-member-id { gap: 14px; }
  .stl-member-stats > div { padding: 0 14px 0 0; border-left: none; }
  .stl-member-stats dd { font-size: 22px; }
  .stl-member-body { gap: 36px; }

  .stl-log-row { gap: 12px; padding: 12px 4px; }
  .stl-log-thumb { flex-basis: 38px; width: 38px; height: 57px; }
  .stl-log-title { font-size: 15px; }
  .stl-log-when { display: none; }

  .stl-row { padding: 10px 12px; gap: 12px; }
  .stl-row-title { font-size: 15px; }
  .stl-row-side { display: none; }

  .stl-lb-row { gap: 12px; padding: 12px 4px; }
  .stl-lb-rank { flex-basis: 28px; font-size: 18px; }
  .stl-lb-badges { display: none; }
  .stl-lb-xp { font-size: 16px; min-width: 62px; }
  .stl-lb-mine > div { padding: 0 16px 0 0; border-left: none; }

  .stl-badges-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .stl-row:hover { transform: none; }
  .stl-badge-card.earned:hover { transform: none; }
  .stl-new-item-pop { animation: none; }
  .stl-meter i { transition: none; }
}
