:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --text: #e8e8ea;
  --muted: #9a9ea6;
  --accent: #e67e22;
  --accent-hover: #d3701a;
  --border: #2a2e37;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

body.centered {
  justify-content: center;
  padding: 16px;
}

.page-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  flex: 1;
}

.top-nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.top-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.top-nav .brand-logo {
  width: 32px;
  height: 32px;
}

.server-switcher {
  position: relative;
  flex-shrink: 0;
}

/* Le sélecteur de serveur réutilise exactement le look de .brand : seul le changement de balise
   (bouton au lieu de lien) trahit qu'il ouvre un menu plutôt que de naviguer directement. */
.server-switcher-button {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

.server-switcher-button:disabled {
  cursor: default;
}

.server-switcher-button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.server-switcher-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.server-switcher-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Menu de choix du serveur pour la connexion (accueil des serveurs) : aligné sur le bouton, à droite de la barre. */
.login-switcher .server-switcher-menu {
  left: auto;
  right: 0;
}

.server-switcher-menu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
}

.server-switcher-menu li a:hover {
  background: var(--bg);
}

.server-switcher-menu li a[aria-current="true"] {
  color: var(--accent);
}

.top-nav .nav-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.top-nav .nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.top-nav .nav-links a:hover {
  color: var(--text);
}

.top-nav .nav-connexion {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  flex-shrink: 0;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, color 0.15s ease;
  overflow: hidden;
}

.top-nav .nav-connexion:hover {
  border-color: var(--accent);
  color: var(--text);
}

.top-nav .nav-connexion img.nav-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.top-nav .nav-connexion img.nav-discord-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.placeholder-page {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.placeholder-page h1 {
  margin-top: 0;
}

.admin-page {
  width: 100%;
  max-width: 720px;
  padding: 16px;
}

.admin-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
}

.admin-section h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.admin-note {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-config-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
}

.admin-config-list dt {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-config-list dd {
  margin: 0;
  font-size: 0.85rem;
  font-family: "Consolas", monospace;
  overflow-wrap: anywhere;
}

.admin-roadmap {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
  padding-left: 20px;
}

.server-switcher-menu .admin-link {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
}

.hero-banner {
  width: 100%;
  height: 50vh;
  min-height: 220px;
  background-image: url("assets/banniere-taverne.jpg");
  background-size: cover;
  background-position: center 40%;
  position: relative;
  flex-shrink: 0;
}

.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(15, 17, 21, 0) 60%, var(--bg) 100%);
}

.hero-logo {
  width: 96px;
  height: 96px;
  position: absolute;
  left: 50%;
  bottom: -36px;
  transform: translateX(-50%);
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

.hero-spacer {
  margin-top: 52px;
}

/* Logo de l'accueil, sous le titre (dans le bloc .home, masqué avec lui quand la fiche est acceptée). */
.home-logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 28px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.subtitle {
  margin: 0 0 32px;
  color: var(--muted);
}

.home {
  text-align: center;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.form-page {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--text);
}

.fiche-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fiche-form label {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

.fiche-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 1rem;
}

.fiche-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.fiche-form .btn-primary {
  margin-top: 24px;
}
