/* =====================================================
   PLIXY PLACE — Styles refonte visuelle v2
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Pas de sélection de texte sur le canvas */
#canvas-wrap, #canvas-wrap * {
  -webkit-user-select: none;
  user-select: none;
}

/* ── MODE CLAIR (défaut) ── */
:root {
  --bg:           #f4f4fb;
  --surface:      #ffffff;
  --surface2:     #f0f0f8;
  --surface3:     #e6e6f2;
  --border:       #d4d4e8;
  --accent:       #6055e8;
  --accent2:      #e84d70;
  --accent3:      #16a97a;
  --text:         #1a1a2e;
  --text-muted:   #6a6a8a;
  --header-h:     56px;
  --toolbar-h:    72px;
  --radius:       14px;
  --radius-sm:    8px;
  --glass:        rgba(255,255,255,0.96);
  --glass-border: rgba(0,0,0,0.10);
  --glass-bar:    rgba(255,255,255,0.68);
}

/* ── MODE SOMBRE ── */
[data-theme="dark"] {
  --bg:           #0b0b10;
  --surface:      #13131c;
  --surface2:     #1c1c28;
  --surface3:     #252535;
  --border:       #2a2a3e;
  --accent:       #7c6ff7;
  --accent2:      #ff6b8a;
  --accent3:      #43e8b0;
  --text:         #eeeef5;
  --text-muted:   #8888aa;
  --glass:        rgba(13,13,22,0.92);
  --glass-border: rgba(255,255,255,0.08);
  --glass-bar:    rgba(13,13,22,0.70);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  height: 100vh; width: 100vw;
}

/* ══════════════════════════════════════════════════════
   INTRO
══════════════════════════════════════════════════════ */
/* ── Intro splash ── */
#intro {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  background: #08080f;
  transition: opacity .6s ease, transform .6s ease;
}
#intro.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

#intro-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: .35;
}

#intro-content {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center;
  z-index: 1;
}

/* Logo lettre par lettre */
#intro-logo {
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
  display: flex;
}
.intro-l {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) scale(.85);
  animation: introLetter .5s cubic-bezier(.22,1,.36,1) calc(var(--i) * 60ms + 100ms) forwards;
  color: var(--accent);
}
.intro-l-sp { color: transparent; width: .35em; }

@keyframes introLetter {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sous-titre */
#intro-sub {
  font-size: .78rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  animation: introFade .7s ease 1s forwards;
}

/* Dots pixel */
#intro-dots {
  display: flex; gap: 7px; align-items: center;
  opacity: 0;
  animation: introFade .4s ease 1.2s forwards;
}
.intro-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--surface3);
  animation: introDot .4s ease forwards;
  animation-delay: calc(1.3s + var(--di, 0) * 120ms);
}
.intro-dot:nth-child(1) { --di:0 }
.intro-dot:nth-child(2) { --di:1 }
.intro-dot:nth-child(3) { --di:2 }
.intro-dot:nth-child(4) { --di:3 }
.intro-dot:nth-child(5) { --di:4 }
.intro-dot:nth-child(6) { --di:5 }
.intro-dot:nth-child(7) { --di:6 }
.intro-dot:nth-child(8) { --di:7 }

@keyframes introDot {
  0%   { background: var(--surface3); transform: scale(1); }
  50%  { background: var(--accent);   transform: scale(1.3); }
  100% { background: linear-gradient(135deg, var(--accent), var(--accent2)); transform: scale(1); }
}

@keyframes introFade { to { opacity:1; } }

/* ══════════════════════════════════════════════════════
   HEADER — flottant, auto-hide
══════════════════════════════════════════════════════ */
#header-trigger {
  position: fixed; top: 0; left: 0; right: 0;
  height: 10px; z-index: 399;
  pointer-events: all;
}

#header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--glass-bar);
  backdrop-filter: blur(36px) saturate(1.4);
  -webkit-backdrop-filter: blur(36px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 2px 16px rgba(0,0,0,.07);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  z-index: 400;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
}
#header.hide-up {
  transform: translateY(calc(-100% - 2px));
}

#logo {
  font-size: 1.25rem; font-weight: 900; letter-spacing: -0.5px;
  white-space: nowrap; flex-shrink: 0;
}
#logo span { color: var(--accent); font-weight: inherit; }

#nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.nav-btn {
  background: transparent; border: none;
  color: var(--text-muted);
  padding: 7px 14px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.84rem; font-weight: 500;
  transition: all .2s;
}
.nav-btn:hover  { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: rgba(124,111,247,.15); color: var(--accent); }

#header-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ── Pastille joueurs (compacte) ── */
#players-wrap {
  display: flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 11px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface2); border-radius: 20px;
  border: 1px solid var(--border);
  cursor: default; flex-shrink: 0;
}
#players-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 6px var(--accent3);
  animation: pulse 2.4s infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1; transform:scale(1)} 50%{opacity:.5; transform:scale(.85)} }

/* ── Menu utilisateur connecté ── */
#user-menu {
  display: flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 11px 0 5px;
  background: var(--surface2); border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer; position: relative; flex-shrink: 0;
}
/* dropdown géré par JS (classe .open) pour éviter la disparition trop rapide */
#user-menu.open #user-dropdown { display: flex; }
#user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--accent);
  background: var(--surface3);
}
#user-pseudo { font-size: 0.83rem; font-weight: 600; }
#user-dropdown {
  display: none; flex-direction: column; gap: 2px;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 6px;
  min-width: 170px; box-shadow: 0 8px 32px rgba(0,0,0,.5);
  z-index: 500;
  animation: dropIn .18s cubic-bezier(.22,1,.36,1);
}
@keyframes dropIn {
  from { opacity:0; transform:translateY(-6px) scale(.97); }
  to   { opacity:1; transform:none; }
}
#user-dropdown button {
  background: none; border: none; color: var(--text);
  text-align: left; padding: 9px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.84rem; width: 100%;
  display: flex; align-items: center; gap: 8px;
}
#user-dropdown button:hover { background: var(--surface3); }
#user-dropdown button .hi { width: 15px; height: 15px; flex-shrink: 0; }
.dropdown-sep {
  border: none; border-top: 1px solid var(--border);
  margin: 4px 6px;
}
#btn-theme-toggle { color: var(--text-muted); font-size: 0.82rem; }
#btn-theme-toggle:hover { color: var(--text); background: var(--surface3); }

/* ── Bouton auth combiné ── */
.btn-auth-combined {
  display: flex; align-items: center; gap: 7px;
  height: 34px;
  background: var(--accent);
  border: none; border-radius: 20px;
  padding: 0 16px;
  color: #fff; cursor: pointer; font-size: 0.84rem; font-weight: 600;
  transition: all .2s; flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(124,111,247,.35);
}
.btn-auth-combined:hover {
  background: #6a5fe0;
  box-shadow: 0 4px 18px rgba(124,111,247,.5);
  transform: translateY(-1px);
}
.btn-auth-icon { font-size: 1rem; }

/* ── Boutons header-right (pill 34px) ── */
.btn-icon-round {
  height: 34px;
  padding: 0 12px;
  border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  font-size: 0.82rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: all .2s; flex-shrink: 0;
}
.btn-icon-round:hover {
  background: var(--surface3); border-color: var(--accent);
  color: var(--accent);
}
/* Boutons icône seule : carré parfait */
#notif-bell { width: 34px; padding: 0; color: var(--text); }
#notif-bell:hover { color: var(--accent); border-color: var(--accent); background: var(--surface3); }
#btn-collapse-header { width: 34px; padding: 0; }
#btn-home:hover {
  border-color: var(--accent3);
  color: var(--accent3);
  background: rgba(67,232,176,0.12);
}
/* ── Bouton thème ── */
#btn-theme { font-size: 1rem; min-width: 34px; }
[data-theme="dark"]  #btn-theme::after { content: ''; }
/* En mode sombre : reflet blanc subtil sous le header */
[data-theme="dark"] #header { box-shadow: 0 2px 20px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.06); }

/* ── Ajustements mode clair ── */
:root:not([data-theme="dark"]) body {
  color-scheme: light;
}
:root:not([data-theme="dark"]) #main-canvas {
  background: #fff;
}
:root:not([data-theme="dark"]) .modal-box,
:root:not([data-theme="dark"]) .modal-box-pixelizer {
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
}
:root:not([data-theme="dark"]) #color-popup {
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 0 0 1px var(--border);
}

/* supprimé : règle migrée dans .btn-icon-round */

/* ── Bouton ré-afficher le header (flottant en haut à droite) ── */
#header-show-btn {
  position: fixed; top: 10px; right: 14px;
  z-index: 401;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  width: 36px; height: 36px; border-radius: 10px;
  cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
#header-show-btn:hover { color: var(--text); border-color: var(--accent); }
#header-show-btn.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════
   PANELS
══════════════════════════════════════════════════════ */
.panel {
  position: fixed; inset: 0;
  z-index: 10;
}
.panel.hidden { display: none !important; }

/* Canvas plein écran */
#panel-canvas { z-index: 1; } /* canvas toujours en fond, panels overlay à z-index:10 */

#canvas-wrap {
  position: fixed; inset: 0;
  overflow: hidden; cursor: crosshair;
  background: #13131f;
  background-image: radial-gradient(circle, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 1;
  transform: translateZ(0); /* layer GPU pour le conteneur */
}
#main-canvas {
  position: absolute;
  image-rendering: pixelated;
  will-change: contents;       /* hint : le contenu du canvas change fréquemment */
  transform: translateZ(0);    /* promotion sur layer GPU dédié */
  backface-visibility: hidden; /* évite les re-compositing inutiles sur certains GPU */
}

/* ── Minimap ── */
#minimap {
  position: absolute;
  top: 12px; /* header masqué → collé en haut */
  left: 12px;
  width: 140px; height: 140px;
  border-radius: 50%;           /* cercle parfait */
  border: none;
  background: #13131f;
  pointer-events: none;
  z-index: 10;
  image-rendering: pixelated;
  box-shadow: 0 4px 28px rgba(0,0,0,.65), 0 0 0 1.5px rgba(120,100,200,.45);
  opacity: 0.88;
  transition: top 0.35s cubic-bezier(.4,0,.2,1), opacity .2s;
}
/* Header visible → minimap descend sous la barre */
body:has(#header:not(.hide-up)) #minimap {
  top: calc(var(--header-h) + 12px);
}
#minimap:hover { opacity: 1; }

#coord-display {
  position: absolute;
  top: calc(12px + 140px + 4px); /* juste sous la minimap */
  left: 12px;
  width: 140px;
  text-align: center;
  font-size: 0.7rem; color: var(--text-muted);
  background: rgba(13,13,20,.8); padding: 4px 9px;
  border-radius: 6px; pointer-events: none;
  border: 1px solid var(--glass-border);
  transition: top 0.35s cubic-bezier(.4,0,.2,1);
  box-sizing: border-box;
}
body:has(#header:not(.hide-up)) #coord-display {
  top: calc(var(--header-h) + 12px + 140px + 4px);
}

#tooltip-pixel {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  font-size: 0.75rem; pointer-events: none; display: none;
  z-index: 500; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

/* ── Panels overlay (Classement / Groupes / Admin) ── */
/* Le canvas reste visible en dessous, on superpose un overlay semi-transparent */
#panel-leaderboard,
#panel-groups,
#panel-admin {
  z-index: 10;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: calc(var(--header-h) + 16px);
  padding-bottom: 24px;
  overflow-y: auto;
}

.panel-overlay-bg {
  position: fixed; inset: 0;
  background: rgba(11,11,16,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: -1;
}

.panel-sheet {
  width: 100%; max-width: 780px;
  margin: 0 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 28px 32px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: sheetIn .3s cubic-bezier(.22,1,.36,1);
}
@keyframes sheetIn {
  from { opacity:0; transform:translateY(20px) scale(.98); }
  to   { opacity:1; transform:none; }
}

.panel-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 20px; }

/* ══════════════════════════════════════════════════════
   BOTTOM TOOLBAR — flottante centrée, améliorée
══════════════════════════════════════════════════════ */
#bottom-toolbar {
  position: fixed;
  bottom: 20px;
  left: 50%; transform: translateX(-50%);
  background: var(--glass-bar);
  backdrop-filter: blur(36px) saturate(1.4);
  -webkit-backdrop-filter: blur(36px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 10px 18px;
  display: flex; align-items: center; gap: 12px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10), 0 0 0 1px rgba(255,255,255,.12);
  white-space: nowrap;
  height: var(--toolbar-h);
}

#toolbar-tools {
  display: flex; align-items: center; gap: 4px;
}

.tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); padding: 8px 12px; border-radius: 14px;
  cursor: pointer; transition: all .18s; min-width: 58px;
}
.tool-btn:hover {
  background: rgba(255,255,255,.07);
  color: var(--text);
  border-color: var(--glass-border);
}
.tool-btn.active {
  background: rgba(124,111,247,.2);
  color: var(--accent);
  border-color: rgba(124,111,247,.4);
  box-shadow: inset 0 0 0 1px rgba(124,111,247,.2);
}
.tool-icon  { font-size: 1.2rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.tool-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

/* ── Heroicons ── */
.hi { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }
.tool-icon .hi { width: 20px; height: 20px; display: block; vertical-align: unset; }
.tool-btn-sm .hi { width: 18px; height: 18px; }
.modal-close .hi, .btn-icon-round .hi { width: 18px; height: 18px; }
.help-acc-head .hi { width: 16px; height: 16px; }
.notif-popup-close .hi, .notif-item-read .hi { width: 14px; height: 14px; }
button > .hi:only-child { display: block; vertical-align: unset; }
/* context-specific icon sizes */
.tool-small .hi       { width: 13px; height: 13px; }
.notif-tab .hi        { width: 14px; height: 14px; }
.px-lib-footer-btn .hi{ width: 13px; height: 13px; }
.px-header-icon .hi   { width: 18px; height: 18px; vertical-align: middle; }
.overlay-bar-label .hi{ width: 14px; height: 14px; }
.adm-action-icon .hi  { width: 16px; height: 16px; display: block; }
.adm-stat-icon .hi    { width: 22px; height: 22px; display: block; margin: 0 auto; }
.prof-stat-icon .hi   { width: 20px; height: 20px; display: block; margin: 0 auto; }
.territory-btn-clear .hi { width: 11px; height: 11px; }
.sc-goto-btn .hi      { width: 11px; height: 11px; }
.notif-add-overlay-btn .hi { width: 12px; height: 12px; }
.px-drop-icon .hi     { width: 56px; height: 56px; display: block; margin: 0 auto; vertical-align: unset; }

.tool-btn-sm {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
  font-size: 1.05rem; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.tool-btn-sm:hover { background: var(--surface3); border-color: var(--accent); color: var(--accent); }

.toolbar-sep {
  width: 1px; height: 30px;
  background: var(--glass-border); margin: 0 2px; flex-shrink: 0;
}
.toolbar-sep-v {
  width: 1px; height: 36px;
  background: var(--glass-border); flex-shrink: 0;
}

#pending-info {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.82rem; color: var(--text-muted);
  padding: 0 4px; min-width: 80px; justify-content: center;
}
#pending-count {
  font-weight: 900; color: var(--accent2); font-size: 1.1rem;
  transition: color .2s;
}
#pending-count.at-limit {
  color: #ff4444;
  animation: limit-pulse 0.8s ease-in-out infinite alternate;
}
@keyframes limit-pulse {
  from { opacity: 1; }
  to   { opacity: 0.55; }
}
.pending-label { font-size: 0.73rem; }
#cooldown-indicator { font-size: 0.75rem; color: var(--accent3); font-weight: 600; }

#toolbar-actions { display: flex; gap: 8px; align-items: center; }

/* Bouton Annuler — plus grand */
.btn-cancel {
  background: transparent;
  border: 1.5px solid rgba(255,107,138,.4);
  color: var(--accent2);
  padding: 9px 16px; border-radius: 12px;
  cursor: pointer; font-size: 0.85rem; font-weight: 600;
  transition: all .2s; white-space: nowrap;
}
.btn-cancel:hover    { background: rgba(255,107,138,.1); border-color: var(--accent2); }
.btn-cancel:disabled { opacity: .3; cursor: not-allowed; }

/* Bouton Appliquer — plus grand, plus visible */
.btn-apply {
  background: linear-gradient(135deg, var(--accent), #5a4fd6);
  color: #fff; border: none;
  padding: 10px 20px; border-radius: 12px;
  cursor: pointer; font-size: 0.88rem; font-weight: 700;
  transition: all .2s; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(124,111,247,.45);
}
.btn-apply:hover    { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(124,111,247,.6); }
.btn-apply:disabled { opacity: .35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-apply.flash    { animation: applyFlash .5s ease; }

@keyframes applyFlash {
  0%  { box-shadow: 0 0 0 0 rgba(124,111,247,.9); }
  70% { box-shadow: 0 0 0 18px rgba(124,111,247,0); }
  100%{ box-shadow: 0 4px 16px rgba(124,111,247,.45); }
}

/* Bouton Partager */
.btn-share {
  display: flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1.5px solid rgba(67,232,176,.4);
  color: var(--accent3);
  padding: 9px 14px; border-radius: 12px;
  cursor: pointer; font-size: 0.82rem; font-weight: 600;
  transition: all .2s; white-space: nowrap;
}
.btn-share:hover {
  background: rgba(67,232,176,.1);
  border-color: var(--accent3);
  transform: translateY(-1px);
}
.btn-share svg { flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   PANEL "MES CRÉATIONS" — miroir de #find-pixels-panel
══════════════════════════════════════════════════════ */
#share-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  max-height: 540px;
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  z-index: 250;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.7);
  animation: popupIn .18s ease;
}
#share-panel.dragged { transform: none; }

#share-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; cursor: grab; user-select: none;
}
#share-panel-header:active { cursor: grabbing; }

#share-panel-title {
  font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: .02em;
}

#share-panel-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px;
  transition: color .15s, background .15s;
}
#share-panel-close:hover { background: rgba(255,255,255,.08); color: var(--text); }


#share-panel-body {
  flex: 1; overflow-y: auto; padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
#share-panel-body::-webkit-scrollbar { width: 4px; }
#share-panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

#share-panel-loading,
#share-panel-empty {
  color: var(--text-muted); font-size: 12px; text-align: center; padding: 20px 0;
}

/* ── Création card (miroir .fp-cluster-card) ── */
.sc-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  transition: background .15s, border-color .15s;
}
.sc-card:hover {
  background: rgba(67,232,176,.05);
  border-color: rgba(67,232,176,.2);
}

.sc-thumb,
.sc-thumb-canvas {
  width: 72px; height: 72px;
  border-radius: 6px; border: 1px solid var(--border);
  flex-shrink: 0; image-rendering: pixelated;
  background: #fff; object-fit: contain; cursor: pointer;
  transition: border-color .15s;
}
.sc-thumb:hover,
.sc-thumb-canvas:hover { border-color: var(--accent3); }

.sc-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.sc-title  { font-size: 12px; font-weight: 700; color: var(--text); }
.sc-detail { font-size: 11px; color: var(--text-muted); }
.sc-coords { font-size: 10px; color: var(--accent3); font-family: monospace; }

.sc-actions {
  display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap;
}

/* → Aller */
.sc-goto-btn {
  background: rgba(124,111,247,.15);
  border: 1px solid rgba(124,111,247,.3);
  color: var(--accent);
  border-radius: 6px; padding: 4px 8px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s;
  display: inline-flex; align-items: center; gap: 3px;
}
.sc-goto-btn:hover { background: rgba(124,111,247,.28); border-color: var(--accent); }

/* Copier image */
.sc-copy-img-btn {
  display: flex; align-items: center; gap: 3px;
  background: rgba(67,232,176,.12);
  border: 1px solid rgba(67,232,176,.25);
  color: var(--accent3);
  border-radius: 6px; padding: 4px 8px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.sc-copy-img-btn:hover  { background: rgba(67,232,176,.24); border-color: var(--accent3); }
.sc-copy-img-btn.copied { background: rgba(67,232,176,.35); }

/* Copier lien */
.sc-copy-link-btn {
  display: flex; align-items: center; gap: 3px;
  background: rgba(255,107,138,.1);
  border: 1px solid rgba(255,107,138,.25);
  color: var(--accent2);
  border-radius: 6px; padding: 4px 8px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.sc-copy-link-btn:hover  { background: rgba(255,107,138,.22); border-color: var(--accent2); }
.sc-copy-link-btn.copied { background: rgba(255,107,138,.35); }

/* Supprimer */
.sc-delete-btn {
  background: rgba(255,107,138,.1);
  border: 1px solid rgba(255,107,138,.2);
  color: var(--accent2);
  border-radius: 6px; padding: 4px 8px;
  font-size: 12px; cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.sc-delete-btn:hover      { background: rgba(255,107,138,.24); border-color: var(--accent2); }
.sc-delete-btn.confirming { background: rgba(255,50,50,.3); border-color: #ff3232; color: #fff; font-weight: 700; }

/* ══════════════════════════════════════════════════════
   COLOR POPUP — flottant, déplaçable (bas-gauche par défaut)
══════════════════════════════════════════════════════ */
#color-popup {
  position: fixed;
  bottom: calc(var(--toolbar-h) + 14px);
  left: 14px;
  background: var(--glass-bar);
  backdrop-filter: blur(36px) saturate(1.4);
  -webkit-backdrop-filter: blur(36px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px;
  z-index: 190;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10), 0 0 0 1px rgba(255,255,255,.12);
  animation: popupIn .22s cubic-bezier(.22,1,.36,1);
  width: 260px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Quand la palette est déplacée manuellement */
#color-popup.dragged { bottom: auto; }
#color-popup.hidden  { display: none; }

@keyframes popupIn {
  from { opacity:0; transform:translateY(10px) scale(.95); }
  to   { opacity:1; transform:translateY(0)    scale(1);   }
}

/* Header draggable + onglets */
#color-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  cursor: grab;
  user-select: none;
  gap: 8px;
}
#color-popup-header:active { cursor: grabbing; }

#color-popup-title {
  font-size: 0.62rem; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .8px;
  flex-shrink: 0;
}

/* Onglets dans le header du popup */
#color-popup-tabs {
  display: flex; gap: 3px;
  background: var(--surface2);
  border-radius: 8px; padding: 2px;
  border: 1px solid var(--border);
}
.popup-tab {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 0.65rem; font-weight: 700;
  padding: 4px 6px; border-radius: 6px;
  transition: all .15s; white-space: nowrap;
  user-select: none; flex: 1; text-align: center;
}
.popup-tab:hover { color: var(--text); }
.popup-tab.active {
  background: var(--accent); color: #fff;
}

/* Contenu des onglets — flex pour remplir la hauteur disponible */
#color-tab-basic,
#color-tab-advanced {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
#color-tab-advanced.hidden,
#color-tab-basic.hidden { display: none !important; }

/* La grille de swatches prend tout l'espace vertical restant */
#colors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 8px;
  flex: 1;
  grid-auto-rows: minmax(24px, 1fr);
  min-height: 0;
}

/* Swatches — remplissent leur cellule */
.color-swatch {
  width: 100%;
  height: 100%;
  min-height: 24px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  /* Pas de transform scale — on évite tout débordement hors du conteneur */
  transition: border-color .14s, box-shadow .14s, filter .14s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.color-swatch:hover {
  filter: brightness(1.15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.color-swatch.active {
  /* Contour inset : reste strictement à l'intérieur de la cellule */
  border-color: #fff;
  box-shadow:
    inset 0 0 0 2px var(--accent),
    inset 0 0 0 1px rgba(255,255,255,.12);
  filter: brightness(1.05);
}

#color-popup-extra {
  display: flex; gap: 5px; justify-content: center;
  border-top: 1px solid var(--glass-border); padding-top: 8px;
  margin-top: 2px;
  flex-shrink: 0;
}
.tool-small {
  flex: 1; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text-muted);
  padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.tool-small:hover    { background: var(--surface3); color: var(--text); border-color: var(--accent); }
.tool-small.active   { background: rgba(124,111,247,.18); color: var(--accent); border-color: var(--accent); }

/* ── Panneau gomme avancée ── */
.eraser-panel {
  border-top: 1px solid var(--glass-border);
  padding-top: 8px; margin-top: 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.eraser-panel.hidden { display: none; }
.eraser-panel-row {
  display: flex; align-items: center; gap: 8px;
}
.eraser-panel-label {
  font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; width: 30px;
}
.eraser-range {
  flex: 1; accent-color: var(--accent); height: 4px; cursor: pointer;
}
.eraser-size-val {
  font-size: 0.68rem; color: var(--accent); font-family: monospace;
  min-width: 30px; text-align: right; flex-shrink: 0;
}
.eraser-shape-btn {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); padding: 4px; border-radius: 6px;
  cursor: pointer; font-size: 0.9rem; transition: all .15s; line-height: 1;
}
.eraser-shape-btn:hover { border-color: var(--accent); background: var(--surface3); }
.eraser-shape-btn.active { background: rgba(124,111,247,.18); border-color: var(--accent); }

/* ── Panneau territoire ── */
.territory-panel {
  border-top: 1px solid var(--glass-border);
  padding-top: 8px; margin-top: 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.territory-panel.hidden { display: none; }
.territory-panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.territory-panel-title {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 600;
}
.territory-btn-clear {
  background: transparent; border: 1px solid rgba(255,107,138,.35);
  color: var(--accent2); padding: 2px 7px; border-radius: 6px;
  cursor: pointer; font-size: 0.67rem; font-weight: 600;
  transition: all .15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.territory-btn-clear:hover { background: rgba(255,107,138,.1); border-color: var(--accent2); }
.territory-list {
  display: flex; flex-direction: column; gap: 3px;
  max-height: 110px; overflow-y: auto;
}
.territory-list::-webkit-scrollbar { width: 4px; }
.territory-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.territory-item {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 6px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
}
.territory-item-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.territory-item-label {
  flex: 1; font-size: 0.67rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.territory-item-del {
  background: transparent; border: none; color: var(--accent2);
  cursor: pointer; font-size: 0.8rem; padding: 0 2px; line-height: 1;
  opacity: 0.6; transition: opacity .15s;
}
.territory-item-del:hover { opacity: 1; }
.territory-empty {
  font-size: 0.67rem; color: var(--text-muted); font-style: italic; text-align: center; padding: 4px 0;
}
.territory-hint {
  font-size: 0.62rem; color: var(--text-muted); font-style: italic; text-align: center;
}

/* ── Section avancée : picker + hex + rgb + custom colors ── */
#color-advanced {
  display: flex; flex-direction: column; gap: 8px;
  flex: 1; overflow-y: auto; overflow-x: hidden;
  min-height: 0;
}

/* Scrollbar fine dans l'onglet avancé */
#color-advanced::-webkit-scrollbar { width: 3px; }
#color-advanced::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

#color-advanced-preview-row {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

#color-advanced-preview {
  width: 32px; height: 32px; border-radius: 7px; flex-shrink: 0;
  border: 2px solid var(--border);
  background: #FF0000;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

#color-native-picker {
  flex: 1; height: 32px; border-radius: 7px;
  border: 1px solid var(--border); cursor: pointer;
  background: var(--surface2); padding: 2px 3px;
  -webkit-appearance: none; appearance: none;
}
#color-native-picker::-webkit-color-swatch-wrapper { padding: 0; border-radius: 5px; }
#color-native-picker::-webkit-color-swatch { border: none; border-radius: 5px; }

#color-advanced-inputs {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 5px;
  flex-shrink: 0;
}

.color-input-group {
  display: flex; flex-direction: column; gap: 2px;
}
.color-input-group label {
  font-size: 0.58rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px;
}
.color-input-group input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 5px; padding: 4px 6px;
  color: var(--text); font-size: 0.76rem; font-family: monospace;
  outline: none; width: 100%; min-width: 0;
  transition: border-color .15s;
}
.color-input-group input:focus { border-color: var(--accent); }

.btn-apply-color {
  background: linear-gradient(135deg, var(--accent), #5a4fd6);
  border: none; color: #fff;
  border-radius: 7px; padding: 7px 10px;
  font-size: 0.76rem; font-weight: 700; cursor: pointer;
  transition: all .15s; width: 100%; text-align: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(124,111,247,.4);
}
.btn-apply-color:hover { opacity: .9; transform: translateY(-1px); }

/* ── Couleurs personnalisées sauvegardées ── */
#custom-colors-section {
  border-top: 1px solid var(--glass-border);
  padding-top: 8px;
  flex-shrink: 0;
}

#custom-colors-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}

.custom-colors-label {
  font-size: 0.58rem; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
}

#custom-color-save {
  width: 20px; height: 20px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 5px; color: var(--accent);
  font-size: 1rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s; font-weight: 700; flex-shrink: 0;
}
#custom-color-save:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

#custom-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22px, 1fr));
  gap: 4px;
  min-height: 22px;
}

/* Swatch personnalisé avec bouton supprimer au survol */
.custom-swatch-wrap {
  position: relative;
}
.custom-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .12s, box-shadow .12s, filter .12s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  min-width: 18px; min-height: 18px;
  display: block;
}
.custom-swatch:hover {
  filter: brightness(1.15);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.custom-swatch.active {
  border-color: #fff;
  box-shadow:
    inset 0 0 0 2px var(--accent),
    inset 0 0 0 1px rgba(255,255,255,.12);
  filter: brightness(1.05);
}
.custom-swatch-del {
  position: absolute; top: -4px; right: -4px;
  width: 13px; height: 13px;
  background: var(--accent2); border: none; border-radius: 50%;
  color: #fff; font-size: 0.55rem; line-height: 1;
  cursor: pointer; display: none;
  align-items: center; justify-content: center;
  font-weight: 900; z-index: 2;
  padding: 0;
}
.custom-swatch-wrap:hover .custom-swatch-del { display: flex; }

/* Message vide */
.custom-colors-empty {
  font-size: 0.64rem; color: var(--text-muted);
  font-style: italic; text-align: center;
  padding: 4px 0;
}

/* ══════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--accent); color: #fff;
  border: none; padding: 9px 18px; border-radius: var(--radius-sm);
  cursor: pointer; font-weight: 600; font-size: 0.88rem;
  transition: all .2s;
}
.btn-primary:hover    { background: #6a5fe0; box-shadow: 0 4px 18px rgba(124,111,247,.35); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary.full     { width: 100%; padding: 12px; font-size: 0.94rem; border-radius: 10px; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.88rem;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--accent); }

.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); padding: 7px 15px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.84rem; transition: all .2s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Lien de switch dans la modale auth */
.auth-switch {
  text-align: center; font-size: 0.8rem; color: var(--text-muted);
  margin-top: 4px;
}
.link-btn {
  background: none; border: none; color: var(--accent);
  cursor: pointer; font-size: 0.8rem; font-weight: 600;
  text-decoration: underline; padding: 0;
}
.link-btn:hover { color: #a597ff; }

/* ── Discord OAuth button ─────────────────────────── */
.btn-discord-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px;
  background: #5865F2; color: #fff;
  border: none; border-radius: 10px;
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .15s;
}
.btn-discord-oauth:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(88,101,242,.4);
}
.btn-discord-oauth:active { transform: translateY(0); }
.btn-discord-oauth svg { flex-shrink: 0; }

.auth-separator {
  display: flex; align-items: center; gap: 10px;
  margin: 8px 0 4px;
  color: var(--text-muted); font-size: 0.75rem;
}
.auth-separator::before,
.auth-separator::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Variant plus grand pour l'auth-gate */
.auth-gate-discord {
  padding: 13px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════
   TABS
══════════════════════════════════════════════════════ */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tab-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); padding: 7px 16px; border-radius: 20px;
  cursor: pointer; font-size: 0.83rem; transition: all .2s;
}
.tab-btn:hover  { border-color: var(--accent); color: var(--text); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ══════════════════════════════════════════════════════
   LEADERBOARD
══════════════════════════════════════════════════════ */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th {
  text-align: left; padding: 8px 12px; font-size: 0.72rem;
  color: var(--text-muted); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.lb-table td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.04); }
.lb-table tr:hover td { background: var(--surface2); }
.lb-rank { font-weight: 800; color: var(--text-muted); width: 32px; }
.lb-rank.gold   { color: #ffd700; }
.lb-rank.silver { color: #c0c0c0; }
.lb-rank.bronze { color: #cd7f32; }
.lb-pseudo { font-weight: 600; }
.lb-score  { font-weight: 700; color: var(--accent); }
.lb-group-badge {
  display: inline-block; font-size: 0.72rem; padding: 2px 8px;
  border-radius: 20px; font-weight: 600; color: #fff;
}
.lb-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover; vertical-align: middle; margin-right: 8px;
}

/* ══════════════════════════════════════════════════════
   GROUPS
══════════════════════════════════════════════════════ */
#groups-actions { margin-bottom: 16px; display: flex; gap: 8px; }
.group-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  margin-bottom: 10px; display: flex; align-items: center;
  gap: 14px; cursor: pointer; transition: all .2s;
}
.group-card:hover { border-color: var(--accent); background: var(--surface3); }
.group-logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface3); display: flex; align-items: center;
  justify-content: center; font-size: 1.3rem; flex-shrink: 0; overflow: hidden;
}
.group-logo img { width: 100%; height: 100%; object-fit: cover; }
.group-info { flex: 1; }
.group-name  { font-weight: 700; font-size: 1rem; }
.group-desc  { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.group-stats { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.group-color-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
#group-detail {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.group-detail-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.member-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.member-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface3); border-radius: var(--radius-sm); padding: 8px 12px;
}
.member-role { font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.role-leader    { background: rgba(255,215,0,.15); color: #ffd700; }
.role-moderator { background: rgba(67,232,176,.15); color: var(--accent3); }
.role-member    { background: var(--surface); color: var(--text-muted); }
#group-chat { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
#chat-messages {
  height: 200px; overflow-y: auto; display: flex; flex-direction: column;
  gap: 6px; margin-bottom: 10px;
}
.chat-msg    { display: flex; gap: 8px; align-items: flex-start; font-size: 0.82rem; }
.chat-pseudo { font-weight: 700; flex-shrink: 0; }
.chat-text   { color: var(--text-muted); }
.chat-form   { display: flex; gap: 8px; }
.chat-form input {
  flex: 1; background: var(--surface3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px;
  color: var(--text); font-size: 0.85rem; outline: none;
}
.chat-form input:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════
   PROFILE — refonte v2
══════════════════════════════════════════════════════ */

/* Modal plus large pour le profil */
#modal-profile .modal-box {
  padding: 0;
  overflow-y: auto;   /* scroll si contenu long, mais pas hidden */
  overflow-x: hidden;
  max-width: 520px;
}
/* Le bouton ✕ passe au-dessus du hero */
#modal-profile .modal-close {
  z-index: 10;
  background: rgba(13,13,22,0.7);
  backdrop-filter: blur(6px);
  border-color: rgba(255,255,255,0.12);
  color: var(--text);
}
#modal-profile .modal-close:hover {
  background: rgba(13,13,22,0.9);
  color: #fff;
}

/* ── Hero banner ── */
.prof-hero {
  position: relative;
  padding: 28px 24px 22px;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0; /* coins arrondis en haut uniquement */
}
.prof-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--prof-color) 30%, transparent), transparent 70%);
  transition: background 0.3s;
}
.prof-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--surface) 100%);
  pointer-events: none;
}
.prof-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* ── Avatar ── */
.prof-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.prof-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--prof-color, var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--prof-color, var(--accent)) 20%, transparent),
              0 8px 24px rgba(0,0,0,0.4);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.prof-avatar-edit {
  position: absolute;
  bottom: 0; right: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.prof-avatar-edit:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.prof-discord-badge {
  position: absolute;
  bottom: 0; right: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #5865F2;
  border: 2px solid var(--surface1);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}

.prof-sync-discord-btn {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(88,101,242,.15);
  border: 1px solid rgba(88,101,242,.4);
  color: #8c96f7;
  border-radius: 8px;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.prof-sync-discord-btn:hover {
  background: rgba(88,101,242,.3);
  color: #fff;
}

/* ── Identité ── */
.prof-identity { flex: 1; min-width: 0; }
.prof-pseudo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prof-since {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.prof-group-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--g-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--g-color) 40%, transparent);
  color: var(--text);
  border-radius: 20px;
  padding: 3px 10px 3px 7px;
  font-size: 0.75rem;
  font-weight: 600;
}
.prof-group-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--g-color);
  flex-shrink: 0;
}
.prof-group-role { color: var(--text-muted); font-weight: 400; margin-left: 2px; }
.prof-no-group { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }

/* ── Couleur favorite (isSelf) ── */
.prof-fav-color-wrap { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.prof-fav-label { font-size: 0.7rem; color: var(--text-muted); }
.prof-fav-row { display: flex; align-items: center; gap: 6px; }
.prof-color-input {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 2px;
  background: none;
}
.prof-save-color-btn {
  background: rgba(124,111,247,0.15);
  border: 1px solid rgba(124,111,247,0.3);
  color: var(--accent);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.prof-save-color-btn:hover { background: rgba(124,111,247,0.28); }
.prof-theme-color-wrap { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }

/* ── Sections communes ── */
.prof-section {
  padding: 0 20px 20px;
}
.prof-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-top: 4px;
  display: flex; align-items: center; gap: 6px;
}
.prof-section-title .hi { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Stats ── */
.prof-stats {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 4px;
}
.prof-stat {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
}
.prof-stat-sep {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}
.prof-stat-icon { margin-bottom: 4px; display: flex; align-items: center; justify-content: center; }
.prof-stat-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--prof-color, var(--accent));
  line-height: 1;
  transition: color 0.3s;
}
.prof-stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Badges (nouvelle présentation en grille) ── */
.prof-badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; border-radius: 20px;
  font-size: 0.68rem; font-weight: 800; padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}
.prof-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prof-badge-card {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px 5px 7px;
  cursor: default;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.prof-badge-card:hover {
  border-color: rgba(124,111,247,0.45);
  background: rgba(124,111,247,0.07);
}
.prof-badge-card-icon {
  font-size: 1.1rem; line-height: 1; flex-shrink: 0;
}
.prof-badge-card-label {
  font-size: 0.78rem; font-weight: 700; color: var(--text);
}
.prof-badge-card-desc { display: none; }

/* ── Badges — styles par rareté ─────────────────────────────── */
.prof-badge--uncommon { border-color: rgba(46,204,113,.35); }
.prof-badge--uncommon:hover { border-color: rgba(46,204,113,.6); background: rgba(46,204,113,.07); }

.prof-badge--rare { border-color: rgba(52,152,219,.4); }
.prof-badge--rare:hover { border-color: rgba(52,152,219,.65); background: rgba(52,152,219,.08); }

.prof-badge--epic { border-color: rgba(155,89,252,.45); }
.prof-badge--epic:hover { border-color: rgba(155,89,252,.7); background: rgba(155,89,252,.09); }

.prof-badge--legendary {
  border-color: rgba(255,200,0,.5);
  background: linear-gradient(135deg, rgba(255,215,0,.08) 0%, rgba(255,140,0,.05) 100%);
}
.prof-badge--legendary:hover {
  border-color: rgba(255,200,0,.75);
  background: linear-gradient(135deg, rgba(255,215,0,.15) 0%, rgba(255,140,0,.10) 100%);
}
.prof-badge--legendary .prof-badge-card-label { color: #e8b800; }

/* ── Badges de rôle (modérateur / admin / fondateur) ────────── */
.prof-badge--role {
  padding: 5px 14px 5px 8px;
  font-weight: 800;
}
.prof-badge--role .prof-badge-card-icon { font-size: 1.2rem; }

.prof-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  padding: 12px 0;
  text-align: center;
}

/* ── Compat anciens styles (gardés pour ne rien casser) ── */
.color-picker-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.color-picker-row input[type=color] { width: 38px; height: 38px; border-radius: 8px; border: none; cursor: pointer; background: none; padding: 0; }

/* ══════════════════════════════════════════════════════
   NOTIFICATION CENTER
══════════════════════════════════════════════════════ */
.modal-box-notif {
  width: 480px; max-width: calc(100vw - 24px);
  max-height: 90vh; display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.notif-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.notif-modal-header .modal-title { margin: 0; }
.notif-read-all-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-muted); font-size: 0.75rem; padding: 4px 10px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.notif-read-all-btn:hover { color: var(--text); border-color: var(--accent); }

/* Onglets */
.notif-tabs {
  display: flex; gap: 4px;
  padding: 12px 24px 0; border-bottom: 1px solid var(--border); margin-bottom: 0;
}
.notif-tab {
  background: none; border: none; border-radius: 8px 8px 0 0;
  padding: 8px 16px; font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
  position: relative;
}
.notif-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.notif-tab:hover:not(.active) { color: var(--text); }
.notif-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #ff6b8a; color: #fff; border-radius: 20px;
  font-size: 0.62rem; font-weight: 800; min-width: 16px; height: 16px;
  padding: 0 4px; margin-left: 4px; vertical-align: middle;
}

/* Panneaux */
.notif-pane { overflow-y: auto; flex: 1; min-height: 0; }
.notif-list {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 0; max-height: 60vh; overflow-y: auto;
}
.notif-empty {
  color: var(--text-muted); font-size: 0.85rem; text-align: center;
  padding: 40px 24px; font-style: italic;
}

/* Items de notification */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
  cursor: default;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(255,255,255,.03); }
.notif-unread { background: rgba(124,111,247,.06); }
.notif-unread:hover { background: rgba(124,111,247,.1); }
.notif-item-icon { flex-shrink: 0; margin-top: 1px; }

/* ── Badges icône notif ── */
.ni-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 10px;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1;
}
.ni-ban  { background: rgba(248,113,113,.15); color: #f87171; }
.ni-warn { background: rgba(251,191, 36,.15); color: #fbbf24; }
.ni-ok   { background: rgba( 52,211,153,.15); color: #34d399; }
.ni-mute { background: rgba(148,163,184,.12); color: #94a3b8; }
.ni-msg  { background: rgba(139, 92,246,.15); color: #a78bfa; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
  font-weight: 700; font-size: 0.85rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-text {
  font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; line-height: 1.4;
}
.notif-item-date {
  font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; opacity: .7;
}
.notif-item-read {
  background: none; border: none; color: var(--accent); font-size: 0.75rem;
  cursor: pointer; flex-shrink: 0; opacity: .7; transition: opacity .15s;
  padding: 0 4px;
}
.notif-item-read:hover { opacity: 1; }

/* Demandes de groupe */
.notif-req-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s;
}
.notif-req-item:hover { background: rgba(255,255,255,.03); }
.notif-req-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.notif-req-info { flex: 1; min-width: 0; }
.notif-req-pseudo { font-weight: 700; font-size: 0.88rem; color: var(--text); display: block; }
.notif-req-date { font-size: 0.72rem; color: var(--text-muted); }
.notif-req-actions { display: flex; gap: 6px; flex-shrink: 0; }
.notif-req-accept, .notif-req-reject {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border);
  font-size: 0.9rem; cursor: pointer; transition: background .15s, border-color .15s;
  display: flex; align-items: center; justify-content: center; background: var(--surface2);
}
.notif-req-accept { color: #43e8b0; }
.notif-req-accept:hover { background: rgba(67,232,176,.15); border-color: #43e8b0; }
.notif-req-reject { color: #ff6b8a; }
.notif-req-reject:hover { background: rgba(255,107,138,.15); border-color: #ff6b8a; }

/* ══════════════════════════════════════════════════════
   AUTH GATE — écran de connexion obligatoire
══════════════════════════════════════════════════════ */
/* ── Maintenance Screen ──────────────────────────────────────── */
#maintenance-screen {
  position: fixed; inset: 0; z-index: 600;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
}
#maintenance-screen.hidden { display: none; }
#maintenance-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; text-align: center;
  padding: 48px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 460px; width: calc(100vw - 32px);
  box-shadow: 0 24px 64px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.04);
}
#maintenance-logo {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900; letter-spacing: -.02em; line-height: 1;
}
#maintenance-logo span { color: var(--accent); }
#maintenance-icon { font-size: 3rem; }
#maintenance-title {
  font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 0;
}
#maintenance-msg {
  color: var(--text-muted); font-size: .95rem; line-height: 1.6; margin: 0;
  max-width: 320px;
}

/* ── Global message bar ──────────────────────────────────────── */
#global-message-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  background: linear-gradient(90deg, rgba(124,111,247,.9), rgba(255,107,138,.9));
  backdrop-filter: blur(8px); color: #fff; font-size: .82rem; font-weight: 600;
  text-align: center; padding: 8px 40px; letter-spacing: .02em;
  box-shadow: 0 2px 12px rgba(0,0,0,.4);
}
#global-message-bar.hidden { display: none; }
#global-message-bar .gmb-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #fff; font-size: 1rem; cursor: pointer; opacity: .7;
}
#global-message-bar .gmb-close:hover { opacity: 1; }

#auth-gate {
  position: fixed; inset: 0; z-index: 550;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease;
}
#auth-gate.hidden { display: none; }

#auth-gate-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; text-align: center;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 400px; width: calc(100vw - 32px);
  box-shadow: 0 24px 64px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.04);
}
#auth-gate-logo {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 900; letter-spacing: -.02em; line-height: 1;
}
#auth-gate-logo span { color: var(--accent); }
.auth-gate-tagline {
  color: var(--text-muted); font-size: .9rem; margin: 0;
}
.auth-gate-msg {
  color: var(--text); font-size: 1rem; margin: 0; font-weight: 500;
}
.auth-gate-btns {
  display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px;
}
.auth-gate-btn-primary {
  padding: 14px 28px;
  background: linear-gradient(135deg, #7c6ff7 0%, #ff6b8a 100%);
  color: #fff; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-gate-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,111,247,.45);
}
.auth-gate-btn-secondary {
  padding: 12px 28px;
  background: transparent;
  color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.auth-gate-btn-secondary:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
}
.auth-gate-separator {
  display: flex; align-items: center; gap: 12px; width: 100%;
  color: var(--text-muted); font-size: .82rem;
}
.auth-gate-separator::before, .auth-gate-separator::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-gate-btn-spectator {
  padding: 11px 28px;
  background: transparent;
  color: var(--text-muted); border: 1px dashed rgba(255,255,255,.18); border-radius: 12px;
  font-size: .9rem; font-weight: 500; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-gate-btn-spectator svg { width: 18px; height: 18px; }
.auth-gate-btn-spectator:hover {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.28);
  color: var(--text);
}
.auth-gate-spectator-hint {
  color: var(--text-muted); font-size: .75rem; margin: 0; opacity: .7;
}

/* ── Mobile notice ── */
#mobile-notice {
  position: fixed; inset: 0; z-index: 560;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.4s ease;
}
#mobile-notice.hidden { display: none; }
#mobile-notice-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; text-align: center;
  padding: 36px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 360px; width: calc(100vw - 32px);
  box-shadow: 0 24px 64px rgba(0,0,0,.65);
}
#mobile-notice-logo {
  font-size: 1.8rem; font-weight: 900; letter-spacing: -.02em; line-height: 1;
}
#mobile-notice-logo span { color: var(--accent); }
.mobile-notice-tagline { color: var(--text-muted); font-size: .85rem; margin: 0; }
.mobile-notice-icon { width: 40px; height: 40px; color: var(--accent); }
.mobile-notice-title { color: var(--text); font-size: 1.2rem; font-weight: 700; margin: 0; }
.mobile-notice-msg { color: var(--text-muted); font-size: .9rem; margin: 0; line-height: 1.5; }
.mobile-notice-btn {
  padding: 14px 32px; width: 100%;
  background: linear-gradient(135deg, #7c6ff7 0%, #6366f1 100%);
  color: #fff; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.mobile-notice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,111,247,.45);
}
.mobile-notice-hint {
  color: var(--text-muted); font-size: .75rem; margin: 0;
  line-height: 1.5; opacity: .65;
  border-top: 1px solid var(--border);
  padding-top: 12px; width: 100%;
}

/* Banner spectateur sur mobile */
.spec-mobile-hint {
  color: rgba(255,255,255,.4); font-size: .72rem; font-style: italic;
}

/* ── Spectator mode (mobile + PC guest) ── */
body.spectator-mode #bottom-toolbar { display: none !important; }
body.spectator-mode #color-popup { display: none !important; }
body.spectator-mode #overlay-bar { display: none !important; }
body.spectator-mode .nav-btn[data-panel="groups"] { display: none !important; }
body.spectator-mode #nav-btn-admin { display: none !important; }
body.spectator-mode #notif-bell { display: none !important; }
body.spectator-mode #user-menu { display: none !important; }
body.spectator-mode #chat-widget { display: none !important; }
body.spectator-mode #btn-open-auth { display: none !important; }
body.spectator-mode #header-right .btn-auth-combined { display: none !important; }
/* Dashboard en spectateur : cacher la sidebar gauche et droite, juste la carte */
body.spectator-mode .dash-left { display: none !important; }
body.spectator-mode .dash-right { display: none !important; }
body.spectator-mode .dash-grid { grid-template-columns: 1fr !important; }
body.spectator-mode .dash-center { min-height: calc(100vh - var(--header-h) - 20px); }

/* Spectator banner flottant */
#spectator-banner {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  background: rgba(12,10,28,.85); backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  padding: 8px 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: .82rem; color: var(--text-muted);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transition: opacity .3s ease;
}
#spectator-banner svg { width: 16px; height: 16px; flex-shrink: 0; }
#spectator-banner .spec-login-link {
  color: var(--accent); cursor: pointer; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
}
#spectator-banner .spec-login-link:hover { opacity: .8; }

/* ══════════════════════════════════════════════════════
   MODALS
══════════════════════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 600;
}
.modal.hidden { display: none; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 30px 28px;
  width: 420px; max-width: calc(100vw - 32px);
  position: relative;
  animation: modalIn .25s cubic-bezier(.22,1,.36,1);
  max-height: calc(100vh - 48px); overflow-y: auto;
}
.modal-box.wide { width: 620px; }
@keyframes modalIn {
  from { opacity:0; transform:scale(.95) translateY(14px); }
  to   { opacity:1; transform:none; }
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 0.85rem; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }
.modal-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.modal-tabs { display: flex; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.modal-tab {
  flex: 1; background: none; border: none; color: var(--text-muted);
  padding: 10px; cursor: pointer; font-size: 0.9rem; font-weight: 600;
  border-bottom: 2px solid transparent; transition: all .2s;
}
.modal-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.auth-form input, .auth-form textarea {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 13px;
  color: var(--text); font-size: 0.9rem; outline: none; transition: border-color .2s;
}
.auth-form input:focus, .auth-form textarea:focus { border-color: var(--accent); }
.auth-form textarea { resize: vertical; min-height: 70px; }
.form-error {
  background: rgba(255,107,138,.1); border: 1px solid rgba(255,107,138,.3);
  color: var(--accent2); border-radius: var(--radius-sm);
  padding: 9px 13px; font-size: 0.82rem;
}

/* ══════════════════════════════════════════════════════
   MODAL AIDE / À PROPOS
══════════════════════════════════════════════════════ */
.help-header {
  text-align: center; margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.help-logo {
  font-size: 2rem; font-weight: 900; letter-spacing: -1px;
  margin-bottom: 6px; color: var(--accent);
}
.help-logo span { color: inherit; }
.help-tagline { font-size: 0.83rem; color: var(--text-muted); }

/* ── Accordion aide ── */
.help-accordion { display: flex; flex-direction: column; gap: 6px; }

.help-acc-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255,255,255,.02);
}

.help-acc-head {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.help-acc-head:hover { background: var(--surface2); }
.help-acc-arrow {
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
}
.help-acc-item.open .help-acc-head { background: var(--surface2); }
.help-acc-item.open .help-acc-arrow { transform: rotate(90deg); }

.help-acc-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s cubic-bezier(.4,0,.2,1);
}
.help-acc-item.open .help-acc-body { max-height: 900px; }

/* ── Grille raccourcis clavier ── */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px; padding: 14px 16px 18px;
}
.sc-group { display: flex; flex-direction: column; gap: 4px; }
.sc-group-title {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .7px; color: var(--accent); margin-bottom: 4px;
}
.sc-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-muted);
  padding: 3px 0;
}
.sc-row span { flex: 1; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface3); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px;
  padding: 2px 7px; min-width: 26px;
  font-family: monospace; font-size: .72rem; font-weight: 700;
  color: var(--text); white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

.help-rows { display: flex; flex-direction: column; gap: 0; padding: 0 0 6px; }
.help-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 9px 16px;
  border-top: 1px solid rgba(255,255,255,.04);
  font-size: .82rem;
}
.help-tag {
  flex-shrink: 0;
  width: 110px;
  font-weight: 600;
  color: var(--accent);
  font-size: .78rem;
  padding-top: 1px;
}
.help-row p { color: var(--text-muted); line-height: 1.55; margin: 0; }
.help-row p strong { color: var(--text); }
.help-row p kbd {
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
  font-family: monospace; font-size: .75rem;
  color: var(--text); box-shadow: 0 1px 0 var(--border);
}

/* raccourcis dans l'accordion */
.help-acc-body .shortcut-list { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 5px; }
.shortcut-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 0.82rem;
}
.shortcut-row span { color: var(--text-muted); }
kbd {
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px;
  font-family: monospace; font-size: 0.78rem;
  color: var(--text); box-shadow: 0 2px 0 var(--border);
}

.help-about { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }
.help-about strong { color: var(--text); }

/* ══════════════════════════════════════════════════════
   NOTIFICATION POPUP (coin)
══════════════════════════════════════════════════════ */
#notif-popup-container {
  position: fixed;
  bottom: 80px;
  right: 16px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}

.notif-popup {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  padding: 12px 14px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.22,1,.36,1);
}
.notif-popup.visible {
  opacity: 1;
  transform: translateX(0);
}
.notif-popup.hiding {
  opacity: 0;
  transform: translateX(24px);
  transition: opacity .25s ease, transform .25s ease;
}
.notif-popup:hover { border-color: var(--accent); background: var(--surface2); }

.notif-popup-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-popup-body {
  flex: 1;
  min-width: 0;
}
.notif-popup-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-popup-text {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-popup-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: .75rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: color .15s, background .15s;
}
.notif-popup-close:hover { color: var(--text); background: var(--surface3); }

/* ══════════════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 108px; right: 16px;
  display: flex; flex-direction: column; gap: 8px; z-index: 999;
}
.toast {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-size: 0.85rem; max-width: 290px;
  animation: toastIn .3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.toast.success { border-color: var(--accent3); }
.toast.error   { border-color: var(--accent2); }
.toast.info    { border-color: var(--accent); }
@keyframes toastIn {
  from { opacity:0; transform:translateX(20px); }
  to   { opacity:1; transform:none; }
}

/* ══════════════════════════════════════════════════════
   OVERLAY BAR — barre flottante quand un calque est actif
══════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════
   OVERLAY BAR — Barre calque redesign
   ═══════════════════════════════════════════ */
#overlay-bar {
  position: fixed;
  top: calc(var(--header-h) + 10px);
  left: 50%; transform: translateX(-50%);
  background: rgba(12, 10, 28, .88);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(124,111,247,.25);
  border-radius: 14px;
  padding: 6px 14px;
  display: flex; flex-direction: row; align-items: center; gap: 6px;
  z-index: 250;
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  animation: popupIn .22s cubic-bezier(.22,1,.36,1);
  white-space: nowrap;
  max-width: calc(100vw - 24px);
  overflow-x: auto;
}
#overlay-bar::-webkit-scrollbar { height: 0; }
#overlay-bar.hidden { display: none; }

.overlay-bar-label {
  font-size: 0.78rem; flex-shrink: 0; opacity: .7;
}

.overlay-bar-name {
  font-size: 0.72rem; font-weight: 700; color: #c4b5fd;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex-shrink: 1; letter-spacing: .02em;
}

.overlay-bar-pos {
  font-size: 0.68rem; color: rgba(255,255,255,.45);
  font-family: 'JetBrains Mono', monospace;
  background: rgba(255,255,255,.06);
  padding: 3px 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.08);
  min-width: 68px; text-align: center;
}

/* ── Boutons overlay — style unifié pilule ── */
.ovb {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  padding: 4px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  line-height: 1; transition: all .15s ease; flex-shrink: 0;
  white-space: nowrap;
}
.ovb:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}

/* Verrouiller */
.overlay-btn-lock { composes-like: ovb; }
.overlay-btn-lock {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,200,80,.2);
  color: rgba(255,200,80,.7); padding: 4px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  line-height: 1; transition: all .15s; flex-shrink: 0;
}
.overlay-btn-lock:hover { background: rgba(255,200,80,.1); border-color: rgba(255,200,80,.4); color: #ffc850; }
.overlay-btn-lock.locked {
  background: rgba(255,200,80,.15); border-color: #ffc850; color: #ffd76e;
}

/* Auto-couleur */
.overlay-btn-autocolor {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.4); padding: 4px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  line-height: 1; transition: all .15s; flex-shrink: 0;
}
.overlay-btn-autocolor:hover { background: rgba(108,99,255,.1); border-color: rgba(108,99,255,.3); color: #a89fff; }
.overlay-btn-autocolor.active {
  background: rgba(108,99,255,.15); border-color: rgba(108,99,255,.4); color: #a89fff;
}

/* Sauver position */
.overlay-btn-save {
  background: rgba(255,255,255,.06); border: 1px solid rgba(67,232,176,.2);
  color: rgba(67,232,176,.7); padding: 4px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  line-height: 1; transition: all .15s; flex-shrink: 0;
}
.overlay-btn-save:hover { background: rgba(67,232,176,.1); border-color: rgba(67,232,176,.4); }
.overlay-btn-save.saved { background: rgba(67,232,176,.18); border-color: var(--accent3); }

/* Masquer */
.overlay-btn-cancel {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.5); padding: 4px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  line-height: 1; transition: all .15s; flex-shrink: 0;
}
.overlay-btn-cancel:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); }

/* Fermer */
.overlay-btn-close {
  background: rgba(255,80,80,.08); border: 1px solid rgba(255,80,80,.2);
  color: rgba(255,80,80,.7); padding: 4px 10px; border-radius: 8px;
  cursor: pointer; font-size: 0.72rem; font-weight: 600;
  line-height: 1; transition: all .15s; flex-shrink: 0;
}
.overlay-btn-close:hover { background: rgba(255,80,80,.15); border-color: rgba(255,80,80,.4); color: #ff5050; }

/* Opacité slider */
.overlay-opacity-wrap {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

/* ── Séparateur ── */
.overlay-bar-sep { width: 1px; height: 16px; background: rgba(255,255,255,.08); flex-shrink: 0; margin: 0 2px; }

/* ── Boutons Collab ── */
.overlay-btn-collab {
  background: linear-gradient(135deg, #7c6ff7, #a78bfa); color: #fff; border: none;
  padding: 4px 12px; border-radius: 8px; font-size: 0.72rem; font-weight: 700;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(124,111,247,.3);
}
.overlay-btn-collab:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,111,247,.4); }

.overlay-btn-collab-stop {
  background: linear-gradient(135deg, #ef4444, #f87171); color: #fff; border: none;
  padding: 4px 12px; border-radius: 8px; font-size: 0.72rem; font-weight: 700;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.overlay-btn-collab-stop:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,.4); }

.overlay-btn-collab-transfer {
  background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.25); color: #a78bfa;
  padding: 4px 12px; border-radius: 8px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.overlay-btn-collab-transfer:hover { background: rgba(167,139,250,.15); border-color: #a78bfa; }

.overlay-btn-collab-leave {
  background: rgba(255,107,138,.06); border: 1px solid rgba(255,107,138,.2); color: rgba(255,107,138,.7);
  padding: 4px 12px; border-radius: 8px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.overlay-btn-collab-leave:hover { background: rgba(255,107,138,.12); border-color: var(--accent2); color: var(--accent2); }

/* Transfer modal */
.collab-transfer-list { display: flex; flex-direction: column; gap: 4px; }
.collab-transfer-member {
  padding: 8px 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  background: rgba(255,255,255,.04); color: var(--text); font-size: 0.82rem;
  cursor: pointer; transition: all .15s; text-align: left;
}
.collab-transfer-member:hover { border-color: #a78bfa; color: #a78bfa; background: rgba(167,139,250,.08); }

/* Indicateur session collab */
.overlay-collab-indicator {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 700; color: #4ade80; flex-shrink: 0;
  letter-spacing: .03em; text-transform: uppercase;
}
.collab-pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; animation: collabPulse 1.5s infinite;
}
@keyframes collabPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,.6); }
  50%      { box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

/* Barre overlay en session collab */
#overlay-bar.collab-active {
  border-color: rgba(74,222,128,.3);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), 0 0 16px rgba(74,222,128,.12), inset 0 1px 0 rgba(74,222,128,.1);
}

/* Toast invitation collab */
.collab-invite-toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  z-index: 9999; background: var(--surface); border: 2px solid #7c6ff7;
  border-radius: 14px; padding: 14px 20px; box-shadow: 0 8px 32px rgba(0,0,0,.4);
  display: flex; flex-direction: column; gap: 10px; max-width: 360px; width: 90vw;
  animation: collabInviteIn .3s ease;
}
@keyframes collabInviteIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.collab-invite-text { font-size: 0.85rem; color: var(--text); line-height: 1.4; }
.collab-invite-text strong { color: #a78bfa; }
.collab-invite-btns { display: flex; gap: 8px; }
.collab-invite-accept {
  flex: 1; padding: 6px 0; border: none; border-radius: 8px; font-weight: 600;
  font-size: 0.8rem; cursor: pointer; background: linear-gradient(135deg, #22c55e, #4ade80); color: #fff;
  transition: opacity .15s;
}
.collab-invite-accept:hover { opacity: .85; }
.collab-invite-decline {
  flex: 1; padding: 6px 0; border: 1px solid var(--border); border-radius: 8px; font-weight: 600;
  font-size: 0.8rem; cursor: pointer; background: transparent; color: var(--text-muted);
  transition: all .15s;
}
.collab-invite-decline:hover { border-color: #ef4444; color: #ef4444; }

/* Curseur opacité calque */
.overlay-opacity-wrap {
  display: flex; align-items: center; gap: 5px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; padding: 2px 8px;
}
.overlay-opacity-icon { font-size: 0.78rem; color: var(--text-muted); }
#overlay-opacity {
  width: 64px; height: 3px; cursor: pointer;
  accent-color: var(--accent3); vertical-align: middle;
}
#overlay-opacity-val {
  font-size: 0.68rem; color: var(--text-muted);
  min-width: 28px; font-family: monospace; text-align: right;
}

/* ══════════════════════════════════════════════════════
   MODAL PIXELIZER
══════════════════════════════════════════════════════ */
.modal-box-pixelizer {
  width: min(96vw, 1080px);
  max-width: none;
  padding: 0;
  border-radius: 20px;
  overflow: hidden;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

/* ── En-tête du modal ── */
.px-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.px-header-icon { font-size: 1rem; color: var(--accent); line-height: 1; }
.px-header-title { font-size: 0.92rem; font-weight: 700; color: var(--text); flex: 1; }
.px-header .modal-close {
  position: static;
  top: auto; right: auto;
  width: 28px; height: 28px;
  border-radius: 8px; flex-shrink: 0;
}

/* ── Layout 3 colonnes ── */
.px-modal-layout {
  display: grid;
  grid-template-columns: 200px 1fr 240px;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Panels communs ── */
#px-library-panel,
#px-converter-panel,
#px-params-panel {
  padding: 16px 14px;
  overflow-y: auto;
  min-height: 0;
}

#px-library-panel {
  background: var(--surface2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
#px-converter-panel {
  background: var(--surface);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 24px;
}
#px-params-panel {
  background: var(--surface2);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}

/* ── Titre des panels ── */
.px-panel-title {
  font-size: 0.7rem; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .7px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 2px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
}

/* ── Bibliothèque ── */
.pxlib-empty {
  font-size: 0.74rem; color: var(--text-muted);
  font-style: italic; text-align: center;
  padding: 24px 8px; line-height: 1.6;
}

.pxlib-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px;
  cursor: pointer; transition: all .15s;
  margin-bottom: 5px;
}
.pxlib-item:hover { border-color: var(--accent); background: var(--surface); }
.pxlib-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(124,111,247,.3); }

.pxlib-thumb {
  width: 36px; height: 36px; border-radius: 5px;
  object-fit: cover; image-rendering: pixelated;
  background: var(--bg); border: 1px solid var(--border);
  flex-shrink: 0;
}

.pxlib-info { flex: 1; min-width: 0; }
.pxlib-name { font-size: 0.78rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxlib-meta { font-size: 0.65rem; color: var(--text-muted); margin-top: 2px; }

.pxlib-actions { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
.pxlib-btn {
  width: 22px; height: 22px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text-muted);
  font-size: 0.68rem; cursor: pointer; transition: all .12s;
  display: flex; align-items: center; justify-content: center;
}
.pxlib-btn:hover { background: var(--surface3); color: var(--text); }
.pxlib-btn-place:hover      { border-color: var(--accent3); color: var(--accent3); }
.pxlib-btn-del:hover        { border-color: var(--accent2); color: var(--accent2); }
.pxlib-btn-toggle-off:hover { border-color: #f59e0b; color: #f59e0b; }
.pxlib-btn-share:hover      { border-color: var(--accent); color: var(--accent); }

/* ── Bouton Ajouter dans les notifications ── */
.notif-add-overlay-btn {
  margin-top: 6px;
  background: rgba(67,232,176,.1); border: 1px solid rgba(67,232,176,.4);
  color: var(--accent3); border-radius: var(--radius-sm); padding: 3px 10px;
  font-size: .78rem; cursor: pointer; transition: background .15s; display: inline-block;
}
.notif-add-overlay-btn:hover { background: rgba(67,232,176,.22); }
.notif-add-overlay-btn:disabled { opacity: .5; cursor: default; }

.pxlib-status {
  font-size: 0.85rem; flex-shrink: 0;
  opacity: 0.35; line-height: 1; align-self: center;
}
.pxlib-status.pxlib-status-on {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(67,232,176,0.7));
}
.pxlib-item.layer-active {
  border-color: var(--accent3);
  box-shadow: 0 0 0 1px rgba(67,232,176,.25);
}

/* ── Bibliothèque sidebar — recents + footer ── */
#pxlib-recents {
  flex: 1; min-height: 0; overflow-y: auto;
}

.px-lib-footer {
  display: flex; flex-direction: column; gap: 5px;
  padding: 8px 0 0; border-top: 1px solid var(--border);
  flex-shrink: 0; margin-top: auto;
}
.px-lib-footer-btn {
  width: 100%; padding: 6px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: all .15s; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.px-lib-footer-btn--new {
  background: var(--surface3); color: var(--text);
}
.px-lib-footer-btn--new:hover {
  background: var(--surface); border-color: var(--accent); color: var(--accent);
}
.px-lib-footer-btn--all {
  background: rgba(124,111,247,.1); color: var(--accent);
  border-color: rgba(124,111,247,.3);
}
.px-lib-footer-btn--all:hover {
  background: rgba(124,111,247,.2); border-color: var(--accent);
}

/* ── Modal bibliothèque complète (mosaïque) ── */
.px-lib-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75); backdrop-filter: blur(4px);
  z-index: 2000; display: flex; align-items: center; justify-content: center;
}
.px-lib-modal.hidden { display: none; }
.px-lib-modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 90%; max-width: 820px;
  max-height: 85%; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.px-lib-modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.px-lib-modal-title {
  font-size: 0.9rem; font-weight: 700; color: var(--text); flex: 1;
}
.px-lib-modal-count {
  font-size: 0.75rem; color: var(--text-muted);
}
.px-lib-modal-close {
  background: none; border: none; color: var(--text-muted);
  font-size: 1rem; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: all .15s; line-height: 1;
}
.px-lib-modal-close:hover { background: var(--surface2); color: var(--text); }

/* ── Mosaïque de cartes ── */
.px-lib-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 16px; overflow-y: auto;
}
.pxlib-mosaic-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; transition: all .15s; position: relative;
  display: flex; flex-direction: column;
}
.pxlib-mosaic-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.pxlib-mosaic-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,111,247,.35); }
.pxlib-mosaic-card.layer-active { border-color: var(--accent3); box-shadow: 0 0 0 2px rgba(67,232,176,.3); }
.pxlib-mosaic-thumb {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; image-rendering: pixelated;
  background: var(--bg); display: block;
}
.pxlib-mosaic-badge {
  position: absolute; top: 5px; right: 5px;
  background: rgba(67,232,176,.85); color: #000;
  font-size: 0.65rem; font-weight: 800; border-radius: 50%;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
}
.pxlib-mosaic-footer {
  padding: 7px 8px; display: flex; flex-direction: column; gap: 3px; flex: 1;
}
.pxlib-mosaic-name {
  font-size: 0.75rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pxlib-mosaic-meta {
  font-size: 0.65rem; color: var(--text-muted);
}
.pxlib-mosaic-acts {
  display: flex; gap: 4px; margin-top: 5px;
}
.pxlib-mosaic-acts button {
  flex: 1; padding: 4px 5px; font-size: 0.68rem;
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text); cursor: pointer; transition: all .12s;
}
.pxlib-mosaic-acts button:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.pxlib-mosaic-del {
  position: absolute; top: 5px; left: 5px;
  background: rgba(0,0,0,.5); border: none; border-radius: 50%;
  width: 20px; height: 20px; font-size: 0.65rem; color: #aaa;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.pxlib-mosaic-card:hover .pxlib-mosaic-del { opacity: 1; }
.pxlib-mosaic-del:hover { background: rgba(239,68,68,.8); color: #fff; }

/* ── Drop zone ── */
#px-drop-zone {
  width: 100%; max-width: 360px;
  border: 2px dashed var(--border);
  border-radius: 16px; padding: 40px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  cursor: pointer; transition: all .2s; text-align: center;
  background: var(--surface2); flex-shrink: 0;
}
#px-drop-zone:hover,
#px-drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(124,111,247,.05);
  transform: scale(1.01);
}
.px-drop-icon { opacity: .7; display: flex; align-items: center; justify-content: center; }
.px-drop-text { font-size: 0.9rem; font-weight: 600; color: var(--text); line-height: 1.6; }
.px-drop-text span { display: block; font-size: 0.77rem; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.px-drop-formats { font-size: 0.65rem; color: var(--text-dim); letter-spacing: .04em; }

/* ── Zone de prévisualisation ── */
#px-preview-area {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
#px-preview-wrap {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 120px; width: 100%;
  background: var(--surface2); border-radius: 10px; border: 1px solid var(--border);
  overflow: hidden;
}
#px-preview-loading {
  position: absolute; inset: 0; background: rgba(13,13,22,.85);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; border-radius: 8px; font-size: 0.78rem; color: var(--text-muted);
  z-index: 5;
}
.px-spinner {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#px-preview-canvas {
  image-rendering: pixelated;
  border-radius: 8px; max-width: 100%; max-height: 320px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

#px-palette-row {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; width: 100%; justify-content: center;
}
.px-palette-label { font-size: 0.67rem; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
#px-palette-preview { display: flex; flex-wrap: wrap; gap: 3px; }
.px-palette-swatch {
  width: 16px; height: 16px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,.1); cursor: default;
}

#px-pixel-count-row {
  display: flex; align-items: center; gap: 10px; justify-content: center;
}
#px-pixel-count { font-size: 0.73rem; color: var(--text-muted); }
.px-btn-reset {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); padding: 4px 10px; border-radius: 6px;
  font-size: 0.7rem; cursor: pointer; transition: all .15s;
}
.px-btn-reset:hover { border-color: var(--accent2); color: var(--accent2); }

/* ── Sections paramètres ── */
.px-section {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}

.px-section-label {
  font-size: 0.62rem; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
}
.px-section-label-row {
  display: flex; align-items: center; justify-content: space-between;
}

.px-param-label {
  font-size: 0.62rem; font-weight: 800; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .6px;
  display: block;
}
.px-param-hint {
  font-size: 0.6rem; color: var(--text-dim); font-style: italic;
}

.px-text-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 10px; color: var(--text);
  font-size: 0.82rem; outline: none; transition: border-color .15s;
}
.px-text-input:focus { border-color: var(--accent); }

.px-dim-row { display: flex; align-items: flex-end; gap: 6px; }
.px-dim-group { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.px-dim-label {
  font-size: 0.58rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
}
.px-num-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; color: var(--text);
  font-size: 0.82rem; outline: none; transition: border-color .15s;
  -moz-appearance: textfield; text-align: center;
}
.px-num-input::-webkit-inner-spin-button,
.px-num-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.px-num-input:focus { border-color: var(--accent); }

.px-res-slider-row { display: flex; align-items: center; gap: 8px; }
.px-res-slider-label { font-size: 0.6rem; color: var(--text-muted); flex-shrink: 0; }

.px-lock-btn {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0;
  cursor: pointer; font-size: 1rem;
  transition: all .15s; flex-shrink: 0;
  align-self: flex-end;
  width: 30px; height: 31px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.px-lock-btn:hover { border-color: var(--accent); }
.px-lock-btn.locked { background: rgba(124,111,247,.15); border-color: var(--accent); }
.px-lock-emoji { filter: grayscale(1) brightness(0) invert(1); font-style: normal; }

.px-range-row { display: flex; align-items: center; gap: 10px; }
.px-range {
  width: 100%; height: 4px; border-radius: 2px;
  -webkit-appearance: none; appearance: none;
  background: var(--surface2); cursor: pointer; outline: none; border: none;
}
.px-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  cursor: pointer; transition: transform .15s;
}
.px-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.px-range-val {
  font-size: 0.85rem; font-weight: 800; color: var(--accent);
  flex-shrink: 0;
}

.px-checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 0.78rem; color: var(--text);
  user-select: none;
}
.px-checkbox-label input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; }
.px-checkbox-label small { color: var(--text-muted); font-size: 0.65rem; }

/* ── Actions (bas du panneau params) ── */
.px-actions {
  margin-top: auto; padding-top: 4px;
  display: flex; flex-direction: column; gap: 8px;
}

.px-btn-save {
  background: var(--surface3); border: 1px solid var(--border);
  color: var(--text); padding: 9px 14px; border-radius: 10px;
  cursor: pointer; font-size: 0.82rem; font-weight: 600;
  transition: all .2s; width: 100%;
}
.px-btn-save:hover { border-color: var(--accent); color: var(--accent); }

.px-btn-place {
  background: linear-gradient(135deg, var(--accent), #5a4fd6);
  border: none; color: #fff; padding: 11px 14px;
  border-radius: 10px; cursor: pointer;
  font-size: 0.86rem; font-weight: 700;
  transition: all .2s; width: 100%;
  box-shadow: 0 3px 14px rgba(124,111,247,.4);
}
.px-btn-place:hover { transform: translateY(-1px); box-shadow: 0 5px 20px rgba(124,111,247,.6); }

/* ── Scrollbars dans la modal ── */
#px-library-panel::-webkit-scrollbar,
#px-converter-panel::-webkit-scrollbar,
#px-params-panel::-webkit-scrollbar { width: 4px; }
#px-library-panel::-webkit-scrollbar-thumb,
#px-converter-panel::-webkit-scrollbar-thumb,
#px-params-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Responsive ── */
@media (max-width: 800px) {
  .px-modal-layout { grid-template-columns: 1fr; }
  #px-library-panel { border-right: none; border-bottom: 1px solid var(--border); max-height: 150px; }
  #px-params-panel  { border-left: none; border-top: 1px solid var(--border); }
  .modal-box-pixelizer { max-height: 95vh; overflow-y: auto; }
}

/* ══════════════════════════════════════════════════════
   FIND MY PIXELS PANEL
══════════════════════════════════════════════════════ */
#find-pixels-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-height: 72vh;
  background: var(--glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  z-index: 250;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  animation: popupIn 0.18s ease;
}
/* Quand draggé, désactiver le transform centrage */
#find-pixels-panel.dragged {
  transform: none;
}

#find-pixels-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}
#find-pixels-header:active { cursor: grabbing; }

#find-pixels-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

#find-pixels-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
#find-pixels-close:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}

#find-pixels-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#find-pixels-body::-webkit-scrollbar { width: 4px; }
#find-pixels-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

#find-pixels-loading,
#find-pixels-empty {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 20px 0;
}

/* ── Info bar (pixels isolés masqués) ── */
.fp-info-bar {
  text-align: center;
  font-size: .75rem;
  color: var(--text-muted);
  padding: 6px 12px;
  margin-bottom: 4px;
  opacity: .7;
}

/* ── Cluster card ── */
.fp-cluster-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: background 0.15s, border-color 0.15s;
}
.fp-cluster-card:hover {
  background: rgba(124,111,247,0.06);
  border-color: rgba(124,111,247,0.25);
}

/* Mini preview canvas — taille auto selon le contenu */
.fp-mini-canvas {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  image-rendering: pixelated;
  background: #fff;
  object-fit: contain;
}

/* Info bloc */
.fp-cluster-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.fp-cluster-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.fp-cluster-detail {
  font-size: 11px;
  color: var(--text-muted);
}

.fp-cluster-coords {
  font-size: 10px;
  color: var(--accent);
  font-family: monospace;
}

/* Ligne de boutons d'action */
.fp-cluster-actions {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 6px;
}

/* Bouton téléport */
.fp-teleport-btn {
  flex: 1;
  background: rgba(124,111,247,0.15);
  border: 1px solid rgba(124,111,247,0.3);
  color: var(--accent);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1;
}
.fp-teleport-btn:hover {
  background: rgba(124,111,247,0.28);
  border-color: var(--accent);
}

/* Bouton supprimer */
.fp-delete-btn {
  background: rgba(255,107,138,0.12);
  border: 1px solid rgba(255,107,138,0.25);
  color: var(--accent2);
  border-radius: 6px;
  width: 30px;
  min-width: 30px;
  padding: 0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fp-delete-btn:hover {
  background: rgba(255,107,138,0.25);
  border-color: var(--accent2);
}

/* ── Popup de confirmation suppression ── */
.fp-confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,11,16,0.82);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: popupIn 0.15s ease;
}

.fp-confirm-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px 16px;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.fp-confirm-msg {
  font-size: 13px;
  color: var(--text);
  text-align: center;
  line-height: 1.5;
}
.fp-confirm-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.fp-confirm-btns {
  display: flex;
  gap: 8px;
}

.fp-confirm-cancel {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.fp-confirm-cancel:hover { background: rgba(255,255,255,0.1); color: var(--text); }

.fp-confirm-ok {
  flex: 1;
  background: rgba(255,107,138,0.18);
  border: 1px solid rgba(255,107,138,0.35);
  color: var(--accent2);
  border-radius: 8px;
  padding: 7px 0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.fp-confirm-ok:hover { background: rgba(255,107,138,0.32); }
.fp-confirm-ok:disabled { opacity: 0.6; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════
   LANDING / MENU
══════════════════════════════════════════════════════ */
#landing {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 900;
  background: #0b0b10;
  overflow: hidden;
}

/* Canvas pixel art animé (background) */
#landing-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 1;
  pointer-events: none;
}

/* Contenu central */
#landing-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 20px;
  text-align: center;
  padding: 24px 20px;
  width: min(520px, 96vw);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.22,1,.36,1);
}
#landing-content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Logo */
#landing-logo {
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: 0 0 40px rgba(124,111,247,0.4);
}
#landing-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: -8px;
}

/* ── Zone GUEST ── */
#landing-guest {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  width: 100%;
  animation: landingFadeUp 0.5s ease both;
}
#landing-guest-msg {
  background: rgba(19,19,28,0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  backdrop-filter: blur(12px);
}
.landing-pixel-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 12px rgba(124,111,247,0.6));
  animation: landingBounce 2.5s ease infinite;
}
@keyframes landingBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
.landing-guest-title {
  font-size: 1.25rem; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.landing-guest-sub {
  font-size: 0.84rem; color: var(--text-muted); line-height: 1.5;
  max-width: 340px;
}
.landing-guest-sub strong { color: var(--accent3); -webkit-text-fill-color: var(--accent3); }

/* Boutons auth */
.landing-auth-btns {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.landing-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}
.landing-btn:hover { transform: translateY(-2px); }
.landing-btn:active { transform: translateY(0); }
.lbtn-icon { font-size: 1.1em; }

.landing-btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a4fcc);
  color: #fff;
  box-shadow: 0 6px 24px rgba(124,111,247,0.35);
}
.landing-btn-primary:hover {
  box-shadow: 0 10px 32px rgba(124,111,247,0.5);
  background: linear-gradient(135deg, #8f84ff, var(--accent));
}
.landing-btn-secondary {
  background: rgba(255,107,138,0.15);
  color: var(--accent2);
  border: 1px solid rgba(255,107,138,0.35);
}
.landing-btn-secondary:hover {
  background: rgba(255,107,138,0.25);
  box-shadow: 0 6px 20px rgba(255,107,138,0.2);
}
.landing-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  padding: 8px 16px;
}
.landing-btn-ghost:hover {
  color: var(--text); border-color: var(--text-muted);
}

/* ── Zone USER ── */
#landing-user {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  width: 100%;
  animation: landingFadeUp 0.5s ease both;
}

/* Ligne bienvenue */
#landing-welcome-row {
  display: flex; align-items: center; gap: 16px;
  background: rgba(19,19,28,0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 24px;
  backdrop-filter: blur(12px);
  width: 100%;
}
.landing-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  box-shadow: 0 0 18px rgba(124,111,247,0.4);
  flex-shrink: 0;
}
#landing-welcome-text { text-align: left; }
#landing-welcome-greeting {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
}
#landing-welcome-name {
  font-size: 1.3rem; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
#landing-welcome-sub {
  font-size: 0.8rem; color: var(--text-muted);
  font-style: italic; margin-top: 2px;
}

/* Grille d'actions */
.landing-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}
.landing-action-card {
  background: rgba(19,19,28,0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, background 0.18s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--text);
  backdrop-filter: blur(12px);
}
.landing-action-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 28px rgba(124,111,247,0.2);
  background: rgba(28,28,48,0.95);
}
.landing-action-card:active { transform: translateY(-1px); }
.lac-icon { font-size: 1.8rem; filter: drop-shadow(0 0 8px rgba(124,111,247,0.4)); }
.lac-label { font-size: 0.92rem; font-weight: 700; }
.lac-sub { font-size: 0.72rem; color: var(--text-muted); }

/* Animation entrée */
@keyframes landingFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Décoration pixel corners */
.pixel-corner {
  position: absolute;
  width: 32px; height: 32px;
  background: var(--accent);
  opacity: 0.25;
}
.pixel-corner::before, .pixel-corner::after {
  content: '';
  position: absolute;
  background: inherit;
}
.pixel-corner-tl { top: 0; left: 0; clip-path: polygon(0 0, 8px 0, 8px 8px, 16px 8px, 16px 16px, 8px 16px, 8px 24px, 0 24px, 0 16px); }
.pixel-corner-tr { top: 0; right: 0; clip-path: polygon(24px 0, 32px 0, 32px 24px, 24px 24px, 24px 16px, 16px 16px, 16px 8px, 24px 8px); }
.pixel-corner-bl { bottom: 0; left: 0; clip-path: polygon(0 8px, 8px 8px, 8px 16px, 16px 16px, 16px 24px, 8px 24px, 8px 32px, 0 32px); }
.pixel-corner-br { bottom: 0; right: 0; clip-path: polygon(16px 8px, 24px 8px, 24px 16px, 32px 16px, 32px 32px, 8px 32px, 8px 24px, 16px 24px); }

/* (ancienne règle wide supprimée — grille 2×2 symétrique) */

/* ── Sous-panneaux du landing ── */
.landing-subpanel {
  position: absolute; inset: 0;
  background: rgba(11,11,16,0.98);
  backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  z-index: 10;
  animation: landingFadeUp 0.3s ease both;
  overflow: hidden;
}
.landing-subpanel-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.landing-back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.landing-back-btn:hover { color: var(--text); border-color: var(--text-muted); }
.landing-subpanel-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text);
}
.landing-subpanel-tabs {
  display: flex; gap: 4px;
  padding: 10px 16px 0;
  flex-shrink: 0;
}
.lsp-tab {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}
.lsp-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.lsp-tab:hover:not(.active) { border-color: var(--text-muted); color: var(--text); }

.landing-subpanel-body {
  flex: 1; overflow-y: auto;
  padding: 12px 16px 16px;
}
.lsp-loading {
  color: var(--text-muted);
  text-align: center;
  padding: 30px 0;
  font-size: 0.85rem;
}

/* Classement dans le landing */
.lsp-lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background 0.12s;
}
.lsp-lb-row:hover { background: var(--surface2); }
.lsp-lb-rank {
  font-size: 0.75rem; font-weight: 700;
  color: var(--text-muted);
  width: 22px; text-align: center; flex-shrink: 0;
}
.lsp-lb-rank.gold   { color: #f7b731; }
.lsp-lb-rank.silver { color: #b2bec3; }
.lsp-lb-rank.bronze { color: #e17055; }
.lsp-lb-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.lsp-lb-name {
  flex: 1; font-size: 0.88rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lsp-lb-score {
  font-size: 0.78rem; color: var(--accent);
  font-weight: 700; flex-shrink: 0;
}

/* Profil dans le landing — réutilise les styles .prof-* */
#landing-profile-content .prof-hero { border-radius: 12px; }

/* Auth forms dans le landing */
.landing-auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.landing-auth-form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.laf-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.laf-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.laf-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.laf-input:focus { border-color: var(--accent); }
.laf-error {
  font-size: 0.82rem;
  color: var(--accent2);
  background: rgba(255,107,138,0.1);
  border: 1px solid rgba(255,107,138,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.laf-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 4px;
}
.laf-btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.laf-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.laf-switch {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.laf-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.laf-link:hover { color: var(--accent2); }

/* Transition de sortie du landing */
#landing.fade-out {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════
   ATELIER (Canvas privés) — page entière
══════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════
   PANEL ADMIN — sidebar SaaS layout
══════════════════════════════════════════════════════ */

/* ── Override du layout panel hérité — admin = plein écran sans sheet ── */
/* PAS de !important ici pour laisser .panel.hidden { display:none !important } fonctionner */
#panel-admin {
  display: block;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}
/* Force le masquage quand .hidden est présent — doit rester après la règle ci-dessus */
#panel-admin.hidden {
  display: none !important;
}

/* ── Layout principal ── */
.adm-layout {
  display: flex;
  width: 100%; height: 100%;
  overflow: hidden;
}

/* ── Sidebar ── */
.adm-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100%;
}
.adm-sidebar-header {
  padding: 18px 16px 14px;
  font-size: .95rem; font-weight: 800;
  color: var(--accent2);
  border-bottom: 1px solid var(--border);
  letter-spacing: .02em;
  display: flex; flex-direction: column; gap: 2px;
  flex-shrink: 0;
}
.adm-sidebar-version {
  font-size: .65rem; font-weight: 500;
  color: var(--text-muted); letter-spacing: .08em;
  text-transform: uppercase;
}
.adm-sidebar-nav {
  flex: 1; overflow-y: auto; padding: 10px 0;
  display: flex; flex-direction: column; gap: 2px;
}
.adm-nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 16px;
  background: none; border: none; border-left: 3px solid transparent;
  cursor: pointer;
  color: var(--text-muted); font-size: .85rem; font-weight: 600;
  text-align: left;
  transition: background .12s, color .12s, border-color .12s;
  position: relative; white-space: nowrap;
}
.adm-nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.adm-nav-item.active {
  background: rgba(124,111,247,.10); color: var(--accent);
  border-left-color: var(--accent);
}
.adm-nav-item .adm-nav-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; }
.adm-nav-item .adm-nav-label { flex: 1; }
.adm-sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border);
}
.adm-close-sidebar-btn {
  width: 100%; background: none; border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 8px; font-size: .8rem; cursor: pointer;
  transition: all .15s;
}
.adm-close-sidebar-btn:hover { border-color: var(--accent2); color: var(--accent2); }

/* Badge signalements */
#adm-reports-badge,
.adm-reports-badge-el {
  display: none;
  align-items: center; justify-content: center;
  margin-left: auto;
  background: var(--accent2); color: #fff;
  font-size: .62rem; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; line-height: 1;
}

/* ── Main zone ── */
.adm-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  min-width: 0;
}
.adm-topbar {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.adm-page-title {
  margin: 0; font-size: 1rem; font-weight: 800; color: var(--text);
}
.adm-content {
  flex: 1; overflow-y: auto; padding: 18px 22px;
  min-height: 0;
}

/* ── Nav button accent ── */
#nav-btn-admin { color: var(--accent2); }
#nav-btn-admin.active { color: var(--accent2); border-bottom-color: var(--accent2); }

/* ── Dashboard stats grid ── */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.adm-stat-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  display: flex; flex-direction: column; gap: 5px;
  border-top: 3px solid var(--card-col, var(--accent));
  transition: transform .12s, box-shadow .12s;
}
.adm-stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.adm-stat-icon { line-height: 1; display: flex; align-items: center; justify-content: center; }
.adm-stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.adm-stat-label { font-size: .73rem; color: var(--text-muted); }

/* ── Dashboard grid (chart + log) ── */
.adm-dash-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 900px) { .adm-dash-grid { grid-template-columns: 1fr; } }

/* ── Panel card ── */
.adm-panel {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  margin-bottom: 14px;
}
.adm-panel-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ── Log feed (dashboard) ── */
.adm-log-row {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: .8rem;
}
.adm-log-row:last-child { border-bottom: none; }
.adm-log-time   { color: var(--text-muted); white-space: nowrap; }
.adm-log-actor  { color: var(--accent); font-weight: 700; }
.adm-log-action { color: var(--text); }
.adm-log-target { color: var(--accent2); }

/* ── Toolbar ── */
.adm-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.adm-input {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 8px 12px; font-size: .85rem; outline: none;
  transition: border-color .15s; flex: 1; min-width: 180px;
}
.adm-input:focus { border-color: var(--accent); }
.adm-input-sm { flex: none; width: 70px; min-width: unset; padding: 6px 8px; }
.adm-select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 8px 10px; font-size: .85rem; cursor: pointer; outline: none;
}
.adm-total-label { font-size: .78rem; color: var(--text-muted); margin-bottom: 8px; }

/* ── Action buttons ── */
.adm-btn {
  background: var(--surface3); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 7px 14px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: all .15s; white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.adm-btn:disabled { opacity: .4; cursor: not-allowed; }
.adm-btn-primary { background: rgba(124,111,247,.15); border-color: rgba(124,111,247,.4); color: var(--accent); }
.adm-btn-primary:hover { background: rgba(124,111,247,.25); }
.adm-btn-danger  { background: rgba(255,107,138,.12); border-color: rgba(255,107,138,.35); color: var(--accent2); }
.adm-btn-danger:hover { background: rgba(255,107,138,.22); }
.adm-btn-success { background: rgba(67,232,176,.12); border-color: rgba(67,232,176,.35); color: var(--accent3); }
.adm-btn-success:hover { background: rgba(67,232,176,.22); }
.adm-btn-muted   { background: rgba(255,255,255,.05); border-color: var(--border); color: var(--text-muted); }
.adm-btn-muted:hover { background: rgba(255,255,255,.09); color: var(--text); }
.adm-btn-info    { background: rgba(99,179,237,.12); border-color: rgba(99,179,237,.35); color: #63b3ed; }
.adm-btn-info:hover { background: rgba(99,179,237,.22); }
.adm-btn-sm { padding: 4px 9px; font-size: .75rem; }

/* ── User row ── */
.adm-user-row {
  display: grid;
  grid-template-columns: 190px minmax(130px,1fr) 90px 85px 85px minmax(150px,190px);
  align-items: center; gap: 0;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 6px;
  transition: border-color .15s, background .15s; overflow: hidden;
  min-width: 0;
}
.adm-user-row:hover { border-color: rgba(124,111,247,.3); background: rgba(124,111,247,.03); }
.adm-user-row.adm-user-banned { border-color: rgba(255,107,138,.3); background: rgba(255,107,138,.04); }

.adm-cell {
  padding: 10px 12px; border-right: 1px solid var(--border);
  display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden;
}
.adm-cell:last-child { border-right: none; }
.adm-cell-identity { flex-direction: column; align-items: flex-start; gap: 3px; }
.adm-cell-stat { flex-direction: column; align-items: flex-start; gap: 1px; }
.adm-cell-stat b { font-size: .85rem; color: var(--text); }
.adm-cell-stat small { font-size: .68rem; color: var(--text-muted); }
.adm-cell-actions { gap: 5px; flex-wrap: wrap; padding: 8px 10px; }

.adm-pseudo { font-size: .9rem; font-weight: 700; color: var(--text); }
.adm-pseudo.adm-link { cursor: pointer; }
.adm-pseudo.adm-link:hover { color: var(--accent); text-decoration: underline; }
.adm-email  { font-size: .7rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-muted-text { font-size: .72rem; color: var(--text-muted); }

/* ── Admin Events ── */
.adm-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.adm-section-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.adm-evt-form-wrap { margin-bottom: 20px; }
.adm-evt-form { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.adm-evt-form-head { font-size: 1rem; font-weight: 700; margin: 0 0 16px; }
.adm-form-row--2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-color-input { height: 36px; padding: 2px 4px; cursor: pointer; }
.adm-form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.adm-req { color: #f87171; }
.adm-badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.adm-badge--green { background: rgba(34,184,112,.18); color: #22b870; border: 1px solid rgba(34,184,112,.3); }
.adm-badge--gray  { background: rgba(160,150,200,.1); color: var(--text-muted); border: 1px solid var(--border); }
.adm-table-wrap { overflow-x: auto; }
.adm-btn--edit { background: rgba(124,111,247,.15); color: #a89eff; }
.adm-btn--edit:hover { background: rgba(124,111,247,.28); }

/* ── Table header ── */
.adm-table-header {
  display: grid;
  grid-template-columns: 190px minmax(130px,1fr) 90px 85px 85px minmax(150px,190px);
  padding: 5px 0; margin-bottom: 4px;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.adm-table-header span { padding: 0 12px; }

/* ── Role badge + tags ── */
.adm-role-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; border: 1px solid; border-radius: 4px;
  padding: 2px 6px; white-space: nowrap;
}
.adm-tag {
  font-size: 9px; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; border: 1px solid; border-radius: 4px; padding: 2px 6px;
}
.adm-tag-ban  { color: var(--accent2); background: rgba(255,107,138,.1);  border-color: rgba(255,107,138,.3); }
.adm-tag-mute { color: #ffa502;        background: rgba(255,165,2,.1);    border-color: rgba(255,165,2,.3); }
.adm-tag-warn { color: #f7b731;        background: rgba(247,183,49,.1);   border-color: rgba(247,183,49,.3); }

/* ── Action icons ── */
.adm-action-icon {
  padding: 4px; border-radius: 5px;
  transition: background .12s; cursor: pointer;
  user-select: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.adm-action-icon:hover { background: rgba(255,255,255,.1); }

/* ── Role menu dropdown ── */
.adm-role-menu {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,.65); min-width: 130px;
}
.adm-role-opt {
  background: none; border: none; color: var(--text); text-align: left;
  padding: 7px 12px; border-radius: 5px; cursor: pointer;
  font-size: .82rem; font-weight: 600; transition: background .12s;
}
.adm-role-opt:hover { background: var(--surface3); }

/* ── Generic HTML table ── */
.adm-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
}
.adm-table th {
  text-align: left; padding: 8px 10px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.adm-table td {
  padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle; color: var(--text);
}
.adm-table tr:last-child td { border-bottom: none; }
.adm-table tr:hover td { background: rgba(255,255,255,.02); }
code.adm-code {
  background: rgba(124,111,247,.15); color: var(--accent);
  border-radius: 4px; padding: 1px 6px; font-size: .78rem;
}

/* ── Status badges ── */
.adm-status-badge {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; border: 1px solid; border-radius: 4px; padding: 2px 7px;
}
.adm-status-pending  { color: #ffa502; background: rgba(255,165,2,.1); border-color: rgba(255,165,2,.3); }
.adm-status-resolved { color: var(--accent3); background: rgba(67,232,176,.1); border-color: rgba(67,232,176,.3); }
.adm-status-ignored  { color: var(--text-muted); background: rgba(255,255,255,.05); border-color: var(--border); }

/* ── Pagination ── */
.adm-pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.adm-page-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  width: 34px; height: 34px; font-size: .82rem; cursor: pointer; transition: all .12s;
}
.adm-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.adm-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Modal overlay ── */
.adm-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; backdrop-filter: blur(6px);
}
.adm-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); width: 90%; max-width: 680px;
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.7);
}
.adm-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0;
  background: var(--surface); z-index: 1;
}
.adm-modal-header h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.adm-modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 1.2rem;
  cursor: pointer; padding: 4px 8px; border-radius: 5px; transition: background .12s;
}
.adm-modal-close:hover { background: rgba(255,255,255,.08); color: var(--text); }
.adm-modal-body { padding: 16px 20px; }

/* ── Info grid (modal details) ── */
.adm-info-grid { display: flex; flex-direction: column; gap: 6px; }
.adm-info-row {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  font-size: .83rem; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.adm-info-row:last-child { border-bottom: none; }
.adm-info-label { min-width: 130px; color: var(--text-muted); font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.adm-info-value { color: var(--text); flex: 1; }

/* ── Roles grid ── */
.adm-roles-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.adm-role-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-top: 3px solid var(--role-col, var(--accent));
  border-radius: var(--radius);
}
.adm-role-card-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.adm-role-card-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.adm-role-card-title { flex: 1; font-weight: 700; font-size: .9rem; text-transform: capitalize; }
.adm-role-card-count {
  background: rgba(255,255,255,.08); border-radius: 20px;
  padding: 2px 9px; font-size: .75rem; font-weight: 700;
}
.adm-role-card-list { list-style: none; padding: 8px 0; margin: 0; max-height: 250px; overflow-y: auto; }
.adm-role-card-member {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px; font-size: .83rem; transition: background .1s;
}
.adm-role-card-member:hover { background: rgba(255,255,255,.03); }
.adm-role-card-empty { padding: 12px 14px; color: var(--text-muted); font-size: .82rem; }
.adm-link { cursor: pointer; color: var(--text); }
.adm-link:hover { color: var(--accent); text-decoration: underline; }

/* ── Canvas section ── */
.adm-canvas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px; align-items: start;
}
.adm-form-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.adm-form-row label { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.adm-inspect-result { margin-top: 12px; }
.adm-freeze-status {
  background: rgba(67,232,176,.1); border: 1px solid rgba(67,232,176,.3);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: .88rem; color: var(--accent3); font-weight: 600;
}
.adm-freeze-status.frozen {
  background: rgba(0,210,255,.1); border-color: rgba(0,210,255,.3);
  color: #00d2ff;
}

/* ── Settings grid ── */
.adm-settings-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
}
.adm-setting-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.adm-setting-row-full { flex-wrap: wrap; }
.adm-setting-row-full .adm-input { flex: 1; min-width: 200px; }
.adm-setting-row:last-child { border-bottom: none; }
.adm-setting-info { flex: 1; min-width: 0; }
.adm-setting-label { font-size: .86rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.adm-setting-desc  { font-size: .73rem; color: var(--text-muted); line-height: 1.4; }

/* Toggle switch */
.adm-toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.adm-toggle input { opacity: 0; width: 0; height: 0; }
.adm-toggle-slider {
  position: absolute; inset: 0; background: var(--surface3);
  border-radius: 24px; cursor: pointer; transition: background .2s;
  border: 1px solid var(--border);
}
.adm-toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: var(--text-muted); border-radius: 50%; transition: all .2s;
}
.adm-toggle input:checked + .adm-toggle-slider { background: rgba(124,111,247,.3); border-color: var(--accent); }
.adm-toggle input:checked + .adm-toggle-slider::before { transform: translateX(18px); background: var(--accent); }

/* ── State messages ── */
.adm-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--text-muted); font-size: .85rem; padding: 40px 0;
}
.adm-spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: adm-spin .7s linear infinite;
}
@keyframes adm-spin { to { transform: rotate(360deg); } }
.adm-empty {
  color: var(--text-muted); font-size: .85rem; text-align: center; padding: 32px 0;
}
.adm-error {
  color: var(--accent2); background: rgba(255,107,138,.08);
  border: 1px solid rgba(255,107,138,.25); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: .85rem;
}

/* ── Filtres signalements ── */
.adm-r-filter-group {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.adm-r-filter {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.adm-r-filter:hover { background: var(--surface2); color: var(--text); }
.adm-r-filter.active {
  background: rgba(139,92,246,.15);
  border-color: rgba(139,92,246,.45);
  color: #a78bfa;
}

/* ── Cartes signalements ── */
.adm-report-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color .15s;
}
.adm-report-card:hover { border-color: rgba(255,255,255,.12); }
.adm-report-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.adm-report-status { font-size: .75rem; font-weight: 600; }
.adm-report-date   { font-size: .72rem; color: var(--text-muted); }
.adm-report-body   { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.adm-report-parties {
  display: flex; align-items: center; gap: 8px; font-size: .83rem;
}
.adm-report-actor  { color: var(--text-muted); }
.adm-report-target { color: var(--accent2, #ff6b8a); }
.adm-report-arrow  { color: var(--text-muted); font-size: .7rem; }
.adm-report-reason {
  display: flex; align-items: center; gap: 7px;
  font-size: .82rem; color: var(--text);
}
.adm-report-dot {
  width: 11px; height: 11px;
  border-radius: 3px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
}
.adm-report-detail {
  font-size: .78rem; color: var(--text-muted);
  font-style: italic;
  padding-left: 2px;
  border-left: 2px solid var(--border);
  padding-left: 8px;
}
.adm-report-footer {
  display: flex; gap: 6px; flex-wrap: wrap;
}

/* ── Group row ── */
.adm-group-row {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 6px;
  transition: border-color .15s;
}
.adm-group-row:hover { border-color: rgba(124,111,247,.2); }
.adm-group-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.adm-group-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.adm-group-name  { font-size: .92rem; font-weight: 700; color: var(--text); }
.adm-group-stats { font-size: .78rem; color: var(--text-muted); }

/* ── Mobile / narrow ── */
@media (max-width: 780px) {
  .adm-sidebar { width: 180px; }
}
@media (max-width: 580px) {
  .adm-sidebar { display: none; }
  .adm-user-row { grid-template-columns: 1fr; }
  .adm-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .adm-cell:last-child { border-bottom: none; }
  .adm-table-header { display: none; }
  .adm-dash-grid { grid-template-columns: 1fr; }
  .adm-roles-grid { grid-template-columns: 1fr; }
  .adm-settings-grid { grid-template-columns: 1fr; }
  .adm-canvas-grid { grid-template-columns: 1fr; }
}

/* ── Diagnostics ── */
.adm-diag-banner {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px;
  font-size: .88rem; font-weight: 600; border: 1px solid;
}
.adm-diag-banner-ok    { background: rgba(67,232,176,.08); border-color: rgba(67,232,176,.25); color: #43e8b0; }
.adm-diag-banner-warn  { background: rgba(247,183,49,.08);  border-color: rgba(247,183,49,.25);  color: #f7b731; }
.adm-diag-banner-error { background: rgba(255,71,87,.08);   border-color: rgba(255,71,87,.25);   color: #ff4757; }

.adm-diag-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.adm-diag-dot-ok    { background: #43e8b0; box-shadow: 0 0 6px #43e8b088; }
.adm-diag-dot-warn  { background: #f7b731; box-shadow: 0 0 6px #f7b73188; }
.adm-diag-dot-error { background: #ff4757; box-shadow: 0 0 6px #ff475788; }

.adm-diag-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.adm-diag-panel-full { grid-column: 1 / -1; }

.adm-diag-metric {
  font-size: 1.3rem; font-weight: 700; color: var(--text); margin: 8px 0 4px;
}
.adm-diag-of { font-size: .85rem; font-weight: 400; color: var(--text-muted); }

.adm-diag-bar-row {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 10px;
}
.adm-diag-bar-wrap {
  flex: 1; height: 7px; background: rgba(255,255,255,.07);
  border-radius: 4px; overflow: hidden;
}
.adm-diag-bar-fill {
  height: 100%; border-radius: 4px; transition: width .4s ease;
}
.adm-diag-bar-ok    { background: linear-gradient(90deg, #43e8b0, #1fd4a1); }
.adm-diag-bar-warn  { background: linear-gradient(90deg, #f7b731, #e8a020); }
.adm-diag-bar-error { background: linear-gradient(90deg, #ff4757, #e8001e); }
.adm-diag-bar-label { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }

.adm-diag-db-layout {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start;
  margin-top: 10px;
}
.adm-diag-counts-panel {
  min-width: 200px; background: rgba(255,255,255,.02);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px;
}

@media (max-width: 700px) {
  .adm-diag-grid { grid-template-columns: 1fr; }
  .adm-diag-db-layout { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   ÉCRAN DE BAN
══════════════════════════════════════════════════════ */
#banned-screen {
  position: fixed; inset: 0;
  background: rgba(8, 8, 14, 0.97);
  backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .5s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#banned-box {
  text-align: center;
  max-width: 480px;
  padding: 48px 40px;
  background: var(--surface);
  border: 1px solid rgba(255, 107, 138, .35);
  border-radius: 24px;
  box-shadow: 0 0 60px rgba(255, 107, 138, .15), 0 24px 60px rgba(0,0,0,.8);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

#banned-icon {
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(255,107,138,.5));
}

#banned-title {
  font-size: 1.9rem; font-weight: 800;
  color: var(--accent2);
  margin: 0;
}

#banned-subtitle {
  font-size: .95rem; color: var(--text-muted);
  margin: 0;
}
#banned-subtitle strong { color: var(--text); }

#banned-reason-wrap,
#banned-by-wrap {
  width: 100%;
  background: rgba(255,107,138,.07);
  border: 1px solid rgba(255,107,138,.2);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: left;
}

.banned-label {
  display: block;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent2); margin-bottom: 4px;
}

#banned-reason-text,
#banned-by-text {
  margin: 0; font-size: .9rem;
  color: var(--text); font-weight: 500;
  word-break: break-word;
}

#banned-footer {
  font-size: .75rem; color: var(--text-muted);
  margin: 8px 0 0; font-style: italic;
}

/* ══════════════════════════════════════════════════════
   UTILS
══════════════════════════════════════════════════════ */
.hidden { display: none !important; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }


/* ══════════════════════════════════════════════════════
   GROUP SYSTEM OVERHAUL
══════════════════════════════════════════════════════ */

/* Notification bell — position:relative pour le badge seulement */
#notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent2);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* Privacy badge in group list */
.group-privacy-badge {
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.privacy-public  { background: rgba(67,232,176,.12); color: var(--accent3); }
.privacy-private { background: rgba(255,107,138,.12); color: var(--accent2); }

/* Kick button in group detail */
.btn-kick {
  background: none;
  border: 1px solid rgba(255,107,138,.35);
  color: var(--accent2);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .72rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-kick:hover { background: rgba(255,107,138,.12); }

/* Join request items in modal */
.join-request-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.join-request-item:last-child { border-bottom: none; }
.join-request-pseudo { flex: 1; font-size: .9rem; font-weight: 500; }
.btn-accept {
  background: rgba(67,232,176,.15);
  border: 1px solid rgba(67,232,176,.4);
  color: var(--accent3);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .75rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-accept:hover { background: rgba(67,232,176,.28); }
.btn-reject {
  background: rgba(255,107,138,.1);
  border: 1px solid rgba(255,107,138,.35);
  color: var(--accent2);
  border-radius: 6px;
  padding: 3px 10px;
  font-size: .75rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-reject:hover { background: rgba(255,107,138,.2); }

/* Privacy select in create-group form */
.auth-form-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: .88rem;
  margin-bottom: 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.auth-form-select:focus { outline: none; border-color: var(--accent); }

.auth-form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: .88rem;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
}
.auth-form-input:focus { outline: none; border-color: var(--accent); }
.auth-form-input::placeholder { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════
   MY-GROUP CARD + GROUP DETAIL OVERHAUL
══════════════════════════════════════════════════════ */

/* Carte "Mon Groupe" dans le panel groups */
.my-group-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.my-group-header { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.my-group-logo {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.my-group-info { min-width: 0; }
.my-group-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-group-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.my-group-spots { font-size: .75rem; color: var(--text-muted); }
.my-group-actions { display: flex; gap: 6px; flex-shrink: 0; }
.my-group-tag {
  font-size: .62rem; background: rgba(108,99,255,.18); color: var(--accent);
  border-radius: 20px; padding: 1px 7px; font-weight: 600; vertical-align: middle;
}
.group-card--mine { border-color: var(--accent); background: rgba(108,99,255,.05); }

/* Boutons taille sm */
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-leave-inline { color: var(--accent2); border-color: rgba(255,107,138,.3); }
.btn-leave-danger { color: var(--accent2); }
.btn-danger {
  background: rgba(255,107,138,.12);
  border: 1px solid rgba(255,107,138,.4);
  color: var(--accent2);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: rgba(255,107,138,.22); }

/* Ban button */
.btn-ban {
  background: none;
  border: 1px solid rgba(255,107,138,.5);
  color: var(--accent2);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .72rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-ban:hover { background: rgba(255,107,138,.2); }

/* Group detail header */
.gd-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  position: relative;
}
.gd-logo {
  width: 60px; height: 60px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; color: #fff;
  background: var(--surface2); flex-shrink: 0;
  overflow: hidden;
}
.gd-logo img { width: 100%; height: 100%; object-fit: cover; }
.gd-header-info { flex: 1; min-width: 0; }
.gd-name { font-size: 1.2rem; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gd-desc { font-size: .85rem; color: var(--text-muted); margin: 4px 0; }
.gd-stats { display: flex; gap: 14px; font-size: .8rem; color: var(--text-muted); flex-wrap: wrap; margin-top: 4px; }
.gd-stats strong { color: var(--text); }
.spots-open { color: var(--accent3); font-weight: 600; }
.spots-full  { color: var(--accent2); font-weight: 600; }
.gd-close {
  position: absolute; top: 0; right: 0;
  background: none; border: none; font-size: 1rem;
  cursor: pointer; color: var(--text-muted); padding: 4px 8px;
}
.gd-close:hover { color: var(--text); }

/* Settings leader */
.gd-settings {
  background: rgba(108,99,255,.07);
  border: 1px solid rgba(108,99,255,.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.gd-settings-title { font-size: .78rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.gd-settings-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Section titre */
.gd-section { margin-bottom: 16px; }
.gd-section-title { font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }

/* Member list améliorée */
.member-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.member-name { flex: 1; font-weight: 600; font-size: .9rem; }
.member-px { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.member-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Footer actions */
.gd-footer-actions {
  display: flex; gap: 8px; margin-top: 4px; margin-bottom: 16px;
  padding-top: 12px; border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Groups search + list header ── */
.groups-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.groups-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: .8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.groups-search-wrap { flex: 1; max-width: 220px; }
.groups-search {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 10px;
  font-size: .82rem;
  outline: none;
  transition: border-color .15s;
}
.groups-search:focus { border-color: var(--accent); }

/* ══ LANDING REDESIGN — Question + CTA + Wave + Transition ══ */

/* Question aléatoire */
.landing-question {
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.3px;
  background: linear-gradient(120deg, #fff 30%, var(--accent) 70%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: landingFadeUp 0.6s ease both 0.15s;
  max-width: 400px;
  line-height: 1.35;
}

/* Bouton CTA principal */
.landing-btn-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  font-size: 1.1rem;
  font-weight: 800;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  box-shadow: 0 8px 32px rgba(124,111,247,0.45), 0 0 0 0 rgba(124,111,247,0);
  transition: transform 0.18s cubic-bezier(.22,1,.36,1), box-shadow 0.18s, filter 0.18s;
  animation: landingFadeUp 0.6s ease both 0.3s;
  letter-spacing: 0.5px;
  overflow: visible;
  z-index: 1;
}
.landing-btn-cta:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 14px 42px rgba(124,111,247,0.6);
  filter: brightness(1.1);
}
.landing-btn-cta:active {
  transform: translateY(-1px) scale(0.98);
}

/* Vague ripple depuis le CTA */
.landing-wave {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(124,111,247,0.6);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 0;
  animation: waveExpand 1.4s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes waveExpand {
  0%   { transform: translate(-50%,-50%) scale(0);   opacity: 0.65; border-color: rgba(124,111,247,0.65); }
  40%  { opacity: 0.4; border-color: rgba(255,107,138,0.45); }
  100% { transform: translate(-50%,-50%) scale(9);   opacity: 0; }
}

/* Overlay transition pixel art */
#landing-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}
#landing-transition.hidden { display: none; }

/* ══════════════════════════════════════════════════════
   TUTORIAL
══════════════════════════════════════════════════════ */
#modal-tutorial { z-index: 700; }

.tutorial-box {
  width: 520px;
  max-width: calc(100vw - 32px);
  padding: 0;
  overflow: hidden;
}

/* Header : points de progression */
.tutorial-header {
  padding: 20px 24px 0;
  display: flex;
  justify-content: center;
}
.tutorial-dots {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.tutorial-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: background .2s, transform .2s;
}
.tutorial-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

/* Corps de la slide */
.tutorial-body {
  padding: 20px 32px 24px;
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tutorial-emoji {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 10px;
}
.tutorial-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.tutorial-text {
  color: var(--text-muted);
  font-size: .9rem;
  line-height: 1.65;
  max-width: 380px;
  margin-bottom: 18px;
}
.tutorial-gif {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
}
.tutorial-gif.hidden { display: none; }

/* Footer : navigation */
.tutorial-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 18px;
  border-top: 1px solid var(--border);
}
.tutorial-footer-right {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
}
/* Quand "Passer" est masqué, les boutons droits occupent toute la largeur */
#tutorial-btn-skip.hidden ~ .tutorial-footer-right {
  width: 100%;
  justify-content: space-between;
}

/* =============================================
   CONTEXT MENU (clic droit canvas)
   ============================================= */
#canvas-ctx-menu {
  position: fixed;
  z-index: 9000;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  overflow: hidden;
  display: block;
  user-select: none;
}
#canvas-ctx-menu.hidden { display: none; }

.ctx-header {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctx-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
}
.ctx-author {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.ctx-coords {
  font-size: .7rem;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
}
.ctx-sep {
  height: 1px;
  background: var(--border);
  margin: 0;
}
.ctx-item {
  /* reset bouton navigateur */
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  /* style */
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
  box-sizing: border-box;
}
.ctx-item:hover { background: var(--surface2); }
.ctx-item--danger { color: var(--error, #f87171); }
.ctx-item--danger:hover { background: rgba(248,113,113,.1); }
.ctx-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  font-size: .95rem;
  line-height: 1;
  flex-shrink: 0;
}
.ctx-loading,
.ctx-empty {
  padding: 16px 14px;
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
}

/* =============================================
   MODAL SIGNALEMENT
   ============================================= */
#modal-report .modal-body { display: flex; flex-direction: column; gap: 14px; }

.report-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
}
.report-meta strong { color: var(--text); }
.report-meta .ctx-dot { width: 12px; height: 12px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   MODÉRATION ADMIN — Bannière, barre d'action, confirmation
══════════════════════════════════════════════════════════════ */

.admin-erase-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9000;
  background: rgba(200, 30, 30, 0.92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .04em;
  backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(255, 80, 80, .6);
}
.admin-erase-banner .hi { width: 18px; height: 18px; flex-shrink: 0; }

.admin-erase-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9000;
  background: rgba(18, 12, 12, 0.95);
  border-top: 2px solid rgba(255, 60, 60, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 20px;
  backdrop-filter: blur(8px);
}

.admin-erase-count {
  font-size: .9rem;
  color: #ffaaaa;
  min-width: 160px;
  text-align: center;
}

.admin-erase-do {
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.admin-erase-do:hover:not(:disabled) { background: #e74c3c; }
.admin-erase-do:disabled { opacity: .4; cursor: default; }

.admin-erase-cancel {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s;
}
.admin-erase-cancel:hover { background: var(--surface4, var(--surface3)); }

.admin-erase-sizes {
  display: flex;
  align-items: center;
  gap: 5px;
}
.admin-erase-sizes-label {
  font-size: .82rem;
  color: #aaa;
  margin-right: 2px;
}
.admin-erase-size-btn {
  background: var(--surface3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.admin-erase-size-btn:hover { background: var(--surface4, var(--surface3)); color: var(--text); }
.admin-erase-size-btn.active {
  background: rgba(200, 40, 40, .25);
  border-color: rgba(220, 60, 60, .6);
  color: #ff8888;
}

.admin-erase-bar-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.1);
  margin: 0 4px;
  flex-shrink: 0;
}

/* Modal confirmation */
.modal-box-erase-confirm { width: min(90vw, 420px); }

.admin-erase-warning {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(200, 30, 30, .1);
  border: 1px solid rgba(200, 30, 30, .35);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 12px 0;
  color: #ffbbbb;
  font-size: .88rem;
  line-height: 1.5;
}
.admin-erase-warning .hi { width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; color: #e74c3c; }
.admin-erase-warning p { margin: 0; }
.admin-erase-warning strong { color: #ff7070; }

.admin-erase-confirm-count {
  font-size: .88rem;
  color: var(--text-muted);
  margin: 8px 0 0;
  text-align: center;
}

.admin-erase-confirm-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 14px;
}

/* Highlight modération dans la liste des panels */
.adm-panel-moderation {
  border: 1px solid rgba(200, 60, 60, .3);
}

/* Bannière rechargement forcé */
.force-reload-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  background: rgba(30, 100, 200, 0.93);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .03em;
  backdrop-filter: blur(6px);
  border-bottom: 2px solid rgba(80, 140, 255, .6);
}
.force-reload-banner .hi { width: 18px; height: 18px; flex-shrink: 0; }


/* ═══════════════════════════════════════════════════════════
   GRANDE CARTE (LargeMap)
   ═══════════════════════════════════════════════════════════ */

/* ── Modal ── */
.modal-box-largemap {
  width: min(94vw, 820px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* ── Header ── */
.largemap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 14px 20px;
  background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, rgba(20,184,166,.06) 100%);
  border-bottom: 1px solid rgba(99,102,241,.2);
  flex-shrink: 0;
}
.largemap-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.largemap-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1 0%, #14b8a6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(99,102,241,.4);
}
.largemap-header-icon .hi {
  width: 18px;
  height: 18px;
  stroke: #fff;
}
.largemap-header-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.largemap-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(90deg, #a5b4fc 0%, #5eead4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: .02em;
  line-height: 1.2;
}
.largemap-subtitle {
  font-size: .7rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .7;
}
.largemap-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background .12s, color .12s;
  display: flex;
  align-items: center;
}
.largemap-close-btn:hover { background: var(--surface3); color: var(--text); }
.largemap-close-btn .hi { width: 18px; height: 18px; }

/* ── Corps : carte + sidebar côte à côte ── */
.largemap-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Colonne gauche : carte ── */
.largemap-left {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 460px;
}

.largemap-canvas-wrap {
  position: relative;
  width: 460px;
  height: 460px;
  background: #1e2030;
  overflow: hidden;
  flex-shrink: 0;
}

#largemap-canvas {
  display: block;
  width: 460px;
  height: 460px;
  image-rendering: pixelated;
}

.largemap-hint-bar {
  padding: 6px 14px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-size: .72rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface2);
}

/* Tooltip coordonnées */
.largemap-coord-tip {
  position: absolute;
  background: rgba(10,10,20,.85);
  color: #eeeef5;
  font-size: .70rem;
  padding: 3px 7px;
  border-radius: 5px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  border: 1px solid rgba(255,255,255,.12);
}

/* Curseur ping */
.largemap-ping-cursor {
  position: absolute;
  pointer-events: none;
  transform: translate(-50%, -100%);
  z-index: 20;
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
}
.largemap-ping-icon { width: 26px; height: 26px; display: block; }

/* ── Colonne droite : sidebar ── */
.largemap-sidebar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  overflow: hidden;
}

.largemap-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.largemap-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Zones */
.largemap-zones {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.largemap-zone-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
}
.largemap-zone-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Bouton CTA ping ── */
.largemap-ping-cta-wrap {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.largemap-ping-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.largemap-ping-cta:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(96,85,232,.06);
}
.largemap-ping-cta.active {
  border-style: solid;
  border-color: #ff6b6b;
  color: #ff6b6b;
  background: rgba(255,107,107,.07);
}
.largemap-ping-cta .hi { width: 15px; height: 15px; }

/* ── Liste pings ── */
.largemap-pings-section {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-bottom: none;
  min-height: 0;
}
.largemap-ping-count {
  background: var(--accent);
  color: #fff;
  font-size: .62rem;
  padding: 1px 5px;
  border-radius: 10px;
  font-weight: 700;
  letter-spacing: 0;
}
.largemap-ping-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.largemap-empty {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 18px 12px;
  line-height: 1.6;
}
.largemap-ping-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background .12s;
  border-radius: 0;
}
.largemap-ping-item:hover { background: var(--surface2); }

.ping-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,.15);
}
.ping-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ping-label {
  font-size: .81rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ping-meta {
  font-size: .68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ping-goto-btn,
.ping-del-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color .15s, background .15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ping-goto-btn:hover { color: var(--accent);  background: var(--surface3); }
.ping-del-btn:hover  { color: var(--accent2); background: var(--surface3); }
.ping-goto-btn .hi,
.ping-del-btn .hi { width: 13px; height: 13px; }

/* ── Modal création ping ── */
.modal-box-ping-create {
  width: min(92vw, 520px);
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.ping-create-layout {
  display: flex;
  min-height: 0;
}

/* Colonne gauche : mini aperçu */
.ping-preview-col {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px;
  background: #0e1420;
  border-right: 1px solid var(--border);
}

.ping-preview-canvas {
  border-radius: 50%;
  display: block;
  width: 130px;
  height: 130px;
  image-rendering: pixelated;
}

.ping-create-coords {
  font-size: .68rem;
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

/* Colonne droite : formulaire */
.ping-form-col {
  flex: 1;
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.ping-form-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.ping-form-pin-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  transition: filter .2s;
}

.ping-form-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

.ping-form-subtitle {
  font-size: .72rem;
  color: var(--text-muted);
}

.ping-form-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.ping-form-input {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .88rem;
  outline: none;
  transition: border-color .15s;
}
.ping-form-input:focus { border-color: var(--accent); }

.ping-label-count {
  font-size: .65rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: -6px;
}

/* Grille de couleurs */
.ping-color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.ping-swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s;
  padding: 0;
  min-width: 0;
}
.ping-swatch:hover { transform: scale(1.18); }
.ping-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2.5px var(--c), 0 0 8px var(--c);
  transform: scale(1.15);
}

/* Boutons */
.ping-create-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.ping-btn-cancel {
  flex: 1;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ping-btn-cancel:hover { background: var(--surface2); color: var(--text); }

.ping-btn-ok {
  flex: 2;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity .15s, transform .1s;
}
.ping-btn-ok:hover { opacity: .88; }
.ping-btn-ok:active { transform: scale(.97); }
.ping-btn-ok .hi { width: 15px; height: 15px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .modal-box-largemap { width: 98vw; max-height: 95vh; }
  .largemap-body { flex-direction: column; }
  .largemap-left { width: 100%; }
  .largemap-canvas-wrap { width: 100%; height: auto; aspect-ratio: 1; }
  #largemap-canvas { width: 100%; height: auto; }
  .largemap-sidebar { border-left: none; border-top: 1px solid var(--border); max-height: 240px; }
  .ping-create-layout { flex-direction: column; }
  .ping-preview-col { width: 100%; flex-direction: row; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--border); }
}

/* ══════════════════════════════════════════════════════════════
   DASHBOARD — Tableau de bord  (Glassmorphism · 3 colonnes)
══════════════════════════════════════════════════════════════ */

/* ── Keyframes transitions dashboard ── */
@keyframes dashPanelIn {
  from { opacity: 0; transform: scale(.98); }
  to   { opacity: 1; transform: scale(1);   }
}
@keyframes dashCardIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1);  }
}
@keyframes dashMapIn {
  from { opacity: 0; transform: scale(.93); }
  to   { opacity: 1; transform: scale(1);   }
}
@keyframes dashLabelIn {
  from { opacity: 0; letter-spacing: .5em; }
  to   { opacity: 1; letter-spacing: .25em; }
}

/* Entrée */
#panel-dashboard.dash-entering {
  animation: dashPanelIn .4s cubic-bezier(.22,1,.36,1) both;
}
#panel-dashboard.dash-entering .dash-card {
  opacity: 0;
  animation: dashCardIn .5s cubic-bezier(.22,1,.36,1) both;
}
#panel-dashboard.dash-entering .dash-left  > .dash-card:nth-child(1) { animation-delay: .06s; }
#panel-dashboard.dash-entering .dash-left  > .dash-card:nth-child(2) { animation-delay: .14s; }
#panel-dashboard.dash-entering .dash-left  > .dash-card:nth-child(3) { animation-delay: .22s; }
#panel-dashboard.dash-entering .dash-left  > .dash-card:nth-child(4) { animation-delay: .30s; }
#panel-dashboard.dash-entering .dash-right > .dash-card:nth-child(1) { animation-delay: .10s; }
#panel-dashboard.dash-entering .dash-right > .dash-card:nth-child(2) { animation-delay: .18s; }
#panel-dashboard.dash-entering .dash-circle-wrap {
  animation: dashMapIn .6s cubic-bezier(.22,1,.36,1) .08s both;
}
#panel-dashboard.dash-entering .dash-zone-label {
  animation: dashLabelIn .5s ease .4s both;
}


/* ── Panel ── */
#panel-dashboard {
  display: block;
  overflow: hidden;
  /* Mode SOMBRE (défaut ici car glassmorphism) */
  background:
    radial-gradient(ellipse 70% 55% at 15% 5%,  rgba(99,70,220,.28) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 85% 85%, rgba(232,77,112,.18) 0%, transparent 60%),
    radial-gradient(ellipse 80% 80% at 50% 50%, rgba(10,6,22,1) 0%, #060410 100%);
}
#panel-dashboard.hidden { display: none !important; }
@keyframes dashFadeOut { from { opacity: 1; } to { opacity: 0; } }
#panel-dashboard.dash-fading-out {
  animation: dashFadeOut .2s ease forwards;
  pointer-events: none;
}


/* Canvas eau en arrière-plan */
#dash-water-canvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  image-rendering: pixelated;
  opacity: .35;
  mix-blend-mode: screen;
}

/* Orbes décoratifs */
#panel-dashboard::before, #panel-dashboard::after {
  content: ''; position: fixed; pointer-events: none; z-index: 0;
  border-radius: 50%;
}
#panel-dashboard::before {
  top: -100px; right: -100px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,111,247,.18) 0%, transparent 65%);
}
#panel-dashboard::after {
  bottom: -150px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,77,112,.12) 0%, transparent 65%);
}

/* ══ MODE CLAIR ═══════════════════════════════════════════════ */
:root:not([data-theme="dark"]) #panel-dashboard {
  background:
    radial-gradient(ellipse 70% 55% at 15% 5%,  rgba(120,100,220,.1) 0%, transparent 60%),
    radial-gradient(ellipse 55% 45% at 85% 85%, rgba(200,60,100,.07) 0%, transparent 60%),
    #eeebff;
}
:root:not([data-theme="dark"]) #dash-water-canvas {
  opacity: .28;
  mix-blend-mode: multiply;
}
:root:not([data-theme="dark"]) #panel-dashboard::before {
  background: radial-gradient(circle, rgba(124,111,247,.1) 0%, transparent 65%);
}
:root:not([data-theme="dark"]) #panel-dashboard::after {
  background: radial-gradient(circle, rgba(232,77,112,.08) 0%, transparent 65%);
}

/* Cards light */
:root:not([data-theme="dark"]) .dash-card {
  background: rgba(255,255,255,.72) padding-box,
              linear-gradient(135deg, rgba(124,111,247,.22), rgba(124,111,247,.06)) border-box;
  box-shadow: 0 4px 24px rgba(80,60,160,.08), inset 0 1px 0 rgba(255,255,255,.95);
  color: var(--text);
}
:root:not([data-theme="dark"]) .dash-card:hover {
  box-shadow: 0 8px 32px rgba(80,60,160,.13), inset 0 1px 0 rgba(255,255,255,.95),
              0 0 0 1px rgba(124,111,247,.2);
}
:root:not([data-theme="dark"]) .dash-welcome-card {
  background: linear-gradient(135deg, rgba(124,111,247,.12), rgba(232,77,112,.07)) padding-box,
              linear-gradient(135deg, rgba(124,111,247,.35), rgba(232,77,112,.2)) border-box;
  box-shadow: 0 4px 30px rgba(124,111,247,.1);
}
:root:not([data-theme="dark"]) .dash-card-title  { color: rgba(80,65,140,.6); }
:root:not([data-theme="dark"]) .dash-greeting     { color: var(--text); }
:root:not([data-theme="dark"]) .dash-welcome-sub  { color: rgba(80,65,140,.7); font-style: italic; }
:root:not([data-theme="dark"]) .dash-stat-label   { color: rgba(80,65,140,.55); }
:root:not([data-theme="dark"]) .dash-stat-block--row .dash-stat-big { }
:root:not([data-theme="dark"]) .dash-stat-divider { background: rgba(0,0,0,.07); }
:root:not([data-theme="dark"]) .dash-online-pseudo { color: var(--text); }
:root:not([data-theme="dark"]) .dash-online-pixels { color: var(--text-muted); }
:root:not([data-theme="dark"]) .dash-online-user  { }
:root:not([data-theme="dark"]) .dash-notif-title  { color: var(--text); }
:root:not([data-theme="dark"]) .dash-notif-time   { color: var(--text-muted); }
:root:not([data-theme="dark"]) .dash-notif-item   { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.07); }
:root:not([data-theme="dark"]) .dash-notif-item:hover { background: rgba(0,0,0,.06); }
:root:not([data-theme="dark"]) .dash-empty-msg    { color: var(--text-muted); }
:root:not([data-theme="dark"]) .dash-chat-text    { color: var(--text); }
:root:not([data-theme="dark"]) .dash-chat-pseudo  { color: var(--text); }
:root:not([data-theme="dark"]) .dash-chat-time    { color: var(--text-muted); }
:root:not([data-theme="dark"]) .dash-chat-msg     { }
:root:not([data-theme="dark"]) .dash-chat-footer  { border-color: rgba(0,0,0,.08); }
:root:not([data-theme="dark"]) .dash-chat-input {
  background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.1); color: var(--text);
}
:root:not([data-theme="dark"]) .dash-chat-input::placeholder { color: var(--text-muted); }
:root:not([data-theme="dark"]) .dash-chat-input:focus {
  border-color: rgba(124,111,247,.4); background: rgba(124,111,247,.05);
}
:root:not([data-theme="dark"]) .dash-stat-item    { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.07); }
:root:not([data-theme="dark"]) .dash-stats-bar {
  background: rgba(255,255,255,.7) padding-box,
              linear-gradient(135deg, rgba(124,111,247,.18), rgba(124,111,247,.05)) border-box;
  box-shadow: 0 2px 16px rgba(80,60,160,.07);
}
:root:not([data-theme="dark"]) .dash-bar-sep      { background: rgba(0,0,0,.08); }
:root:not([data-theme="dark"]) .dash-bar-label    { color: rgba(80,65,140,.5); }

/* ── Grille 3 colonnes ── */
.dash-grid {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: minmax(200px, 270px) 1fr minmax(220px, 300px);
  grid-template-rows: 1fr;
  gap: 16px;
  width: 100%;
  height: 100vh;
  padding: calc(var(--header-h) + 14px) 20px 14px;
  box-sizing: border-box;
}
/* Colonne gauche : scrolle entièrement */
.dash-left {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0;
  overflow-y: auto; overflow-x: clip;
  padding: 8px 10px 8px 8px;
  margin: -8px -10px -8px -8px;
  scrollbar-width: thin; scrollbar-color: rgba(124,111,247,.2) transparent;
}
.dash-left::-webkit-scrollbar { width: 3px; }
.dash-left::-webkit-scrollbar-thumb { background: rgba(124,111,247,.25); border-radius: 2px; }

/* Colonne droite : les cards prennent l'espace, les listes scrollent en interne */
.dash-right {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding: 8px 8px 8px 10px;
  margin: -8px -8px -8px -10px;
}
.dash-center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0;
  min-height: 0;
}
/* Cards gauche : taille naturelle (la colonne scrolle) */
.dash-left > .dash-card { flex-shrink: 0; }
/* Cards droite : s'adaptent à l'espace dispo */
.dash-right > .dash-card { flex-shrink: 1; min-height: 0; display: flex; flex-direction: column; }
/* Les listes dans les cards scrollent si le contenu dépasse */
.dash-ping-list, .dash-chat-list, .dash-online-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}

/* ── Carte verre ── */
.dash-card {
  background:
    linear-gradient(135deg, rgba(255,255,255,.055) 0%, rgba(255,255,255,.018) 100%) padding-box,
    linear-gradient(135deg, rgba(255,255,255,.13) 0%, rgba(255,255,255,.04) 100%) border-box;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 18px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  transition: box-shadow .22s;
}
.dash-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.5), 0 0 0 1px rgba(124,111,247,.22);
}
.dash-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 8px;
}
.dash-card-title {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .13em; color: rgba(190,180,230,.6);
  flex: 1;
}

/* ── Bienvenue ── */
.dash-welcome-card {
  background:
    linear-gradient(135deg, rgba(124,111,247,.2) 0%, rgba(168,85,247,.1) 50%, rgba(232,77,112,.1) 100%) padding-box,
    linear-gradient(135deg, rgba(124,111,247,.55) 0%, rgba(232,77,112,.35) 100%) border-box;
  border: 1px solid transparent;
  box-shadow: 0 0 16px rgba(99,102,241,.15), 0 3px 10px rgba(0,0,0,.4);
  padding: 22px 20px;
}
.dash-greeting {
  font-size: 1.25rem; font-weight: 800;
  color: #fff; margin: 0 0 6px;
}
.dash-welcome-sub {
  font-size: 0.85rem; font-style: italic;
  color: rgba(220,210,255,.7); margin: 0; line-height: 1.5;
}

/* ── Stats (gauche) ── */
.dash-stat-block { display: flex; flex-direction: column; gap: 3px; padding: 4px 0; }
.dash-stat-block--row { flex-direction: row; align-items: flex-end; justify-content: space-between; }
.dash-stat-divider {
  height: 1px; background: rgba(255,255,255,.07);
  margin: 10px 0;
}
.dash-stat-label {
  font-size: 0.68rem; color: rgba(180,165,220,.55);
  text-transform: uppercase; letter-spacing: .08em;
}
.dash-stat-big {
  font-size: 1.75rem; font-weight: 900; line-height: 1.1;
  background: linear-gradient(90deg, #a89cf7, #c47bff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(168,156,247,.35));
}
.dash-stat-gold {
  background: linear-gradient(90deg, #f7d46f, #f9a14b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(247,212,111,.3));
}
.dash-stat-purple {
  background: linear-gradient(90deg, #a89cf7, #e84d70);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dash-rank-badge {
  background: linear-gradient(135deg, rgba(124,111,247,.25), rgba(124,111,247,.1));
  border: 1px solid rgba(124,111,247,.4);
  color: rgba(180,165,255,.9); font-size: 0.72rem; font-weight: 800;
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
  box-shadow: 0 0 12px rgba(124,111,247,.2);
}

/* ── Notifications ── */
.dash-notifs-list { display: flex; flex-direction: column; gap: 10px; }
.dash-notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
}
.dash-notif-item:hover { background: rgba(255,255,255,.08); }
.dash-notif-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.dash-notif-body { flex: 1; min-width: 0; }
.dash-notif-title { font-size: 0.8rem; font-weight: 700; color: rgba(230,220,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-notif-time  { font-size: 0.68rem; color: rgba(160,150,200,.5); margin-top: 2px; }
.dash-empty-msg { font-size: 0.82rem; color: rgba(160,150,200,.45); font-style: italic; }

/* ── Événements dashboard ── */
.dash-events-list { display: flex; flex-direction: column; gap: 10px; }
.dash-event-item {
  border-radius: 10px; overflow: hidden;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}
.dash-event-info { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; }
.dash-event-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.dash-event-body { flex: 1; min-width: 0; }
.dash-event-title { font-size: 0.85rem; font-weight: 700; color: rgba(230,220,255,.92); }
.dash-event-desc  { font-size: 0.75rem; color: rgba(180,170,220,.6); margin-top: 2px; }
.dash-event-dates { font-size: 0.7rem; color: rgba(160,150,200,.45); margin-top: 3px; }

/* Carousel événement (dashboard card) */
.dash-evt-carousel {
  position: relative; width: 100%; height: 120px; overflow: hidden;
  border-radius: 0;
}
.dash-evt-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .5s ease;
}
.dash-evt-slide.active { opacity: 1; }
.dash-evt-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45); color: #fff; border: none;
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer;
  font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center;
  z-index: 2; transition: background .2s;
}
.dash-evt-nav:hover { background: rgba(0,0,0,.7); }
.dash-evt-nav--prev { left: 6px; }
.dash-evt-nav--next { right: 6px; }
.dash-evt-dots { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; z-index:2; }
.dash-evt-dot-btn {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.4); cursor: pointer; transition: background .2s;
}
.dash-evt-dot-btn.active { background: var(--evt-color, #7c6ff7); }

/* ── Splash modal événement ── */
.evt-splash-overlay {
  position: fixed; inset: 0; z-index: 9900;
  background: rgba(5,2,15,.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.evt-splash-overlay.hidden { display: none; }
.evt-splash-modal {
  position: relative;
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 560px; width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: splashIn .35s cubic-bezier(.22,1,.36,1);
}
@keyframes splashIn { from { opacity:0; transform: scale(.88) translateY(30px); } to { opacity:1; transform: none; } }
.evt-splash-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(255,255,255,.12); border: none; color: #fff;
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  font-size: .85rem; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.evt-splash-close:hover { background: rgba(255,255,255,.25); }

/* Carousel splash */
.evt-splash-carousel { position: relative; height: 280px; overflow: hidden; }
.evt-splash-slides { position: relative; width: 100%; height: 100%; }
.evt-splash-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .5s ease;
}
.evt-splash-slide.active { opacity: 1; }
.evt-splash-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.5); color: #fff; border: none;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-size: 1.4rem; z-index: 2; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.evt-splash-nav:hover { background: rgba(0,0,0,.75); }
.evt-splash-nav--prev { left: 12px; }
.evt-splash-nav--next { right: 12px; }
.evt-splash-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; z-index:2; }
.evt-splash-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,.35); cursor: pointer; transition: background .2s;
}
.evt-splash-dot.active { background: #fff; }

/* Corps splash */
.evt-splash-color-bar { height: 4px; }
.evt-splash-body { padding: 20px 24px 24px; }
.evt-splash-title { font-size: 1.5rem; font-weight: 800; margin: 0 0 8px; color: #fff; }
.evt-splash-desc  { font-size: .9rem; color: rgba(200,190,240,.75); margin: 0 0 6px; line-height: 1.5; }
.evt-splash-dates { font-size: .75rem; color: rgba(160,150,200,.5); margin: 0 0 18px; }
.evt-splash-ok-btn {
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #7c6ff7, #5b4de0);
  color: #fff; font-weight: 700; font-size: 1rem; cursor: pointer;
  transition: opacity .2s;
}
.evt-splash-ok-btn:hover { opacity: .88; }

/* Admin events images */
.adm-evt-imgs-wrap { display: flex; flex-direction: column; gap: 10px; }
.adm-evt-imgs-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-evt-img-thumb { position: relative; width: 80px; height: 60px; border-radius: 6px; overflow: hidden; }
.adm-evt-img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.adm-evt-img-del {
  position: absolute; top: 3px; right: 3px;
  background: rgba(220,50,50,.85); color: #fff; border: none;
  border-radius: 50%; width: 18px; height: 18px; font-size: .65rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.adm-evt-img-upload-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px; cursor: pointer;
  background: rgba(124,111,247,.18); color: #a89eff;
  font-size: .82rem; font-weight: 600; border: 1px dashed rgba(124,111,247,.4);
  transition: background .2s;
}
.adm-evt-img-upload-label:hover { background: rgba(124,111,247,.3); }
.adm-evt-img-hint { font-size: .7rem; color: var(--text-muted); }

/* ── Carte circulaire ── */
/* ── Loader carte ── */
.dash-map-loader {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; background: #0a0616; border-radius: 50%;
}
.dash-map-loader.hidden { display: none; }
.dash-map-loader span { color: var(--text-muted); font-size: .85rem; }
.dash-map-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(124,111,247,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dash-spin .8s linear infinite;
}
@keyframes dash-spin { to { transform: rotate(360deg); } }

.dash-circle-wrap {
  position: relative;
  /* Toujours carré : la largeur s'adapte, la hauteur suit via aspect-ratio */
  width:  min(100%, calc(100vh - var(--header-h) - 56px));
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  cursor: crosshair;
  border: 3px solid #6b4c30;
  box-shadow:
    0 0 0 5px rgba(62,37,23,.15),
    0 0 40px rgba(180,140,60,.2),
    0 0 80px rgba(62,37,23,.1),
    0 16px 60px rgba(0,0,0,.6);
  transition: box-shadow .3s, border-color .3s;
  flex-shrink: 0;
}
.dash-circle-wrap:hover {
  border-color: #8b6340;
  box-shadow:
    0 0 0 7px rgba(62,37,23,.2),
    0 0 60px rgba(180,140,60,.35),
    0 0 100px rgba(62,37,23,.15),
    0 20px 70px rgba(0,0,0,.7);
}

/* Hint "Cliquer pour naviguer" au survol */
.dash-circle-hint {
  position: absolute; bottom: 18%; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.45);
  background: rgba(0,0,0,.35); padding: 4px 12px; border-radius: 20px;
  pointer-events: none;
  opacity: 0; transition: opacity .25s;
}
.dash-circle-wrap:hover .dash-circle-hint { opacity: 1; }
.dash-circle-wrap.dash-zoom-active .dash-circle-hint { display: none; }
.dash-circle-wrap.dash-zoom-active .dash-zone-label  { display: none; }

/* Bouton retour vue complète */
.dash-map-back-btn {
  display: none;
  position: absolute; bottom: 18%; left: 50%; transform: translateX(-50%);
  background: rgba(10,6,22,0.78); color: #fff;
  border: 1px solid rgba(255,255,255,0.25); border-radius: 20px;
  padding: 5px 18px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; pointer-events: all; z-index: 10;
  white-space: nowrap; transition: background .2s;
}
.dash-map-back-btn:hover { background: rgba(40,20,80,0.9); }
.dash-circle-wrap.dash-zoom-active .dash-map-back-btn { display: block; }
#dash-map-canvas {
  width: 100%; height: 100%; display: block;
  image-rendering: pixelated;
}

/* Zone labels overlay sur la carte circulaire */
.dash-zone-labels {
  position: absolute; inset: 0; pointer-events: none;
}
.dash-zone-label {
  position: absolute;
  font-size: 0.6rem; font-weight: 600;
  font-style: italic;
  font-family: 'Georgia', 'Times New Roman', serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  padding: 3px 10px;
  border-radius: 4px;
  color: #3e2517;
  background: rgba(232,212,162,0.7);
  border: 1px solid rgba(62,37,23,0.25);
  backdrop-filter: blur(2px);
  text-shadow: 0 1px 0 rgba(240,226,192,0.6);
}
/* Centré dans chaque quadrant du cercle */
.dash-zone-tl { top: 26%; left: 26%; }
.dash-zone-tr { top: 26%; left: 74%; }
.dash-zone-bl { top: 74%; left: 26%; }
.dash-zone-br { top: 74%; left: 74%; }

/* ── Bouton ouvrir canvas ── */
.dash-open-canvas-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: min(100%, 480px);
  padding: 14px 24px;
  background: linear-gradient(135deg, rgba(124,111,247,.25), rgba(232,77,112,.15));
  border: 1px solid rgba(124,111,247,.4);
  border-radius: 50px;
  color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .04em;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 30px rgba(124,111,247,.2), 0 4px 20px rgba(0,0,0,.4);
  transition: background .2s, box-shadow .2s, transform .15s;
}
.dash-open-canvas-btn:hover {
  background: linear-gradient(135deg, rgba(124,111,247,.4), rgba(232,77,112,.25));
  box-shadow: 0 0 50px rgba(124,111,247,.4), 0 6px 28px rgba(0,0,0,.5);
  transform: translateY(-2px);
}
.dash-open-canvas-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Barre de stats en bas de la carte ── */
.dash-stats-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0;
  width: min(100%, 480px);
  background:
    linear-gradient(135deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,.02) 100%) padding-box,
    linear-gradient(135deg, rgba(255,255,255,.1) 0%, rgba(255,255,255,.03) 100%) border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  backdrop-filter: blur(20px);
  overflow: hidden;
}
.dash-bar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; gap: 2px;
}
.dash-bar-sep { width: 1px; height: 36px; background: rgba(255,255,255,.08); flex-shrink: 0; }
.dash-bar-value {
  font-size: 1.05rem; font-weight: 900;
  background: linear-gradient(90deg, #a89cf7, #e84d70);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dash-bar-online {
  background: linear-gradient(90deg, #4ade80, #22c55e);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dash-bar-label {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(180,165,220,.5); font-weight: 600;
}

/* ── Online list (droite) ── */
.dash-badge-green {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff; font-size: 0.7rem; font-weight: 800;
  padding: 3px 9px; border-radius: 20px; min-width: 24px; text-align: center;
  box-shadow: 0 0 12px rgba(34,197,94,.45);
}
.dash-online-card { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dash-online-list {
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto; flex: 1; min-height: 0;
  scrollbar-width: thin; scrollbar-color: rgba(124,111,247,.3) transparent;
}
.dash-online-list::-webkit-scrollbar { width: 4px; }
.dash-online-list::-webkit-scrollbar-thumb { background: rgba(124,111,247,.3); border-radius: 2px; }
.dash-online-user {
  display: flex; align-items: center; gap: 10px;
}
.dash-online-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: hsl(var(--av-hue, 260deg), 60%, 42%);
  color: #fff; font-size: 0.85rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 0 10px hsla(var(--av-hue, 260deg), 60%, 50%, .45);
}
img.dash-online-avatar, img.dash-avatar-img.dash-online-avatar {
  object-fit: cover; background: transparent;
}
.dash-online-info { flex: 1; min-width: 0; }
.dash-online-pseudo { font-size: 0.85rem; font-weight: 700; color: rgba(230,220,255,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-online-pixels { font-size: 0.68rem; color: rgba(160,150,200,.55); margin-top: 1px; }
.dash-online-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px #22c55e; flex-shrink: 0; }

/* ── Ping card dashboard ── */
.dash-ping-card { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dash-ping-add-btn {
  display: flex; align-items: center; gap: 5px;
  margin-left: auto; padding: 5px 12px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,111,247,.25), rgba(232,77,112,.2));
  border: 1px solid rgba(124,111,247,.35); color: rgba(200,180,255,.9);
  font-size: 0.73rem; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.dash-ping-add-btn:hover { background: linear-gradient(135deg, rgba(124,111,247,.45), rgba(232,77,112,.35)); transform: scale(1.03); }
.dash-ping-add-btn.active { background: rgba(232,77,112,.3); border-color: rgba(232,77,112,.5); color: var(--accent2); }
.dash-ping-add-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.dash-ping-list {
  display: flex; flex-direction: column; gap: 6px;
  overflow-y: auto; flex: 1; min-height: 0; margin-top: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(124,111,247,.3) transparent;
}
.dash-ping-list::-webkit-scrollbar { width: 4px; }
.dash-ping-list::-webkit-scrollbar-thumb { background: rgba(124,111,247,.3); border-radius: 2px; }
.dash-ping-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: default;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
  transition: background .12s;
}
.dash-ping-item:hover { background: rgba(124,111,247,.1); }

/* ── Chat global (conservé mais masqué — classes orphelines) ── */
.dash-chat-card { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.dash-chat-messages {
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto; max-height: 260px;
  padding: 4px 2px;
  scrollbar-width: thin; scrollbar-color: rgba(124,111,247,.3) transparent;
}
.dash-chat-messages::-webkit-scrollbar { width: 4px; }
.dash-chat-messages::-webkit-scrollbar-track { background: transparent; }
.dash-chat-messages::-webkit-scrollbar-thumb { background: rgba(124,111,247,.3); border-radius: 2px; }
.dash-chat-msg { display: flex; gap: 9px; align-items: flex-start; }
.dash-chat-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: hsl(var(--av-hue, 260deg), 60%, 42%);
  color: #fff; font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
}
img.dash-chat-avatar, img.dash-avatar-img.dash-chat-avatar {
  object-fit: cover; background: transparent;
}
.dash-chat-body { flex: 1; min-width: 0; }
.dash-chat-meta { display: flex; align-items: baseline; gap: 6px; margin-bottom: 2px; }
.dash-chat-pseudo { font-size: 0.78rem; font-weight: 700; color: rgba(220,210,255,.9); }
.dash-chat-time   { font-size: 0.63rem; color: rgba(160,150,200,.45); }
.dash-chat-text   { font-size: 0.82rem; color: rgba(210,200,250,.75); line-height: 1.45; word-break: break-word; }
.dash-chat-footer {
  display: flex; gap: 8px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid rgba(255,255,255,.07);
}
.dash-chat-input {
  flex: 1; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px; padding: 9px 14px;
  color: rgba(230,220,255,.9); font-size: 0.83rem;
  outline: none; transition: border-color .2s, background .2s;
}
.dash-chat-input::placeholder { color: rgba(160,150,200,.4); }
.dash-chat-input:focus { border-color: rgba(124,111,247,.5); background: rgba(124,111,247,.08); }
.dash-chat-send {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #7c6ff7, #e84d70);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 16px rgba(124,111,247,.4);
  transition: transform .15s, box-shadow .15s;
}
.dash-chat-send:hover { transform: scale(1.08); box-shadow: 0 0 24px rgba(124,111,247,.6); }
.dash-chat-send svg { width: 15px; height: 15px; color: #fff; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: minmax(180px, 220px) 1fr minmax(180px, 240px); gap: 12px; padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 960px) {
  /* 2 colonnes : carte en haut, sidebars en dessous côte à côte */
  .dash-grid {
    grid-template-columns: 1fr 1fr; gap: 10px;
    grid-template-rows: auto 1fr;
    padding-left: 12px; padding-right: 12px;
  }
  .dash-center { order: -1; grid-column: 1 / -1; }
  .dash-circle-wrap { max-width: min(100%, 40vh); margin: 0 auto; }
  .dash-open-canvas-btn, .dash-stats-bar { width: 100%; }
}
@media (max-width: 700px) {
  /* 1 colonne — scrollable */
  #panel-dashboard { overflow-y: auto; }
  .dash-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto; min-height: 100vh;
    padding: calc(var(--header-h) + 12px) 14px 48px;
  }
  .dash-center { order: -1; }
  .dash-circle-wrap, .dash-open-canvas-btn, .dash-stats-bar { width: 100%; }
  .dash-circle-wrap { max-width: 360px; margin: 0 auto; }
}

/* ══════════════════════════════════════════════════════
   TABLETTE — < 800px
══════════════════════════════════════════════════════ */
@media (max-width: 800px) {
  #header { padding: 0 10px; gap: 8px; }
  #logo { font-size: 1.1rem; }
  .nav-btn { padding: 6px 12px; font-size: .8rem; }
  #header-right { gap: 5px; }
}

/* ══════════════════════════════════════════════════════
   MOBILE — < 600px
══════════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ── Header ── */
  #header { padding: 0 8px; gap: 6px; }
  #logo { font-size: 1rem; }
  #nav { gap: 2px; }
  .nav-btn { padding: 6px 10px; font-size: .76rem; }
  #header-right { gap: 4px; }
  #players-wrap { padding: 0 8px; height: 30px; font-size: .72rem; }
  #btn-help { width: 30px; height: 30px; }
  #btn-help svg { width: 14px; height: 14px; }

  /* ── Dashboard ── */
  .dash-grid {
    grid-template-columns: 1fr;
    padding: calc(var(--header-h) + 8px) 10px 60px;
    gap: 10px;
  }
  .dash-center { order: -1; min-height: auto; }

  /* Carte ronde : largeur = écran, aspect-ratio garde le cercle */
  .dash-circle-wrap {
    width: calc(100vw - 28px) !important;
    max-width: 400px;
  }

  /* Zone labels plus petits */
  .dash-zone-label { font-size: .48rem; padding: 2px 6px; letter-spacing: .12em; }

  /* Cartes dashboard */
  .dash-card { padding: 14px; border-radius: 14px; }
  .dash-card-header { margin-bottom: 10px; }
  .dash-card-title { font-size: .6rem; }

  /* Welcome card */
  .dash-welcome-title { font-size: 1.1rem; }
  .dash-welcome-sub { font-size: .8rem; }

  /* Spectator banner ajusté */
  #spectator-banner { bottom: 10px; padding: 7px 14px; font-size: .76rem; gap: 8px; }

  /* Stats bar */
  .dash-stats-bar { flex-wrap: wrap; gap: 6px; }

  /* Music button */
  #audio-controls { bottom: 10px; right: 10px; }
  .audio-ctrl-btn { width: 34px; height: 34px; }

  /* Compass */
  .dash-compass-wrap { width: 38px; height: 38px; }
  .dash-compass-wrap svg { width: 22px; height: 22px; }

  /* Ping list */
  /* ping list s'adapte via flex */
  .dash-ping-add-btn { font-size: .72rem; padding: 4px 10px; }

  /* Chat */
  .dash-chat-list { max-height: 160px; }
  .dash-chat-input { font-size: .8rem; }
}

/* ══════════════════════════════════════════════════════
   SPECTATOR MOBILE — mobile + spectator combined
══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  body.spectator-mode #header-right { display: none; }
  body.spectator-mode #header { justify-content: center; }
  body.spectator-mode #logo { display: none; }
  body.spectator-mode #nav { justify-content: center; flex: unset; }
  body.spectator-mode .nav-btn { padding: 7px 16px; font-size: .85rem; }
}

/* ── Audio controls (musique + sfx) ── */
#audio-controls {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  gap: 6px;
  align-items: flex-end;
}
.audio-ctrl {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.audio-ctrl-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(124,111,247,.35);
  background: rgba(18,14,36,.8);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,.65);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.audio-ctrl-btn:hover {
  background: rgba(124,111,247,.25);
  color: #fff;
  border-color: rgba(124,111,247,.6);
}

/* ── Slider wrap — apparaît au hover ── */
.audio-slider-wrap {
  position: absolute;
  bottom: 100%; /* colle juste au-dessus du bouton */
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 0;
  overflow: hidden;
  background: rgba(18,14,36,.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(124,111,247,.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin-bottom: 4px;
  opacity: 0;
  transition: height .25s cubic-bezier(.4,0,.2,1), opacity .2s ease, padding .25s;
  pointer-events: none;
}
.audio-ctrl:hover .audio-slider-wrap {
  height: 110px;
  padding: 10px 0;
  opacity: 1;
  pointer-events: all;
}
/* Zone invisible entre bouton et slider pour maintenir le hover */
.audio-ctrl::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0; right: 0;
  height: 8px;
}

/* ── Bouton muted (rouge foncé) ── */
.audio-ctrl-btn.muted {
  background: rgba(120,30,30,.7);
  border-color: rgba(200,60,60,.4);
  color: rgba(255,100,100,.7);
}
.audio-ctrl-btn.muted:hover {
  background: rgba(150,40,40,.8);
  border-color: rgba(220,80,80,.5);
  color: rgba(255,130,130,.9);
}

/* ── Slider vertical ── */
.audio-vol-slider {
  -webkit-appearance: none;
  appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 4px;
  height: 90px;
  background: rgba(255,255,255,.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.audio-vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(124,111,247,.5);
  cursor: grab;
}
.audio-vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(124,111,247,.5);
  cursor: grab;
}
.audio-vol-slider::-webkit-slider-runnable-track {
  background: transparent;
}
.audio-vol-slider::-moz-range-track {
  background: transparent;
}

/* ── Pixelizer — onglets Image / Texte ─────────────────────── */
.px-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.px-tab {
  flex: 1;
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.px-tab:hover { color: var(--text); }
.px-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Outil Texte — layout dans le modal Pixelizer ────────── */
.pxt-layout {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#pxt-library-panel {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  background: var(--surface2);
}
#pxt-lib-recents {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pxt-params {
  padding: 14px 16px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border);
}
.pxt-preview-col {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
}
.pxt-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  display: block;
  margin-bottom: 3px;
}
.pxt-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pxt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pxt-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pxt-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--text);
  padding: 8px 10px;
  font-size: .9rem;
  line-height: 1.4;
  min-height: 56px;
  outline: none;
  transition: border-color .15s;
}
.pxt-textarea:focus { border-color: rgba(124,111,247,.6); }
.pxt-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--text);
  padding: 5px 8px;
  font-size: .83rem;
  outline: none;
  cursor: pointer;
}
.pxt-num {
  width: 62px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--text);
  padding: 5px 6px;
  font-size: .83rem;
  text-align: center;
  outline: none;
}
.pxt-color {
  width: 34px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 1px;
  background: none;
  flex-shrink: 0;
}
.pxt-range {
  flex: 1;
  accent-color: var(--accent);
  min-width: 40px;
}
.pxt-range-val {
  font-size: .75rem;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}
.pxt-toggle-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.pxt-toggle-label input[type="checkbox"] {
  accent-color: var(--accent);
}
.pxt-preview-box {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ccc;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pxt-preview-box canvas {
  display: block;
  max-width: 100%;
}
.pxt-pixel-count {
  font-size: .73rem;
  color: var(--text-muted);
  text-align: center;
}
.pxt-place-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c6ff7, #e84d70);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  margin-top: auto;
  transition: opacity .15s;
}
.pxt-place-btn:hover { opacity: .9; }


/* ── Palette — overlay mode auto-couleur calque ───────────── */
.palette-autocolor-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  pointer-events: all;
  cursor: default;
}
.palette-autocolor-overlay.hidden { display: none; }
.palette-autocolor-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-align: center;
  padding: 16px;
}
.palette-autocolor-icon { font-size: 2rem; line-height: 1; }
.palette-autocolor-msg > span {
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.palette-autocolor-msg small {
  font-size: .72rem;
  opacity: .72;
  line-height: 1.3;
}

/* ── Picker avancé — supprimer le gap laissé par le bouton retiré ─ */
#color-advanced { gap: 8px; }

/* ── Texte lib : miniature (div au lieu de img) ── */
.pxtlib-thumb {
  width: 42px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #ccc;
  flex-shrink: 0;
}

/* ── Bouton Sauvegarder (texte) ── */
.pxt-save-btn {
  width: 100%;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface3);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s;
}
.pxt-save-btn:hover { background: var(--surface2); }

/* ── Admin collab sessions ─────────────────────────────── */
.adm-collab-list { display:flex; flex-direction:column; gap:1rem; padding:1rem; }
.adm-collab-card { background:var(--c-surface-2); border-radius:.75rem; padding:1rem 1.25rem; border:1px solid var(--c-border); }
.adm-collab-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:.5rem; }
.adm-collab-card-head strong { font-size:1rem; color:var(--c-text); }
.adm-collab-lock { font-size:.8rem; color:var(--c-text-muted); }
.adm-collab-card-info { display:flex; flex-wrap:wrap; gap:.75rem; font-size:.82rem; color:var(--c-text-muted); margin-bottom:.6rem; }
.adm-collab-members { display:flex; flex-wrap:wrap; gap:.4rem; margin-bottom:.75rem; }
.adm-collab-member { display:inline-block; padding:.2rem .55rem; border-radius:1rem; font-size:.75rem; background:var(--c-surface-3,#333); color:var(--c-text-muted); border:1px solid var(--c-border); }
.adm-collab-member.online { background:rgba(34,197,94,.15); color:#22c55e; border-color:rgba(34,197,94,.3); }
.adm-collab-force-end { margin-top:.25rem; }
