/* style.css — feuille de style légère, responsive, thèmes clair/sombre.
   Le thème est piloté par l'attribut data-theme sur <html> (côté serveur). */

:root {
  --radius: 12px;
  --gap: 1rem;
  --maxw: 880px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif;
}

/* --- Thème sombre (défaut) --- */
[data-theme="dark"] {
  --bg: #0e1116;
  --surface: #171c24;
  --surface-2: #1f2630;
  --text: #e6edf3;
  --muted: #8b97a6;
  --border: #2a323d;
  --accent: #4aa8ff;
  --accent-text: #04121f;
  --danger: #ff5d5d;
  --success: #3fbf7f;
  --error-bg: #3a1d1d;
  --success-bg: #133024;
}

/* --- Thème clair --- */
[data-theme="light"] {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --text: #1a1f26;
  --muted: #5c6675;
  --border: #d8dee8;
  --accent: #1769d8;
  --accent-text: #ffffff;
  --danger: #d12f2f;
  --success: #1f8f5b;
  --error-bg: #fbe3e3;
  --success-bg: #e2f5ec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Barre supérieure --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); }
.topbar nav { display: flex; align-items: center; gap: 0.75rem; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--accent); }
.theme-form { margin: 0; }
.theme-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2rem; height: 2rem;
  cursor: pointer; font-size: 1rem;
}

/* --- Conteneur --- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 1.5rem auto;
  padding: 0 1rem;
  flex: 1;
}

/* --- Cartes --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card.center { text-align: center; }
h1 { margin-top: 0; font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.85rem; }

/* --- Formulaires --- */
.stack { display: flex; flex-direction: column; gap: 0.6rem; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
label { font-weight: 600; font-size: 0.9rem; }
input[type="text"], input[type="password"], input[type="file"] {
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
}
.alt-input { margin-bottom: 0.4rem; }

/* --- Boutons --- */
button, .primary, .ghost {
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  text-decoration: none;
  display: inline-block;
}
.primary {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  font-weight: 600;
}
.ghost { background: var(--surface-2); color: var(--text); }
.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button:hover { filter: brightness(1.08); }

/* --- Messages flash --- */
.flashes { margin-bottom: 1rem; }
.flash {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
}
.flash-error { background: var(--error-bg); border-color: var(--danger); }
.flash-success { background: var(--success-bg); border-color: var(--success); }

/* --- Tableau joueurs --- */
table.players { width: 100%; border-collapse: collapse; margin-top: 1rem; }
table.players th, table.players td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  margin: 0.1rem;
  font-size: 0.85rem;
}
.inline { display: inline; margin: 0; }
button.x {
  background: transparent;
  border: none;
  color: var(--danger);
  padding: 0 0.2rem;
  font-size: 0.9rem;
}

/* --- Bloc Discord --- */
.discord-block { margin-bottom: 1rem; }
pre.discord {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  max-height: 420px;
  overflow-y: auto;
}
details { margin-bottom: 0.8rem; }
summary { cursor: pointer; font-weight: 600; padding: 0.3rem 0; }

/* --- Pied de page --- */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.2rem;
  border-top: 1px solid var(--border);
}

/* --- Responsive --- */
@media (max-width: 540px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .card { padding: 1rem; }
}
