:root {
  --bg: #1e1f22;
  --bg-soft: #2b2d31;
  --bg-card: #313338;
  --border: #3f4147;
  --text: #f2f3f5;
  --text-muted: #b5bac1;
  --accent: #5865f2;
  --accent-hover: #4752c4;
  --success: #23a559;
  --danger: #f23f43;
  --gold: #f0b232;
}

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

body {
  font-family: "gg sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); }

/* ---------- Page d'accueil ---------- */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 30% 20%, #2b2d31 0%, #1e1f22 70%);
}

.landing-card {
  max-width: 440px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.landing-logo {
  font-size: 48px;
  color: var(--accent);
  margin-bottom: 12px;
}

.landing-card h1 {
  font-size: 32px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.landing-subtitle {
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 28px;
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 13px 24px;
  border-radius: 8px;
  transition: background 0.15s;
}

.btn-discord:hover { background: var(--accent-hover); }

.landing-note {
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.error-box {
  background: rgba(242, 63, 67, 0.12);
  border: 1px solid var(--danger);
  color: #fca5a5;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.4;
}

/* ---------- Dashboard ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.topbar-logo { color: var(--accent); font-size: 22px; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-card);
}

.btn-logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.15s, border-color 0.15s;
}

.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.card h2 {
  font-size: 18px;
  margin-bottom: 18px;
}

.card h3 {
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* Profil */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.xp-bar {
  height: 14px;
  background: var(--bg-soft);
  border-radius: 7px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #7983f5);
  border-radius: 7px;
  transition: width 0.6s ease;
}

.xp-bar-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

/* Quêtes */
.quests-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.quest-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.quest {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 10px 12px;
}

.quest.completed { outline: 1px solid var(--success); }

.quest-desc { font-size: 13px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.quest-progress-text { color: var(--text-muted); white-space: nowrap; }

.quest-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.quest-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.quest.completed .quest-bar-fill { background: var(--success); }

.quest-empty { color: var(--text-muted); font-size: 13px; }

/* Serveur */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

/* Classements */
.leaderboard { width: 100%; border-collapse: collapse; font-size: 14px; }

.leaderboard th {
  text-align: left;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.leaderboard td { padding: 9px 10px; border-bottom: 1px solid var(--bg-soft); }
.leaderboard tr:last-child td { border-bottom: none; }
.leaderboard tr.me td { background: rgba(88, 101, 242, 0.12); }
.leaderboard .member-cell { display: flex; align-items: center; gap: 10px; }
.leaderboard .member-cell img { width: 26px; height: 26px; border-radius: 50%; }
.leaderboard .rank-1 { color: var(--gold); font-weight: 700; }
.leaderboard .rank-2 { color: #c8ccd2; font-weight: 700; }
.leaderboard .rank-3 { color: #cd7f32; font-weight: 700; }

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 700px) {
  .two-columns { grid-template-columns: 1fr; }
}

/* Événements */
.event-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.event {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 12px 16px;
}

.event-name { font-weight: 600; }
.event-meta { color: var(--text-muted); font-size: 13px; }

.empty-note { color: var(--text-muted); font-size: 13px; }
