/* ─── Header profil ──────────────────────────────────────────── */
header {
  background: var(--surface);
  padding: 0 2rem;
  height: 56px;
}
.header-logo {
  font-weight: 900; font-size: 1rem; color: var(--yellow);
  text-decoration: none; white-space: nowrap;
}
.header-logo span {
  color: var(--text-muted); font-weight: 400; font-size: 0.82rem; margin-left: 0.5rem;
}
.header-right { display: flex; align-items: center; gap: 0.75rem; }

/* ─── Page layout ────────────────────────────────────────────── */
.page { max-width: 700px; margin: 0 auto; padding: 2.5rem 1.5rem; }

/* ─── Carte utilisateur ──────────────────────────────────────── */
.user-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 1.5rem 2rem;
  display: flex; align-items: center; gap: 1.25rem; margin-bottom: 2rem;
}
.avatar-wrap { position: relative; flex-shrink: 0; width: 64px; height: 64px; }
.user-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface2); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 900; color: var(--yellow);
  overflow: hidden; cursor: pointer;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-edit-btn {
  position: absolute; bottom: -2px; right: -2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--yellow); border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px; color: #111; font-weight: 900;
  transition: transform 0.15s;
}
.avatar-edit-btn:hover { transform: scale(1.15); }
#avatar-input { display: none; }
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 1.25rem; font-weight: 800; }
.user-sub  { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.discord-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: rgba(88,101,242,0.2); border: 1px solid rgba(88,101,242,0.4);
  color: #a5b4fc; font-size: 0.72rem; font-weight: 600;
  padding: 0.2rem 0.5rem; border-radius: 999px; margin-top: 0.4rem;
}

/* ─── Onglets ────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 2rem; }
.tab-btn {
  padding: 0.65rem 1.25rem; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-muted);
  cursor: pointer; font-size: 0.9rem; font-weight: 600;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--yellow); border-bottom-color: var(--yellow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Stats ──────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem; margin-bottom: 1.5rem;
}
.stats-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.1rem;
}
.stat-card.full { grid-column: 1 / -1; }
.stat-card .val { font-size: 1.8rem; font-weight: 900; color: var(--yellow); line-height: 1; }
.stat-card .lbl { font-size: 0.73rem; color: var(--text-muted); margin-top: 0.3rem; }
.stat-card.streak .val { color: #fb923c; }

.section-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem;
}

/* ─── Formulaires ────────────────────────────────────────────── */
.form-section { margin-bottom: 2rem; }
.form-row { margin-bottom: 0.75rem; }
.form-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.35rem; display: block; }
.form-field {
  width: 100%; padding: 0.65rem 0.9rem;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 8px; color: var(--text); font-size: 0.9rem; outline: none;
  transition: border-color 0.15s;
}
.form-field:focus { border-color: var(--yellow); }
.form-field::placeholder { color: var(--text-muted); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.3rem; }

/* Force mot de passe */
.pwd-strength { display: flex; gap: 3px; margin-top: 0.4rem; }
.pwd-strength span {
  flex: 1; height: 3px; border-radius: 2px;
  background: var(--input-border); transition: background 0.2s;
}
.pwd-strength[data-level="1"] span:nth-child(1)  { background: var(--red); }
.pwd-strength[data-level="2"] span:nth-child(-n+2) { background: #fb923c; }
.pwd-strength[data-level="3"] span:nth-child(-n+3) { background: #facc15; }
.pwd-strength[data-level="4"] span { background: #4ade80; }
.pwd-rules { margin-top: 0.4rem; display: flex; flex-direction: column; gap: 0.2rem; }
.pwd-rule { font-size: 0.73rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.3rem; }
.pwd-rule.ok { color: #4ade80; }
.pwd-rule::before { content: '○'; font-size: 0.6rem; }
.pwd-rule.ok::before { content: '●'; }

.form-submit {
  padding: 0.65rem 1.5rem; border-radius: 8px; border: none;
  background: var(--yellow); color: #111; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; transition: background 0.15s;
}
.form-submit:hover { background: #e6be00; }
.form-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.divider { height: 1px; background: var(--border); margin: 1.75rem 0; }

.alert { border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 1rem; font-size: 0.83rem; }
.alert.error   { background: rgba(227,21,55,0.12);  border: 1px solid rgba(227,21,55,0.3);  color: #f87171; }
.alert.success { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.3);  color: #4ade80; }

/* ─── Compte ─────────────────────────────────────────────────── */
.account-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 0.75rem;
}
.account-row .ar-label { font-size: 0.78rem; color: var(--text-muted); }
.account-row .ar-value { font-size: 0.9rem; font-weight: 600; }
.account-row .ar-action {
  font-size: 0.78rem; color: var(--yellow); cursor: pointer;
  background: none; border: none; text-decoration: underline dotted;
}

/* ─── Minijeux ───────────────────────────────────────────────── */
.mg-empty { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.mg-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.4rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.7rem 1rem; margin-bottom: 0.5rem;
}
.mg-name { font-weight: 700; font-size: 0.88rem; min-width: 120px; }
.mg-numbers { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.mg-stat { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.mg-stat strong { color: var(--text); font-weight: 700; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 500px) {
  header { padding: 0 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .user-card { padding: 1rem; }
  .page { padding: 1.5rem 1rem; }
}
