/* Bouton clair / sombre : petit texte cliquable en haut à droite (« sombre » ou « clair ») */
.theme-toggle, .palette-toggle {
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
  transition: color .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover, .palette-toggle:hover { color: var(--text); }
/* En haut à droite : aléatoire · clair / sombre */
.top-controls {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  z-index: 40;
  display: flex;
  gap: 16px;
}

/* Combinaisons de couleurs (bouton « aléatoire ») : 1 à 4 fond foncé / texte clair, 5 à 8 l'inverse */
html:root[data-palette] {
  --muted: color-mix(in srgb, var(--text) 58%, var(--bg));
  --line: color-mix(in srgb, var(--text) 30%, var(--bg));
}
html:root[data-palette="1"] { --bg: #90497D; --text: #B0DCEF; --fg: #B0DCEF; }
html:root[data-palette="2"] { --bg: #271C48; --text: #3EE2A8; --fg: #3EE2A8; }
html:root[data-palette="3"] { --bg: #4F0D70; --text: #EFB0C4; --fg: #EFB0C4; }
html:root[data-palette="4"] { --bg: #631031; --text: #ECEFB0; --fg: #ECEFB0; }
/* Mêmes couleurs inversées : fond clair, texte foncé */
html:root[data-palette="5"] { --bg: #B0DCEF; --text: #90497D; --fg: #90497D; }
html:root[data-palette="6"] { --bg: #3EE2A8; --text: #271C48; --fg: #271C48; }
html:root[data-palette="7"] { --bg: #EFB0C4; --text: #4F0D70; --fg: #4F0D70; }
html:root[data-palette="8"] { --bg: #ECEFB0; --text: #631031; --fg: #631031; }
html:root[data-palette] .tabbar { background: color-mix(in srgb, var(--bg) 85%, transparent); }
html:root[data-palette] .tabbar a { color: var(--muted); }
html:root[data-palette] .tabbar a[aria-current="page"] { color: var(--text); }
html:root[data-palette] .loader, html:root[data-palette] .join { background: color-mix(in srgb, var(--bg) 40%, transparent); }

/* Bouton de langue : même style, en haut à gauche */
.lang-toggle {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 16px;
  z-index: 40;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
  transition: color .25s ease;
  cursor: pointer;
}
.lang-toggle:hover { color: var(--text); }

/* Mobile : les deux boutons ont leur propre bande en haut, le titre descend pour ne pas les toucher */
@media (max-width: 640px) {
  .top-controls, .lang-toggle { top: calc(12px + env(safe-area-inset-top, 0px)); }
  html header { --pad: 56px; }
  html.home main, html.membres-page main { padding-top: 56px; }
}

/* Retours à la ligne plus équilibrés : évite les mots seuls en fin de paragraphe (navigateurs récents) */
p, li, h2 { text-wrap: pretty; }

/* Curseur personnalisé (ordinateur uniquement) : carré de 10 px qui devient un cercle sur les éléments cliquables */
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  .cursor {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: var(--text);
    pointer-events: none;
    opacity: 0;
    transition: border-radius .3s cubic-bezier(.65, 0, .35, 1), width .3s cubic-bezier(.65, 0, .35, 1),
      height .3s cubic-bezier(.65, 0, .35, 1), margin .3s cubic-bezier(.65, 0, .35, 1), opacity .2s ease;
  }
  .cursor.on { opacity: 1; }
  .cursor.link { width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; }
}

/* Pied de page : les blocs de la ligne de crédits ne se coupent pas au milieu */
.credits .nw { white-space: nowrap; }
/* Mobile : retour à la ligne après le nom du club, sans point isolé en fin de ligne */
@media (max-width: 640px) { .credits .sep { display: block; height: 0; overflow: hidden; } }

/* Pictos des membres (pictos.js) : choix dans l'adhésion et dans Mon profil */
.pictos { gap: 8px 14px !important; max-width: 290px; margin-left: auto; margin-right: auto; } /* 2 lignes de 5 */
.pictos .choice span { display: inline-flex; padding: 2px; }
.pictos svg, .avatar svg {
  width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1;
  stroke-linecap: butt; stroke-linejoin: miter;
}
.pictos svg *, .avatar svg * { vector-effect: non-scaling-stroke; }
.avatar { display: flex; justify-content: center; margin-bottom: 8px; }
.avatar svg { width: 72px; height: 72px; }

/* Boutons d'action : contour fin aux angles arrondis (comme la barre mobile), pour les distinguer des titres.
   Pas sur la navigation ni sur les liens du texte.
   Survol : le filet se densifie, un voile très léger apparaît et le bouton se soulève d'un pixel ; il s'enfonce à peine au clic. */
html .btn:not(.etat), html #open-join, html .cta-line a {
  display: inline-flex; align-items: center; justify-content: center;
  /* Boutons en Neue Haas (police d'interface), titres et textes restent en Caslon */
  font-family: "neue-haas-grotesk-text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1;
  /* Hauteur et marges façon Apple : 44 px de haut, 22 px sur les côtés ; --dy recentre les capitales */
  min-height: 44px;
  padding: calc(var(--dy, 0px)) 22px calc(-1 * var(--dy, 0px));
  border: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
  border-radius: 999px; /* bouts complètement arrondis */
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  transition: border-color .4s cubic-bezier(.2, .7, .2, 1), background-color .4s cubic-bezier(.2, .7, .2, 1),
    transform .4s cubic-bezier(.2, .7, .2, 1), color .4s ease;
  -webkit-tap-highlight-color: transparent;
}
html .actions, html .nav { align-items: center; gap: 12px; } /* chaque bouton garde sa hauteur ; boutons plus proches */
html .btn.small:not(.etat), html .btn.back { font-size: 14px; min-height: 34px; padding-left: 16px; padding-right: 16px; color: var(--muted); }
@media (hover: hover) {
  html .btn:not(.etat):hover, html #open-join:hover, html .cta-line a:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--text) 85%, transparent);
    background-color: color-mix(in srgb, var(--text) 4%, transparent);
    transform: translateY(-1px);
  }
}
html .btn:not(.etat):active, html #open-join:active, html .cta-line a:active { transform: translateY(0) scale(.985); transition-duration: .12s; }
html .btn:not(.etat):focus-visible, html #open-join:focus-visible, html .cta-line a:focus-visible { outline: none; border-color: var(--text); }
html .btn[disabled]:not(.etat) { color: var(--muted); border-color: color-mix(in srgb, var(--muted) 40%, transparent); background: transparent; transform: none; }
@media (prefers-reduced-motion: reduce) { html .btn, html #open-join, html .cta-line a { transition: none; } }
