/* =====================================================================
   Omicron, le cercle — feuille de style
   Direction artistique : fond sombre, accent or unique, titres serif.
   ===================================================================== */

:root {
  --bg:          #0E0E11;
  --bg-elev:     #15151A;
  --surface:     #17171D;
  --surface-2:   #1D1D24;
  --line:        rgba(198, 166, 100, 0.18);
  --line-soft:   rgba(236, 230, 216, 0.08);
  --text:        #ECE6D8;
  --text-dim:    #9A958A;
  --text-faint:  #6C6860;
  --gold:        #C6A664;
  --gold-bright: #E7D199;
  --gold-deep:   #9F7C40;
  --danger:      #D08A8A;
  --success:     #9BBF8E;

  --serif: "Playfair Display", "Cormorant Garamond", Didot, "Bodoni 72", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 5px;
  --maxw-auth: 420px;
  --maxw-app: 1080px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app { min-height: 100vh; }

a { color: inherit; text-decoration: none; }

::selection { background: rgba(198, 166, 100, 0.25); color: var(--gold-bright); }

/* ---- Accessibilité : focus clavier --------------------------------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}
.input:focus-visible { outline: none; } /* géré par .input:focus (bordure + halo) */

/* ---- Matière : grain fin + vignettage (profondeur, effet « papier ») -- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(130% 110% at 50% -10%, transparent 58%, rgba(0, 0, 0, 0.42) 100%);
}
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
}

/* ---- Animations (minimales) ---------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes drawRule {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}
.fade-in { animation: fadeUp 0.5s var(--ease) both; }

/* Entrée cérémonieuse de l'accueil (le conteneur ne s'anime pas, les
   éléments apparaissent en cascade). */
.screen-home.fade-in { animation: none; }
.screen-home .home-logo-wrap { animation: riseIn 1.1s var(--ease) both; }
.screen-home .home-tagline   { animation: riseIn 1s var(--ease) 0.45s both; }
.screen-home .home-actions   { animation: riseIn 1s var(--ease) 0.75s both; }

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .screen-home .home-logo-wrap,
  .screen-home .home-tagline,
  .screen-home .home-actions { animation: none; }
}

/* ---- Écran générique ----------------------------------------------- */
.screen { min-height: 100vh; display: flex; flex-direction: column; }

/* ---- Accueil ------------------------------------------------------- */
.screen-home {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px 64px;
  background: var(--bg);
}
.home { width: 100%; max-width: 360px; }
/* Le logo (SVG transparent) est posé sur un wrapper qui porte le halo en
   dégradé radial CSS : il s'éteint en douceur bien avant ses bords, donc
   aucun rectangle visible — contrairement à un fond embarqué dans le SVG. */
.home-logo-wrap {
  position: relative;
  width: min(72vw, 300px);
  margin: 0 auto;
}
.home-logo-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 33%;                 /* centre du Ο (cy=210/640) */
  width: 150%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side,
              rgba(198, 166, 100, 0.18),
              rgba(198, 166, 100, 0.05) 46%,
              transparent 72%);
  pointer-events: none;
  z-index: -1;              /* derrière la marque */
}
.home-logo {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
}
.home-tagline {
  position: relative;
  margin: 34px 0 42px;
  padding-top: 28px;
  color: var(--text-dim);
  font-family: var(--serif);
  font-size: 1.08rem;
  font-style: italic;
  letter-spacing: 0.3px;
}
.home-tagline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
}
.home-actions { display: grid; gap: 14px; }

/* ---- Marque (écrans internes) -------------------------------------- */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.wordmark-name {
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.34em;
  color: var(--text);
  text-indent: 0.34em;
}
.wordmark-rule { width: 46px; height: 1px; background: var(--gold); opacity: 0.6; }
.wordmark-sub {
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.42em;
  color: var(--gold);
  text-indent: 0.42em;
}

/* ---- Écran d'authentification -------------------------------------- */
.screen-auth { align-items: center; justify-content: center; padding: 48px 22px; }
.auth { width: 100%; max-width: var(--maxw-auth); display: flex; flex-direction: column; align-items: center; gap: 30px; }
.card {
  width: 100%;
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.auth-footer { font-size: 0.9rem; color: var(--text-dim); text-align: center; }

/* ---- Titres -------------------------------------------------------- */
.title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.7rem;
  letter-spacing: 0.2px;
  margin: 0 0 6px;
}
.subtitle { margin: 0 0 24px; color: var(--text-dim); font-size: 0.95rem; }

/* ---- Formulaires --------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(198, 166, 100, 0.12);
}
.input-code {
  text-align: center;
  /* Police à « chiffres anciens » : les chiffres descendent légèrement sous
     la ligne des lettres (effet demandé pour les clés). */
  font-family: "Hoefler Text", Georgia, var(--serif);
  font-feature-settings: "onum" 1;
  font-variant-numeric: oldstyle-nums;
  font-size: 2rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  padding: 16px 14px;
  text-transform: uppercase;
}

.form-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 2px; }
.link {
  color: var(--gold);
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
  cursor: pointer;
}
.link:hover { border-color: var(--gold); color: var(--gold-bright); }
.muted { color: var(--text-dim); }

/* ---- Boutons ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-block { width: 100%; }

.btn-primary {
  background-color: var(--gold);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.06));
  color: #1A150A;
  border-color: var(--gold-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--gold-bright);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.04));
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-bright); }

/* ---- Messages ------------------------------------------------------ */
.notice {
  margin: 0;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.notice-error { background: rgba(208, 138, 138, 0.08); border-color: rgba(208, 138, 138, 0.3); color: var(--danger); }
.notice-success { background: rgba(155, 191, 142, 0.08); border-color: rgba(155, 191, 142, 0.3); color: var(--success); }
.notice-info { background: rgba(198, 166, 100, 0.08); border-color: var(--line); color: var(--gold-bright); }

/* ---- Étape clé acceptée -------------------------------------------- */
.key-ok {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 4px; color: var(--text-dim); font-size: 0.9rem;
}
.key-ok-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(155, 191, 142, 0.14); color: var(--success);
  border: 1px solid rgba(155, 191, 142, 0.4); font-size: 0.8rem;
}

/* ---- Avertissement de configuration -------------------------------- */
.config-warning {
  padding: 11px 14px; border-radius: var(--radius);
  background: rgba(198, 166, 100, 0.08); border: 1px solid var(--line);
  color: var(--gold-bright); font-size: 0.85rem;
}
.config-warning code { font-family: ui-monospace, monospace; color: var(--text); }

/* ---- Écran applicatif (membre / admin) ----------------------------- */
.screen-app { background: var(--bg); }
.appbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px 28px;
  /* En app autonome (status-bar « black-translucent »), le contenu passe SOUS
     la barre de statut → on la dégage. env(safe-area-inset-top)=0 dans un
     navigateur classique : aucun changement hors standalone. */
  padding-top: max(20px, calc(env(safe-area-inset-top) + 10px));
  border-bottom: 1px solid var(--line-soft);
}
.appbar .wordmark { flex-direction: row; gap: 12px; }
.appbar .wordmark-rule { width: 1px; height: 18px; }
.appbar .wordmark-sub { font-size: 0.62rem; }
.appbar-right { display: flex; align-items: center; gap: 18px; }

.container {
  width: 100%; max-width: var(--maxw-app);
  margin: 0 auto; padding: 48px 28px 80px;
}

/* ---- Boutons : variante danger ------------------------------------- */
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(208, 138, 138, 0.4);
}
.btn-danger:hover:not(:disabled) { border-color: var(--danger); background: rgba(208, 138, 138, 0.08); }

/* ---- Interface membre : blocs & sections --------------------------- */
.welcome { margin-bottom: 12px; }
.block { padding: 36px 0; border-top: 1px solid var(--line-soft); }
.block:first-of-type { border-top: none; padding-top: 8px; }

.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.section-title {
  font-family: var(--serif); font-weight: 500; font-size: 1.05rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin: 0;
}
.section-count {
  font-size: 0.78rem; color: var(--text-faint);
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 1px 9px;
}

/* ---- Annuaire ------------------------------------------------------ */
.chip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1px solid var(--line-soft); border-radius: 999px;
  background: var(--surface); font-size: 0.92rem; color: var(--text);
}
.chip-self { border-color: var(--line); }
.chip-tag {
  font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); border-left: 1px solid var(--line); padding-left: 8px;
}

/* ---- Événements ---------------------------------------------------- */
.event-group { margin-bottom: 30px; }
.event-group:last-child { margin-bottom: 0; }
.event-group-title {
  font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 14px;
}
.event-cards { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .event-group:has(.event-passe) .event-cards,
  .event-group:has(.event-annule) .event-cards { grid-template-columns: 1fr 1fr; }
}

.event-card {
  position: relative;
  background:
    radial-gradient(150% 110% at 100% 0%, rgba(198,166,100,0.06), transparent 55%),
    linear-gradient(165deg, var(--surface-2), var(--bg-elev));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px 26px 20px 30px;
  box-shadow: inset 0 1px 0 rgba(236,230,216,0.03), 0 10px 26px rgba(0,0,0,0.24);
  overflow: hidden;
}
/* Pas d'effet de survol sur la carte : style sobre, rien ne clignote. */
/* Fin filet d'accent latéral, couleur selon l'état (discret). */
.event-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--gold-deep); opacity: 0.5;
}
.event-vote_ouvert::before { background: var(--gold); opacity: 0.55; }
.event-en_finalisation::before { background: var(--gold-deep); opacity: 0.55; }
.event-a_venir::before { background: var(--success); opacity: 0.5; }
.event-annule::before { background: var(--danger); opacity: 0.5; }
.event-passe::before { background: var(--text-faint); opacity: 0.5; }
.event-card.event-passe, .event-card.event-annule { opacity: 0.62; }

.event-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.event-title { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin: 0; letter-spacing: 0.01em; }
.event-desc { color: var(--text-dim); margin: 7px 0 0; font-size: 0.95rem; line-height: 1.5; }

.badge {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--text-dim);
  background: rgba(255,255,255,0.015);
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge-vote_ouvert { color: var(--gold-bright); border-color: var(--line); background: rgba(198,166,100,0.08); }
.badge-en_finalisation { color: var(--gold); border-color: var(--line); }
.badge-a_venir { color: var(--success); border-color: rgba(155,191,142,0.3); background: rgba(155,191,142,0.06); }
.badge-annule { color: var(--danger); border-color: rgba(208,138,138,0.3); }
.badge-passe { color: var(--text-faint); }

/* ---- Bloc de vote -------------------------------------------------- */
.vote-block { margin-top: 18px; }
.vote-deadline { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 14px; display: flex; align-items: center; }
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); margin-right: 8px; flex: none;
  box-shadow: 0 0 0 0 rgba(155, 191, 142, 0.55);
  animation: livePulse 1.9s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(155, 191, 142, 0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(155, 191, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(155, 191, 142, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.options { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--bg); cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.1s var(--ease);
}
.option:hover { border-color: rgba(198,166,100,0.32); background: rgba(198,166,100,0.03); }
.option:active { transform: translateY(1px); }
.option-static { cursor: default; }
.option-static:hover { border-color: var(--line-soft); background: var(--bg); }
.option-mine { border-color: rgba(198,166,100,0.4); background: rgba(198,166,100,0.05); }
.option-mark {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  color: #1A150A; font-size: 0.8rem; background: transparent;
}
.option-mark.checked { background: var(--gold); border-color: var(--gold-deep); }
.option-body { flex: 1 1 auto; min-width: 0; }
.option-when { font-family: var(--serif); font-size: 1.08rem; color: var(--text); }
.option-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-dim); font-size: 0.88rem; margin-top: 2px; }
.option-detail { color: var(--text-faint); }
.option-count {
  flex: none; font-size: 0.7rem; color: var(--gold-bright); letter-spacing: 0.06em;
  padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(198,166,100,0.06); white-space: nowrap; align-self: center;
}
/* Option de vote membre : disposition verticale (corps + pied), non cliquable. */
.option-vote { flex-direction: column; align-items: stretch; cursor: default; }
.option-vote:hover { border-color: var(--line-soft); background: var(--bg); }
.option-vote.option-mine:hover { border-color: rgba(198,166,100,0.4); background: rgba(198,166,100,0.05); }
/* Option « à voter » côté membre : corps + pied empilés (pas de rond). */
.option-vote {
  flex-direction: column;
  align-items: stretch;
  cursor: default;
}
.option-vote:hover { border-color: var(--line-soft); background: var(--bg); }
.option-vote.option-mine:hover { border-color: rgba(198,166,100,0.4); background: rgba(198,166,100,0.05); }
/* Pied d'option : compteur + bouton Voter/S'inscrire/Retirer. */
.option-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.option-foot .btn { flex: none; padding: 9px 20px; }
.vote-chosen-note { margin: 12px 0 0; font-size: 0.85rem; font-style: italic; }

.vote-engagement-hint {
  font-size: 0.82rem; color: var(--text-dim); font-style: italic;
  border-left: 2px solid var(--gold-deep); padding-left: 12px; margin: 0 0 12px;
}
.vote-actions { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; }

/* ---- Engagés ------------------------------------------------------- */
.engaged {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 0.85rem; color: var(--text-dim);
}
.engaged-label { color: var(--gold); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.7rem; }
.engaged-list { color: var(--text); }

/* ---- Résultats (finalisation / à venir) ---------------------------- */
.result { margin-top: 16px; }
.result-label { font-size: 0.85rem; color: var(--text-dim); margin: 0 0 8px; }
.result-when { font-family: var(--serif); font-size: 1.15rem; color: var(--gold-bright); margin: 0; }
.result-place { color: var(--text-dim); margin: 4px 0 0; }
.result-detail { color: var(--text-faint); margin: 4px 0 0; font-size: 0.9rem; }
/* Rendez-vous confirmé (« à venir ») : bloc mis en valeur. */
.result-confirmed {
  margin-top: 16px; padding: 16px 18px; border-radius: 8px;
  border: 1px solid rgba(155,191,142,0.22);
  background: linear-gradient(165deg, rgba(155,191,142,0.06), transparent);
}
.result-confirmed .result-when { color: var(--success); font-size: 1.25rem; }

/* ---- Parrainage ---------------------------------------------------- */
.referral-card, .referral-empty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.code-display {
  font-family: var(--serif); font-size: 2rem; letter-spacing: 0.4em; text-indent: 0.4em;
  color: var(--gold-bright); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 26px; text-transform: uppercase;
}
.code-used { color: var(--text-dim); border-color: var(--line-soft); }
.code-hint { font-size: 0.82rem; }

/* ---- Espace personnel ---------------------------------------------- */
.perso { display: grid; gap: 28px; max-width: 460px; }
.perso-info { display: grid; grid-template-columns: auto 1fr; gap: 8px 22px; margin: 0; }
.perso-info dt { color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; }
.perso-info dd { margin: 0; }
.perso-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; max-width: 340px; }

/* ---- Zone sensible (« Mon compte » : suppression de compte) -------- */
.danger-zone {
  display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
  max-width: 460px; padding: 18px 20px; border-radius: 8px;
  border: 1px solid rgba(208,138,138,0.28);
  background: linear-gradient(165deg, rgba(208,138,138,0.05), transparent);
}

/* ---- Modale -------------------------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 6, 8, 0.7); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; padding: 22px;
  animation: fadeUp 0.2s var(--ease) both;
}
.modal {
  width: 100%; max-width: 440px;
  background: linear-gradient(180deg, var(--surface-2), var(--bg-elev));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 28px 24px; box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal-title { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 0 0 12px; }
.modal-body { color: var(--text-dim); font-size: 0.95rem; }
.modal-body p { margin: 0 0 10px; }
.modal-choice { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; }

/* Fenêtre de bienvenue : mémorisation du pseudo (identifiant de connexion) */
.pseudo-modal { text-align: center; }
.pseudo-modal-intro { color: var(--text-dim); font-size: 0.95rem; line-height: 1.55; margin: 0 0 18px; }
.pseudo-modal-value {
  font-family: var(--serif); font-weight: 600; font-size: 2rem; letter-spacing: 0.02em;
  color: var(--gold-bright); padding: 16px 20px; margin: 0 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: rgba(198, 166, 100, 0.06);
}
.pseudo-modal-hint { font-size: 0.85rem; margin: 0; }
.pseudo-modal-actions { justify-content: center; margin-top: 22px; }

/* ---- Feuille « installer sur l'écran d'accueil » (PWA) ------------- */
.install-sheet {
  width: 100%; max-width: 420px; text-align: center;
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--line); border-radius: 16px;
  padding: 28px 26px 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: sheetIn 0.32s var(--ease) both;
}
@keyframes sheetIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.install-icon {
  width: 72px; height: 72px; border-radius: 16px; display: block; margin: 0 auto 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}
.install-title { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin: 0 0 8px; }
.install-sub { color: var(--text-dim); font-size: 0.93rem; line-height: 1.5; margin: 0 0 22px; }
.install-steps { list-style: none; margin: 0 0 4px; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 14px; }
.install-step { display: flex; gap: 12px; align-items: flex-start; color: var(--text); font-size: 0.92rem; line-height: 1.45; }
.install-step-n {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--gold);
  font-size: 0.78rem; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
.install-step strong { color: var(--gold-bright); font-weight: 600; }
.install-share { display: inline-flex; vertical-align: -3px; color: var(--gold); }
.install-note { color: var(--text-dim); font-size: 0.93rem; line-height: 1.55; margin: 0; }
.install-note strong { color: var(--text); font-weight: 600; }
.install-actions { margin-top: 4px; }
.install-later {
  display: inline-block; margin-top: 16px; padding: 6px 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.85rem; font-family: inherit;
}
.install-later:hover { color: var(--text); }
/* Sur mobile : feuille ancrée en bas, coins arrondis en haut, glissement. */
@media (max-width: 480px) {
  .install-overlay { align-items: flex-end; padding: 0; }
  .install-sheet {
    max-width: none; border-radius: 18px 18px 0 0; border-bottom: none;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    animation: sheetUp 0.32s var(--ease) both;
  }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
}

/* ---- Notifications : compteurs, cloche, panneau ------------------- */
.nav-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px;
  font-size: 0.66rem; font-weight: 600; line-height: 1;
  color: var(--bg); background: var(--gold); border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.nav-count-zero { display: none; }
.link-count { display: inline-flex; align-items: center; }

.notif-bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border-radius: 999px;
  background: transparent; border: 1px solid var(--line-soft); color: var(--text-dim);
  cursor: pointer; transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.notif-bell:hover { color: var(--gold); border-color: var(--line); }
.notif-bell-glyph { display: inline-flex; }
.notif-bell .nav-count { position: absolute; top: -5px; right: -5px; margin: 0; border: 1px solid var(--bg); }

.notif-overlay { align-items: flex-start; justify-content: flex-end; padding: 14px; }
.notif-panel {
  width: 100%; max-width: 380px; margin-top: 54px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 28px 70px rgba(0,0,0,0.6); animation: sheetIn 0.28s var(--ease) both;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line-soft);
}
.notif-panel-title { font-family: var(--serif); font-weight: 500; font-size: 1.2rem; margin: 0; }
.notif-panel-head .btn { flex: none; padding: 6px 12px; font-size: 0.72rem; }
.notif-list { overflow-y: auto; padding: 6px; }
.notif-empty { text-align: center; padding: 28px 16px; margin: 0; }
.notif-item {
  display: flex; gap: 12px; width: 100%; text-align: left; position: relative;
  padding: 12px; background: transparent; border: none; cursor: pointer;
  border-radius: var(--radius); transition: background 0.15s var(--ease);
}
.notif-item:hover { background: rgba(198, 166, 100, 0.06); }
.notif-unread { background: rgba(198, 166, 100, 0.05); }
.notif-item-icon {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(198, 166, 100, 0.12); color: var(--gold); font-size: 0.85rem;
}
.notif-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-item-title { color: var(--text); font-size: 0.9rem; font-weight: 600; }
.notif-item-body { color: var(--text-dim); font-size: 0.82rem; line-height: 1.4; }
.notif-item-time { color: var(--text-faint); font-size: 0.72rem; margin-top: 2px; }
.notif-dot { flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

.notif-setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--surface);
}
.notif-setting-text { min-width: 0; }
.notif-setting-title { margin: 0 0 4px; color: var(--text); font-size: 0.95rem; }
.notif-setting-status { margin: 0; font-size: 0.85rem; line-height: 1.45; }
.notif-setting-row .btn { flex: none; }

@media (max-width: 480px) {
  .notif-overlay { align-items: flex-end; justify-content: center; padding: 0; }
  .notif-panel { max-width: none; margin-top: 0; border-radius: 16px 16px 0 0; max-height: 85vh; }
}

/* ---- Panneau admin : onglets --------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line-soft); margin: 6px 0 28px; }
.tab {
  background: none; border: none; cursor: pointer;
  padding: 12px 18px; margin-bottom: -1px;
  font-family: var(--sans); font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tab:hover { color: var(--text); }
.tab-active { color: var(--gold-bright); border-bottom-color: var(--gold); }

/* ---- Cartes de statistiques ---------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 26px 24px; text-align: center;
}
.stat-value { font-family: var(--serif); font-size: 2.6rem; color: var(--gold-bright); line-height: 1; }
.stat-label { margin-top: 8px; font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }

/* ---- Panneaux ------------------------------------------------------ */
.panel { margin-bottom: 26px; }
.panel + .panel { border-top: 1px solid var(--line-soft); padding-top: 26px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-title {
  font-family: var(--serif); font-weight: 500; font-size: 1.05rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px;
}
.panel-head .panel-title { margin: 0; }
.panel-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* ---- Génération de clés -------------------------------------------- */
.gen-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.gen-fields .input[type="number"] { width: 90px; }
.gen-fields .input[type="text"] { flex: 1 1 220px; }
.input-code-mini {
  flex: 0 0 120px; width: 120px; text-align: center;
  font-family: "Hoefler Text", Georgia, var(--serif); font-size: 1.1rem;
  font-feature-settings: "onum" 1; font-variant-numeric: oldstyle-nums;
  letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase;
}
.or-sep {
  display: flex; align-items: center; gap: 14px; margin: 20px 0 16px;
  color: var(--text-faint); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.or-sep::before, .or-sep::after { content: ""; height: 1px; flex: 1; background: var(--line-soft); }

/* ---- Inscription : clé figée + aperçu du pseudo -------------------- */
.key-fixed {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(198, 166, 100, 0.05);
}
.key-fixed-label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--success); }
.key-fixed-code { font-family: "Hoefler Text", Georgia, var(--serif); font-feature-settings: "onum" 1; font-variant-numeric: oldstyle-nums; font-size: 1.25rem; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--gold-bright); }
.pseudo-preview { margin: -4px 0 0; font-size: 0.9rem; color: var(--text); }
.idreminder { color: var(--text-dim); font-size: 0.95rem; line-height: 1.55; margin: 0 0 18px; }
.idreminder strong { color: var(--gold-bright); font-weight: 600; }
.idreminder-note { font-size: 0.85rem; margin: 6px 0 0; line-height: 1.5; }

/* ---- Section « Mes clés d'invitation » (ambassadeur) --------------- */
.invites { display: flex; flex-direction: column; gap: 14px; }
.invite-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; }
.invite-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.code-inline { font-family: ui-monospace, monospace; letter-spacing: 0.2em; color: var(--gold-bright); }
.invite-used { font-size: 0.85rem; flex: 1; min-width: 80px; }

/* ---- Pastilles de rôle (admin) ------------------------------------- */
.role-admin { color: var(--gold-bright); border-color: var(--line); }
.role-ambassadeur { color: var(--gold); border-color: rgba(198, 166, 100, 0.35); }
.role-membre { color: var(--text-dim); }
.role-parraine { color: var(--text-faint); }
.gen-result { margin-top: 12px; }
.gen-codes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gen-code {
  font-family: ui-monospace, monospace; letter-spacing: 0.2em;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 5px 12px; color: var(--gold-bright);
}

/* ---- Select & textarea --------------------------------------------- */
select.input, .select { appearance: none; cursor: pointer; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: right 16px center, right 11px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea.input { resize: vertical; font-family: var(--sans); }

/* ---- Tables -------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th {
  text-align: left; padding: 10px 14px; white-space: nowrap;
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
  border-bottom: 1px solid var(--line); font-weight: 500;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:hover td { background: rgba(255, 255, 255, 0.015); }
.mono { font-family: ui-monospace, monospace; letter-spacing: 0.12em; }
.mono.dim { color: var(--text-dim); letter-spacing: 0; }
.note-cell { color: var(--text-dim); font-size: 0.85rem; font-style: italic; }
.row-tag, .row-actions { white-space: nowrap; }
.row-tag { margin-left: 8px; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ---- Pastilles d'état ---------------------------------------------- */
.pill { font-size: 0.7rem; letter-spacing: 0.06em; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-soft); color: var(--text-dim); white-space: nowrap; }
.pill-active, .pill-actif { color: var(--success); border-color: rgba(155,191,142,0.35); }
.pill-utilisee { color: var(--text-dim); }
.pill-revoquee, .pill-archive, .pill-supprime { color: var(--danger); border-color: rgba(208,138,138,0.35); }
.pill-suspendu { color: var(--gold-bright); border-color: var(--line); }

/* En-tête de colonne avec action (copy-all) + lignes « supprimé ». */
.th-with-action { display: inline-flex; align-items: center; gap: 8px; }
.copy-all { padding: 2px 9px; font-size: 0.68rem; }
.row-supprime > td { opacity: 0.55; }

/* En-têtes triables (clic = croissant / décroissant). */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; transition: color 0.15s; }
.th-sort:hover { color: var(--gold-bright); }
.th-sort-active { color: var(--gold); }
.th-sort-arrow { margin-left: 5px; font-size: 0.7em; }
.th-sort .copy-all { margin-left: 8px; }

/* Barre d'action groupée (effacement de clés en lot) + case à cocher. */
.bulk-bar { margin: 0 0 14px; }
.key-check { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }

/* Gestion des participants (événement « à venir », côté admin). */
.participants { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.participants-label { margin: 0; font-size: 0.78rem; letter-spacing: 0.06em; color: var(--text-dim); }
.participant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.participant-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.82rem; color: var(--text);
}
.chip-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: rgba(208,138,138,0.12); color: var(--danger);
  font-size: 0.95rem; line-height: 1; cursor: pointer;
}
.chip-x:hover { background: rgba(208,138,138,0.25); }

/* ---- Mini-boutons -------------------------------------------------- */
.btn-mini {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius); padding: 6px 12px; cursor: pointer;
  font-size: 0.76rem; letter-spacing: 0.04em;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}
.btn-mini:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-bright); }
.btn-mini:disabled { opacity: 0.4; cursor: default; }
.btn-mini-danger { border-color: rgba(208,138,138,0.4); color: var(--danger); }
.btn-mini-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: rgba(208,138,138,0.08); }

/* ---- Événements (admin) -------------------------------------------- */
.admin-events { display: grid; gap: 26px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- Formulaire d'événement ---------------------------------------- */
.panel-form .field { margin-bottom: 16px; }
.type-choice { display: flex; gap: 20px; margin: 6px 0 18px; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-size: 0.92rem; }
.radio input { accent-color: var(--gold); }
.type-fields { margin-bottom: 8px; }
.opt-rows { display: grid; gap: 10px; margin-bottom: 12px; }
.opt-row { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line-soft); border-radius: var(--radius); }
.opt-row-fields { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 8px; align-items: center; }
.opt-remove { padding: 6px 10px; }

/* Sélecteur d'images (formulaire) */
.img-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.img-file { display: none; }
.img-add { cursor: pointer; }
.img-status { font-size: 0.78rem; }
.img-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.img-thumb { position: relative; width: 64px; height: 64px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-x {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 0.9rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.img-thumb-x:hover { background: var(--danger); }

/* Galerie d'images d'une proposition (aperçu façon annonce Google Maps) */
.gallery { margin-top: 10px; max-width: 380px; }
.gallery-frame {
  position: relative; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg); cursor: zoom-in;
  box-shadow: 0 8px 22px rgba(0,0,0,0.28);
}
.gallery-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s var(--ease); }
.gallery-frame:hover .gallery-img { transform: scale(1.04); }
.gallery-frame:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gallery-zoom {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 7px;
  background: rgba(14,14,17,0.55); color: var(--gold-bright); font-size: 0.95rem;
  border: 1px solid var(--line); backdrop-filter: blur(4px);
}
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(14,14,17,0.5);
  color: var(--gold-bright); font-size: 1.35rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); transition: background 0.2s, border-color 0.2s;
}
.gallery-nav:hover { background: rgba(198,166,100,0.28); border-color: var(--gold); }
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }
.gallery-count {
  position: absolute; bottom: 8px; right: 8px; padding: 2px 9px; border-radius: 999px;
  background: rgba(14,14,17,0.6); color: var(--text); font-size: 0.7rem;
  letter-spacing: 0.04em; backdrop-filter: blur(4px);
}
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.gallery-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background 0.2s, transform 0.2s; }
.gallery-dot.active { background: var(--gold); transform: scale(1.25); }

/* Lightbox plein écran */
@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(6,6,8,0.93); backdrop-filter: blur(6px);
  animation: lightboxIn 0.18s var(--ease);
}
.lightbox-img {
  max-width: 92vw; max-height: 86vh; object-fit: contain; border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6); border: 1px solid var(--line-soft);
}
.lightbox-close {
  position: absolute; top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(14,14,17,0.6); color: var(--gold-bright);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { border-color: var(--gold); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px;
  border-radius: 50%; border: 1px solid var(--line); background: rgba(14,14,17,0.55);
  color: var(--gold-bright); font-size: 2rem; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.lightbox-nav:hover { background: rgba(198,166,100,0.22); border-color: var(--gold); }
.lightbox-nav.prev { left: 3vw; }
.lightbox-nav.next { right: 3vw; }
.lightbox-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: var(--text-dim); font-size: 0.85rem; letter-spacing: 0.06em;
}
@media (max-width: 600px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.6rem; }
  .lightbox-nav.prev { left: 6px; }
  .lightbox-nav.next { right: 6px; }
}
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---- Responsive ---------------------------------------------------- */
@media (max-width: 480px) {
  .card { padding: 28px 22px; }
  .appbar { padding: 16px 18px; padding-top: max(16px, calc(env(safe-area-inset-top) + 8px)); flex-wrap: wrap; gap: 10px; }
  .container { padding: 32px 18px 64px; }
  .event-card { padding: 18px; }
  .option { flex-wrap: wrap; }
  .code-display { font-size: 1.5rem; padding: 12px 18px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .opt-row-fields { grid-template-columns: 1fr 1fr; }
  .opt-row-fields .opt-remove { grid-column: 2; justify-self: end; }
}

/* --- « Le Salon » (chat en direct) ---------------------------------- */
/* PAS de `position: fixed` (cf. l'historique des bugs). Sur iOS Safari, un
   élément `fixed` est ancré au LAYOUT viewport — donc DERRIÈRE la barre
   d'adresse — et `visualViewport.offsetTop` reste à 0 au repos : impossible de
   le recaler. Tout le conteneur se décale vers le bas et la barre de saisie
   passe sous la barre d'outils du bas, inatteignable (page non défilable).
   En FLUX NORMAL, le conteneur s'ancre dans la zone de contenu (sous la barre
   d'adresse) et `svh` = la vraie PETITE fenêtre (barres affichées) → tout tient
   à l'écran. Le JS (visualViewport) n'écrase la hauteur que clavier ouvert. */
.screen-chat {
  height: 100vh;      /* repli navigateurs sans unités dynamiques */
  height: 100dvh;     /* repli intermédiaire */
  height: 100svh;     /* hauteur visible garantie (barres affichées) */
  min-height: 100svh; /* écrase le min-height:100vh de .screen (sinon trop haut) */
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;          /* pas de double-tap zoom */
  -webkit-text-size-adjust: 100%;
}
/* Pendant le Salon : on verrouille le défilement du document (anti-rebond iOS)
   pour que la barre de saisie reste calée en bas de la zone visible. Classe
   posée/retirée par views/salon.js. */
.chat-no-scroll, .chat-no-scroll body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.chat-no-scroll #app { min-height: 0; }
.screen-chat .appbar { flex: 0 0 auto; }
.chat {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-left)) max(20px, calc(env(safe-area-inset-bottom) + 10px)) max(16px, env(safe-area-inset-right));
  min-height: 0;
}
.chat-head { padding: 18px 2px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chat-head-actions { flex: none; }
.chat-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  margin: 0;
  color: var(--gold-bright);
  letter-spacing: 0.01em;
}
.chat-sub { margin: 4px 0 0; color: var(--text-dim); font-size: 0.9rem; }

.chat-list {
  flex: 1 1 auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 2px;
  border-top: 1px solid var(--line-soft);
  scrollbar-width: thin;
}
/* Messages ancrés EN BAS (façon WhatsApp) : quand il y en a peu, le vide est
   en haut, le dernier message reste juste au-dessus de la barre de saisie.
   Quand ça déborde, la marge auto se réduit à 0 et le défilement reprend. */
.chat-list > :first-child { margin-top: auto; }
.chat-empty { margin: auto; text-align: center; }

.chat-msg { max-width: 78%; align-self: flex-start; }
.chat-msg-mine { align-self: flex-end; }
.chat-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 2px 3px;
  font-size: 0.72rem;
}
.chat-msg-mine .chat-meta { flex-direction: row-reverse; }
.chat-author { color: var(--gold); font-weight: 600; letter-spacing: 0.02em; }
.chat-time { color: var(--text-faint); }
.chat-del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 4px;
  border-radius: 3px;
}
.chat-msg-mine .chat-meta .chat-del { margin-left: 0; margin-right: auto; }
.chat-del:hover { color: var(--danger); }

.chat-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-msg-mine .chat-bubble {
  background: rgba(198, 166, 100, 0.12);
  border-color: var(--line);
  color: var(--gold-bright);
}

.chat-form {
  flex: 0 0 auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.chat-form-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input {
  flex: 1 1 auto;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  padding: 11px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  /* 16px exactement : empêche le zoom automatique d'iOS à la mise au point. */
  font-size: 16px;
  line-height: 1.4;
}
.chat-input:focus { outline: none; border-color: var(--gold); }
.chat-send { flex: 0 0 auto; align-self: stretch; }

@media (max-width: 600px) {
  .chat { padding: 0 max(14px, env(safe-area-inset-left)) max(18px, calc(env(safe-area-inset-bottom) + 10px)) max(14px, env(safe-area-inset-right)); }
  .chat-msg { max-width: 88%; }
  /* Bouton « Vider l'historique » compact (sinon il déborde / fait scroller). */
  .chat-head { padding-top: 14px; }
  .chat-head-actions .btn { padding: 8px 14px; font-size: 0.72rem; }
}

/* --- Numéro de version (tableau de bord admin) --------------------- */
.version-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.version-badge {
  flex: 0 0 auto;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  background: rgba(198, 166, 100, 0.1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 12px;
}
.version-text { color: var(--text-faint); font-size: 0.82rem; }

/* --- « Le Cercle » : cartes de membre prestige -------------------- */
.member-cards {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 14px;
  border-radius: 8px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(198, 166, 100, 0.08), transparent 60%),
    linear-gradient(160deg, var(--surface-2), var(--bg-elev));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(236, 230, 216, 0.04), 0 10px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.member-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(231, 209, 153, 0.5), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.5;
  pointer-events: none;
}
.member-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.member-card-self {
  border-color: var(--gold);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(198, 166, 100, 0.16), transparent 60%),
    linear-gradient(160deg, rgba(198, 166, 100, 0.1), var(--bg-elev));
}

.member-card-top { display: flex; align-items: center; justify-content: space-between; }
.member-mono {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--gold-bright);
  background: rgba(198, 166, 100, 0.08);
  border: 1px solid var(--line);
}
.member-self-tag {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.member-card-body { display: flex; flex-direction: column; gap: 2px; }
.member-pseudo {
  font-family: var(--serif);
  font-size: 1.18rem;
  color: var(--text);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.member-card-sub {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.member-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.member-card-mark {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--gold);
}
.member-card-mark-dim { color: var(--text-faint); }
.member-card-rule { flex: 1; height: 1px; background: var(--line-soft); }

@media (max-width: 600px) {
  .member-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .member-card { padding: 14px 14px 12px; }
  .member-mono { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* --- Bannière « mode test » (impersonation admin) ------------------ */
.imp-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 1100; display: flex; align-items: center; gap: 14px;
  padding: 10px 12px 10px 18px; border-radius: 999px;
  background: rgba(20, 20, 26, 0.92); border: 1px solid var(--gold);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px);
  max-width: calc(100vw - 24px);
}
.imp-banner-text { font-size: 0.85rem; color: var(--text); }
.imp-banner-text strong { color: var(--gold-bright); }
.imp-banner-btn { flex: none; border-color: var(--gold); color: var(--gold-bright); }
@media (max-width: 600px) {
  .imp-banner { width: calc(100vw - 24px); justify-content: space-between; }
  .imp-banner-text { font-size: 0.8rem; }
}

/* --- Signalements + pied de page membre ---------------------------- */
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 7px;
  border-radius: 999px; background: var(--danger); color: #1A0E0E;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0;
}
.reports { display: flex; flex-direction: column; gap: 12px; }
.report-card {
  padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: linear-gradient(165deg, var(--surface-2), var(--bg-elev));
}
.report-card.report-done { opacity: 0.6; }
.report-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.report-author { color: var(--gold); font-weight: 600; }
.report-date { font-size: 0.8rem; }
.report-body { margin: 0 0 12px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }

.member-footer {
  margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line-soft);
  text-align: center; font-size: 0.88rem;
}
.modal-sub { margin: -4px 0 14px; font-size: 0.88rem; }
.report-textarea { width: 100%; resize: vertical; font-family: var(--sans); }
.compte-logout { margin-top: 16px; }

/* --- Mode rideau : écran d'attente + réglage admin ----------------- */
/* Détache le panneau « Mode rideau » des cartes de stats juste au-dessus
   (sinon le titre est collé au compteur « Votes en cours »). */
.panel-curtain { margin-top: 30px; }
.screen-lock { padding: 32px 24px; }
.lock { width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.lock-message {
  margin: 0; color: var(--text); font-family: var(--serif); font-style: italic;
  font-size: 1.2rem; line-height: 1.6; max-width: 420px;
}
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 0.95rem; color: var(--text); }
.switch-input { width: 20px; height: 20px; accent-color: var(--gold); cursor: pointer; flex: none; }
.recruitment-save { margin-top: 12px; }
