/* Header partagé — compléments communs à toutes les pages (chargé APRÈS leurs styles) :
   menu mobile (hamburger), fenêtre « Se connecter » (Discord / Twitch / Google), message d'erreur
   de connexion. Le comportement est dans site-nav.js. */

/* Jamais de défilement horizontal : sur mobile, un overflow-x: hidden posé seulement sur <body>
   laisse quand même la page glisser de gauche à droite (iOS / Android). clip ne crée pas de zone
   de défilement, contrairement à hidden. */
html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }

/* ---------- Bouton « Se connecter » unique ---------- */
.btn-login { background: var(--accent); border-color: var(--accent); color: #04141a; }
.btn-login:hover, .btn-login:focus-visible { box-shadow: 0 0 18px rgba(53, 230, 255, 0.4); }

/* ---------- Hamburger ---------- */
.nav-burger {
  display: none; width: 38px; height: 38px; flex-shrink: 0; padding: 0; cursor: pointer;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line-bright); color: var(--ink);
}
.nav-burger svg { width: 18px; height: 18px; }
.nav-burger .ico-close { display: none; }
header.site.menu-open .nav-burger { border-color: var(--accent); color: var(--accent); }
header.site.menu-open .nav-burger .ico-open { display: none; }
header.site.menu-open .nav-burger .ico-close { display: block; }

.mobile-menu {
  display: none;
  position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 49;
  overflow-y: auto; overscroll-behavior: contain;
  background: rgba(5, 7, 13, 0.97); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 20px 40px;
}
.mobile-menu.is-open { display: block; }
.mobile-menu .mm-group { border-bottom: 1px solid var(--line); padding: 6px 0; }
.mobile-menu a.mm-link, .mobile-menu button.mm-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 4px; font-size: 16px; color: var(--ink); text-align: left;
  background: none; border: 0; font-family: var(--font-body); cursor: pointer;
}
.mobile-menu a.mm-sub { padding: 9px 4px 9px 18px; font-size: 14.5px; color: var(--ink-dim); display: block; }
.mobile-menu a.mm-link:active, .mobile-menu a.mm-sub:active { color: var(--accent); }
.mobile-menu .mm-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); padding: 16px 4px 4px;
}
.mobile-menu .mm-socials { display: flex; gap: 10px; padding: 14px 4px; flex-wrap: wrap; }
.mobile-menu .mm-socials .icon-btn { display: flex; }
.mobile-menu .mm-account a.mm-link svg, .mobile-menu .mm-account button.mm-link svg { width: 18px; height: 18px; color: var(--ink-dim); flex-shrink: 0; }
.mobile-menu .mm-account .mm-danger { color: #ff4470; }
/* Défilement bloqué sur <html> et non <body> : sur <body>, le header « sticky » décrochait. */
html.menu-locked { overflow: hidden; }

/* Écrans moyens : connecté (icônes Paris / Studio / admin + puce du compte), le header débordait
   sous 1600 px. Les réseaux sociaux restent dans le pied de page et le menu ☰. */
@media (max-width: 1500px) {
  header.site .nav-actions .social-links { display: none; }
}
@media (max-width: 1200px) {
  header.site nav.primary { gap: 20px; }
  header.site .uname { display: none; }
  header.site .user-chip, header.site .header-user-chip { padding: 3px; gap: 0; }
}
@media (max-width: 980px) {
  header.site nav.primary { display: none; }
  .nav-burger { display: inline-flex; }
  header.site .nav-actions .social-links { display: none; }
  /* Lanppart Studio : outil de bureau, retiré du header sur mobile (toujours accessible sur ordinateur). */
  header.site .studio-nav, header.site .studio-nav.show { display: none !important; }
  header.site .nav-row { gap: 12px; }
}
@media (max-width: 560px) {
  header.site .wrap.nav-row, header.site .header-wrap.nav-row { padding-left: 14px; padding-right: 14px; }
  header.site .brand-logo { height: 32px; max-width: 112px; }
  header.site .nav-actions { gap: 7px; }
  header.site .auth-state { gap: 7px; }
  header.site .icon-btn, .nav-burger { width: 36px; height: 36px; }
  header.site .icon-btn svg { width: 16px; height: 16px; }
  /* Puce du compte réduite à la photo ; la déconnexion passe dans le menu. */
  header.site .uname { display: none; }
  header.site .user-chip, header.site .header-user-chip { padding: 3px; gap: 0; }
  header.site .auth-state a[href$="auth-logout.php"] { display: none; }
  header.site .auth-state .btn-ghost { display: none; }
  header.site .paris-icon-link .caret { display: none; }
}

/* ---------- Fenêtre « Se connecter » ---------- */
.login-dialog {
  width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line);
  background: var(--bg-panel, #0b111e); color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.login-dialog::backdrop { background: rgba(2, 4, 10, 0.72); backdrop-filter: blur(3px); }
.login-dialog .ld-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 22px 6px; }
.login-dialog h3 { font-family: var(--font-display); font-size: 22px; margin: 0; }
.login-dialog .ld-sub { color: var(--ink-dim); font-size: 13.5px; line-height: 1.5; padding: 0 22px 16px; margin: 0; }
.login-dialog .ld-close { background: none; border: 1px solid var(--line-bright); color: var(--ink-dim); width: 32px; height: 32px; font-size: 18px; cursor: pointer; flex-shrink: 0; }
.login-dialog .ld-list { display: flex; flex-direction: column; gap: 10px; padding: 0 22px 22px; }
.login-provider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 16px; font-size: 14.5px; font-weight: 600; font-family: var(--font-body);
  border: 1px solid transparent; color: #fff; text-decoration: none;
  transition: filter .15s ease, box-shadow .15s ease;
}
.login-provider:hover, .login-provider:focus-visible { filter: brightness(1.1); outline: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25); }
.login-provider svg { width: 18px; height: 18px; flex-shrink: 0; }
.login-provider.p-discord { background: #5865f2; }
.login-provider.p-twitch { background: #9146ff; }
.login-provider.p-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.login-dialog .ld-foot { font-size: 11.5px; color: var(--ink-faint); padding: 12px 22px 18px; border-top: 1px solid var(--line); line-height: 1.5; }

/* ---------- Message d'erreur / de confirmation de connexion ---------- */
.lp-toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 200;
  max-width: calc(100vw - 32px); padding: 12px 16px; font-size: 13.5px; line-height: 1.45;
  background: var(--bg-panel-raised, #0f1729); border: 1px solid var(--line-bright); color: var(--ink);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); display: flex; gap: 12px; align-items: flex-start;
}
.lp-toast.err { border-color: #ff4470; }
.lp-toast.ok { border-color: #35e6a0; }
.lp-toast button { background: none; border: 0; color: var(--ink-dim); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }

/* ---------- Fenêtres « deux comptes » / « lie tes comptes » (site-nav.js › account-merge.php) ---------- */
.merge-dialog { width: min(560px, calc(100vw - 24px)); }
.merge-dialog .mg-body { padding: 0 22px; }
.merge-dialog .ld-sub strong { color: var(--ink); }
.mg-cards { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mg-card { flex: 1 1 0; min-width: 0; position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); background: var(--bg-panel-raised, #0f1729); }
.mg-card.kept { border-color: var(--accent); }
.mg-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent), var(--accent-2, #8b6bff)) center / cover no-repeat; color: #05070d; font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.mg-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mg-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-prov { display: flex; flex-wrap: wrap; gap: 4px; }
.mg-p { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-family: var(--font-mono); color: var(--ink-dim); border: 1px solid var(--line-bright); padding: 1px 6px; }
.mg-p svg { width: 11px; height: 11px; }
.mg-facts { font-size: 11.5px; color: var(--ink-faint); line-height: 1.4; }
.mg-kept { position: absolute; top: -9px; right: 8px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--accent); color: #04141a; padding: 1px 6px; }
.mg-plus { color: var(--ink-faint); font-size: 18px; flex-shrink: 0; }
.mg-error { border: 1px solid #ffb648; color: #ffb648; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
.mg-msg { color: #ff4470; font-size: 13px; min-height: 0; margin-top: 6px; }
.mg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 22px 20px; }
.mg-actions .btn { justify-content: center; }
.mg-ghost { background: transparent; border: 1px solid var(--line-bright); color: var(--ink-dim); }
.mg-link { background: none; border: 0; padding: 0; margin-left: auto; color: var(--ink-faint); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-family: var(--font-body); }
.mg-link:hover { color: var(--ink); }
@media (max-width: 560px) {
  .mg-cards { flex-direction: column; align-items: stretch; }
  .mg-plus { text-align: center; }
  .mg-link { margin-left: 0; }
}
