/* La Loge : alertes des donateurs (client/js/mecenes.js) et Mur des légendes, style « Fanzine ». Aucun son, jamais.
   discrète : encart en bas à gauche ; bannière : bandeau rose sous le HUD + confettis ; grand moment : carte au centre. */

.mx { position: fixed; z-index: 72; font-family: var(--font-titre, 'Bricolage Grotesque', system-ui, sans-serif); color: #14121b; cursor: pointer; }

.mx-disc {
  left: 18px; bottom: 150px; width: 330px; max-width: calc(100vw - 36px); box-sizing: border-box;
  background: var(--trame, none), #f5f0e5; border: 2px solid #14121b; box-shadow: 5px 5px 0 #ff4f9e; padding: 12px 16px;
  transform: rotate(-1.2deg); animation: mx-glisse 0.3s cubic-bezier(0.2, 1.3, 0.5, 1);
}
.mx-disc .t { font: 500 11px/1.3 var(--mono, 'DM Mono', monospace); letter-spacing: 0.14em; color: #ff4f9e; text-transform: uppercase; }
.mx-disc .n { font-weight: 800; font-size: 24px; line-height: 1.1; overflow-wrap: anywhere; }
.mx-disc .s { font-size: 14px; color: #46436a; }

.mx-ban { left: 0; right: 0; top: 0; animation: mx-tombe 0.3s cubic-bezier(0.2, 1.3, 0.5, 1); }
.mx-ban .bar {
  background: #ff4f9e; color: #fffaf0; border-bottom: 3px solid #14121b; padding: 14px 28px 16px;
  display: flex; gap: 22px; align-items: center; justify-content: center;
}
.mx-ban .lab {
  font: 500 12px/1 var(--mono, 'DM Mono', monospace); letter-spacing: 0.14em; text-transform: uppercase; background: #ffd23f; color: #14121b;
  border: 2px solid #14121b; padding: 5px 9px; transform: rotate(-3deg); white-space: nowrap;
}
.mx-ban .big { font-weight: 800; font-size: clamp(22px, 3.2vw, 34px); line-height: 1.05; text-shadow: 3px 3px 0 #14121b; overflow-wrap: anywhere; }
.mx-ban .sub { font: 500 13px/1.3 var(--mono, 'DM Mono', monospace); margin-top: 6px; }
.mx-ban .gauge { height: 6px; background: #2f5bd9; transform-origin: left; animation: mx-jauge 9s linear forwards; }

.mx-big { inset: 0; background: rgba(20, 18, 27, 0.62); display: grid; place-items: center; animation: mx-fondu 0.25s; }
.mx-big .card {
  width: min(640px, 88vw); box-sizing: border-box; background: #f5f0e5; border: 4px solid #14121b;
  box-shadow: 14px 14px 0 #ff4f9e, -10px -10px 0 #2f5bd9; padding: 30px 26px; text-align: center; transform: rotate(-1.5deg);
  animation: mx-pop 0.4s cubic-bezier(0.2, 1.4, 0.5, 1);
}
.mx-big .k { font: 500 14px/1.3 var(--mono, 'DM Mono', monospace); letter-spacing: 0.18em; color: #ff4f9e; text-transform: uppercase; }
.mx-big .who { font-weight: 800; font-size: clamp(44px, 11vw, 92px); letter-spacing: -0.03em; line-height: 0.95; text-shadow: 5px 5px 0 #ffd23f; margin: 10px 0; overflow-wrap: anywhere; }
.mx-big .what { font-weight: 600; font-size: clamp(20px, 4.5vw, 30px); }
.mx-big .gift { font: 500 13px/1.4 var(--mono, 'DM Mono', monospace); color: #46436a; margin-top: 12px; }

.mx-conf { position: fixed; inset: 0; z-index: 71; pointer-events: none; overflow: hidden; }
.mx-conf i {
  position: absolute; top: -20px; width: 9px; height: 14px; border: 1.5px solid #14121b;
  animation-name: mx-chute; animation-timing-function: linear; animation-fill-mode: forwards;
}

@keyframes mx-chute { from { transform: translateY(0) rotate(0); } to { transform: translateY(105vh) rotate(var(--rot, 360deg)); } }
@keyframes mx-glisse { from { transform: translateX(-120%) rotate(-1.2deg); } }
@keyframes mx-tombe { from { transform: translateY(-100%); } }
@keyframes mx-jauge { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes mx-fondu { from { opacity: 0; } }
@keyframes mx-pop { from { transform: scale(0.7) rotate(-6deg); opacity: 0; } }

@media (max-width: 600px) {
  .mx-disc { left: 10px; right: 10px; width: auto; bottom: 170px; }
  .mx-ban .bar { flex-direction: column; gap: 8px; padding: 12px 14px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .mx, .mx-big .card { animation: none; }
}

/* ---------- Mur des légendes (fenêtre) ---------- */
.mur { display: grid; gap: 12px; }
.mur-ey { margin: 0; font: 500 12px/1.3 var(--mono, 'DM Mono', monospace); letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink, #ff4f9e); }
.mur-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mur-tab {
  font: 600 14px/1 var(--font-titre, 'Bricolage Grotesque', sans-serif); padding: 7px 12px; border: 2px solid currentColor; border-radius: 2px;
  background: transparent; color: inherit; cursor: pointer;
}
.mur-tab.on { background: #ffd23f; color: #14121b; border-color: #14121b; box-shadow: 2px 2px 0 var(--pink, #ff4f9e); }
.mur-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mur-liste li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px dashed rgba(127, 120, 150, 0.45); }
.mur-liste .r { font: 500 13px/1 var(--mono, 'DM Mono', monospace); opacity: 0.7; }
.mur-liste li:nth-child(-n + 3) .r { color: var(--pink, #ff4f9e); opacity: 1; }
.mur-liste .nm { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.mur-liste small { font: 400 11px/1 var(--mono, 'DM Mono', monospace); margin-left: 8px; opacity: 0.75; }
.mur-liste .f { font: 500 14px/1 var(--mono, 'DM Mono', monospace); white-space: nowrap; }
.mur-liste li.me { background: #ffd23f; color: #14121b; border-radius: 2px; }
.mur-vide { margin: 6px 0; opacity: 0.8; }
.mur-moi p { margin: 4px 0; }
.mur-prog { height: 12px; border: 2px solid currentColor; border-radius: 2px; margin: 8px 0 4px; }
.mur-prog i { display: block; height: 100%; background: var(--pink, #ff4f9e); }
.mur-regles { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14px; }
.mur-pied { border-top: 2px solid currentColor; padding-top: 10px; display: grid; gap: 6px; font-size: 14px; }
.mur-pied .btn { justify-self: start; }

/* ---------- Barre du haut : le classement du mois défile (un clic ouvre le Mur) ---------- */
html[data-theme] .legendes {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 0; max-width: 360px;
  padding: 0 12px 0 8px; margin-left: 10px; overflow: hidden; cursor: pointer;
  background: #14121b; color: #fffaf0; border: 2px solid #ffd23f; border-radius: 4px; box-shadow: 3px 3px 0 var(--pink, #ff4f9e);
  font: inherit; transform: rotate(-0.6deg); transition: transform 0.15s;
}
html[data-theme] .legendes:hover { transform: rotate(0) translateY(-1px); }
html[data-theme] .legendes[hidden] { display: none; }
/* reflet doré qui traverse le bandeau de temps en temps */
.legendes::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 210, 63, 0.35), transparent);
  animation: lg-reflet 7s ease-in-out infinite;
}
.lg-cour { width: 22px; height: 18px; flex: none; fill: #ffd23f; stroke: #14121b; stroke-width: 1.4; filter: drop-shadow(1.5px 1.5px 0 var(--pink, #ff4f9e)); animation: lg-couronne 3.6s ease-in-out infinite; }
.lg-tag {
  flex: none; font: 500 10px/1 var(--mono, 'DM Mono', monospace); letter-spacing: 0.1em; text-transform: uppercase;
  background: #ffd23f; color: #14121b; padding: 4px 6px; border-radius: 2px; transform: rotate(-3deg);
}
.lg-fen { position: relative; display: block; flex: 1 1 auto; min-width: 150px; height: 22px; overflow: hidden; }
.lg-ligne {
  position: absolute; inset: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 15px; line-height: 22px;
}
.lg-ligne i { font: 500 12px/22px var(--mono, 'DM Mono', monospace); font-style: normal; color: var(--pink, #ff4f9e); }
.lg-ligne b { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.lg-ligne span { font: 500 12px/22px var(--mono, 'DM Mono', monospace); color: #c7c0b2; }
.lg-ligne.un b { color: #ffd23f; text-shadow: 1px 1px 0 var(--pink, #ff4f9e); }
.lg-ligne.moi b { color: #14121b; background: #ffd23f; padding: 0 4px; border-radius: 2px; }
.lg-ligne.cta b { color: var(--pink, #ff4f9e); }
.lg-ligne.entre { animation: lg-entre 0.42s cubic-bezier(0.2, 1.2, 0.5, 1) both; }
.lg-ligne.sort { animation: lg-sort 0.42s ease-in both; }
/* nouveaux points : petit coup d'éclat */
.legendes.bump { animation: lg-bump 0.9s cubic-bezier(0.2, 1.4, 0.5, 1); }

@keyframes lg-entre { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lg-sort { to { transform: translateY(-100%); opacity: 0; } }
@keyframes lg-reflet { 0%, 70% { left: -40%; } 100% { left: 120%; } }
@keyframes lg-couronne { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-12deg) translateY(-1px); } 93% { transform: rotate(9deg); } }
@keyframes lg-bump { 0% { transform: scale(1) rotate(-0.6deg); } 30% { transform: scale(1.12) rotate(-2deg); box-shadow: 3px 3px 0 var(--pink, #ff4f9e), 0 0 0 6px rgba(255, 210, 63, 0.45); } 100% { transform: scale(1) rotate(-0.6deg); } }

@media (max-width: 1100px) { .lg-tag { display: none; } }
/* téléphone : la barre du haut est pleine ; le classement se pose juste dessous, en ruban (position calée par mecenes.js) */
@media (max-width: 600px) {
  html[data-theme] .legendes {
    position: fixed; z-index: 30; left: 10px; top: var(--lg-top, 70px); height: 32px; max-width: calc(100vw - 96px);
    margin: 0; padding: 0 10px 0 6px; gap: 6px;
  }
  .lg-fen { min-width: 170px; }
  .lg-ligne { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .legendes::after, .lg-cour, .legendes.bump { animation: none; } }
body.calm .legendes::after, body.calm .lg-cour { animation: none; }
