/* ==========================================================================
   Bêta d'inscription : page publique et tableau de bord.
   Mêmes règles que l'app : AUCUNE couleur en dur hors des blocs de thème.
   Le thème est le Manga de l'app ; Manga noir si le téléphone est en sombre.
   ========================================================================== */

/* Dela Gothic One, la police des titres de l'app (licence SIL OFL), servie
   avec la page : rien ne part chez Google. */
@font-face {
  font-family: "Dela Gothic One";
  src: url("polices/dela-gothic-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Les thèmes de l'app, tous Manga : mêmes palettes que app/globals.css, dans
   les noms de cette page. Le papier est la base ; sans choix sur la page, un
   téléphone en mode sombre prend Manga noir (page.js pose data-theme). */
:root {
  color-scheme: light;
  --ink: #f4efe4;
  --panel: #fffdf8;
  --panel2: #ebe4d6;
  --line: #121212;
  --text: #121212;
  --muted: #5e594f;
  --rose: #c41f18;
  --violet: #1f4fa8;
  --blue: #1f4fa8;
  --mint: #1e7a4c;
  --gold: #8a6416;
  --sur-accent: #ffffff;
  --halo: color-mix(in srgb, var(--rose) 14%, transparent);
  --halo2: color-mix(in srgb, var(--violet) 10%, transparent);
  --voile: rgba(18, 18, 18, 0.45);
  --ombre: rgba(18, 18, 18, 0.25);
  --erreur: #8e1410;
  --succes: var(--mint);
  --police-texte: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --police-titres: "Dela Gothic One", system-ui, sans-serif;
  /* les aperçus des thèmes (pastilles du sélecteur) : ceux de l'app */
  --apercu-manga: #f4efe4; --apercu-manga-accent: #c41f18;
  --apercu-noir: #141312; --apercu-noir-accent: #ff5a47;
  --apercu-rose: #fbe7ec; --apercu-rose-accent: #b8174f;
}

/* Manga noir : le négatif, traits à la craie, tampon plus vif */
:root[data-theme="manga-noir"] {
  color-scheme: dark;
  --ink: #141312; --panel: #1d1c1a; --panel2: #282623; --line: #efe8da;
  --text: #efe8da; --muted: #a59e91; --rose: #ff5a47; --violet: #8ab4ff;
  --blue: #8ab4ff; --mint: #5fd3a0; --gold: #e3b45a; --sur-accent: #141312;
  --voile: rgba(0, 0, 0, 0.62); --ombre: rgba(0, 0, 0, 0.5); --erreur: #ffb8ae;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #141312; --panel: #1d1c1a; --panel2: #282623; --line: #efe8da;
    --text: #efe8da; --muted: #a59e91; --rose: #ff5a47; --violet: #8ab4ff;
    --blue: #8ab4ff; --mint: #5fd3a0; --gold: #e3b45a; --sur-accent: #141312;
    --voile: rgba(0, 0, 0, 0.62); --ombre: rgba(0, 0, 0, 0.5); --erreur: #ffb8ae;
  }
}
/* Manga rose : papier rose, encre prune, tampon framboise */
:root[data-theme="manga-rose"] {
  color-scheme: light;
  --ink: #fbe7ec; --panel: #fff6f8; --panel2: #f4d3dc; --line: #2a1219;
  --text: #2a1219; --muted: #7a5560; --rose: #b8174f; --violet: #1f4fa8;
  --blue: #1f4fa8; --mint: #1e7a4c; --gold: #8a6416; --sur-accent: #ffffff;
  --voile: rgba(42, 18, 25, 0.45); --ombre: rgba(42, 18, 25, 0.25); --erreur: #8a0f38;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--halo), transparent 70%),
    radial-gradient(50rem 28rem at 95% 0%, var(--halo2), transparent 70%),
    var(--ink);
  background-repeat: no-repeat;
  color: var(--text);
  font: 16px/1.55 var(--police-texte);
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--police-titres); font-weight: 400; line-height: 1.15; margin: 0; }
/* Dela Gothic n'a qu'une graisse : le navigateur n'en fabrique pas de fausse */
body { font-synthesis-weight: none; }
p { margin: 0; }
a { color: var(--rose); }
img { max-width: 100%; }
[hidden] { display: none !important; }

.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.icone { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 16px; top: -60px; background: var(--panel); color: var(--text); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.evitement:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

/* --- en-tête */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 8px; }
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--police-titres); font-weight: 600; font-size: 1.15rem; }
.marque img { width: 36px; height: 36px; border-radius: 10px; }
.pastille { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--rose); border: 1px solid var(--line); background: var(--panel); padding: 4px 10px; border-radius: 999px; }

/* --- cartes, champs, boutons */
.carte { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 20px 50px -30px var(--ombre); }
.carte h2 { font-size: 1.35rem; margin-bottom: 14px; }
.champ { display: block; margin-bottom: 14px; }
.champ > span { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.champ input, .saisie {
  width: 100%; font: inherit; font-size: max(16px, 1rem); color: var(--text);
  background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
}
.champ input:focus, .saisie:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px var(--halo); }
.aide { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.case { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; margin: 4px 0 16px; cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--rose); flex: none; }
/* le champ piège : invisible pour une personne, rempli par les robots */
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 18px; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.bouton:hover { border-color: var(--muted); }
.bouton:active { transform: scale(0.98); }
.bouton:disabled { opacity: 0.6; cursor: progress; }
.bouton.principal { width: 100%; color: var(--sur-accent); background: linear-gradient(120deg, var(--rose), var(--violet)); border: 0; padding: 13px 18px; font-size: 1.02rem; }
.bouton.petit { padding: 7px 12px; font-size: 0.88rem; border-radius: 10px; }
.bouton.danger { color: var(--erreur); }
.bouton.danger.armer { color: var(--sur-accent); background: var(--rose); border-color: var(--rose); }
.lien-bouton { font: inherit; color: var(--rose); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.message { min-height: 1.4em; margin-top: 12px; font-size: 0.92rem; color: var(--muted); }
.message.erreur { color: var(--erreur); }
.message.succes { color: var(--succes); }
.petit-texte { font-size: 0.82rem; color: var(--muted); margin-top: 12px; }
.petit-texte.intro { margin: 0 0 14px; }

/* --- le pseudo en couleurs : ceux qui ont laissé un tip */
.arc-en-ciel {
  background: linear-gradient(90deg, var(--rose), var(--violet), var(--blue), var(--mint), var(--gold), var(--rose));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; font-weight: 700;
  animation: arc 6s linear infinite;
}
@keyframes arc { to { background-position: -200% 0; } }

/* --- haut de page */
.hero { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 36px; align-items: start; }
.surtitre { color: var(--rose); font-weight: 600; font-size: 0.9rem; margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); letter-spacing: -0.01em; }
.hero h1 em { font-style: italic; color: var(--rose); }
.chapo { color: var(--muted); font-size: 1.08rem; margin-top: 16px; max-width: 34rem; }
.atouts { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.atouts li { display: flex; gap: 10px; align-items: center; }
.atouts .icone { color: var(--mint); }
.formulaire { position: relative; }
.confirme h2 { margin-bottom: 8px; }
.confirme p + p { margin-top: 10px; }
.confirme .bouton { margin-top: 18px; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.15fr 0.85fr; gap: 56px; padding-top: 56px; padding-bottom: 56px; }
  .formulaire { margin-top: 8px; }
}

/* --- la barre de progression */
.progression .carte { padding: 24px; }
.compteur { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.compteur strong { font-family: var(--police-titres); font-size: clamp(2.4rem, 7vw, 3.4rem); line-height: 1; }
.compteur span { color: var(--muted); }
.barre { position: relative; height: 16px; margin: 18px 0 22px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; }
.barre-remplie {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--part, 0) * 100%); min-width: 16px; border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--violet));
  transition: width 1.2s cubic-bezier(0.2, 0.9, 0.25, 1);
}
.progression h2 { font-size: 1.25rem; margin-bottom: 6px; }
.progression p { color: var(--muted); }
.progression strong { color: var(--text); }
.progression.atteint .barre-remplie { background: linear-gradient(90deg, var(--mint), var(--blue)); }

/* --- les pseudos qui défilent */
.defile { padding: 44px 0 10px; }
.defile h2 { font-size: 1.35rem; margin-bottom: 18px; }
/* le masque ne lit que l'opacité : sa couleur n'apparaît jamais */
.rangs { display: grid; gap: 12px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.rang { overflow: hidden; }
.piste { display: flex; gap: 10px; width: max-content; margin: 0; padding: 0; list-style: none; animation: defile var(--duree, 40s) linear infinite; }
.rang.inverse .piste { animation-direction: reverse; }
.rangs:hover .piste { animation-play-state: paused; }
.piste li { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; white-space: nowrap; font-weight: 500; }
@keyframes defile { to { transform: translateX(-50%); } }
.vide { color: var(--muted); }
.legende { color: var(--muted); font-size: 0.9rem; margin-top: 16px; }

/* --- les paliers, sous les pseudos */
.paliers { padding-top: 44px; }
.paliers > h2 { font-size: 1.35rem; margin-bottom: 16px; }
.liste-paliers { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.palier { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.palier-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.palier-tete strong { font-family: var(--police-titres); font-size: 1.45rem; line-height: 1.1; }
.palier-etat { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.palier .mini-barre { margin: 12px 0; }
.palier p { color: var(--muted); font-size: 0.92rem; }
.palier.atteint { border-color: var(--mint); }
.palier.atteint .palier-etat { color: var(--mint); border-color: var(--mint); }
.palier.atteint .mini-barre i { background: var(--mint); }
.palier.en-cours { border-color: var(--rose); box-shadow: 0 0 0 3px var(--halo); }
.palier.en-cours .palier-etat { color: var(--rose); border-color: var(--rose); }
.palier.en-cours p { color: var(--text); }
.palier.a-venir { opacity: 0.75; }
.og { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 16px 18px; }
.og > span:last-child { color: var(--muted); }
.og strong { color: var(--text); }
.badge-og { flex: none; font-family: var(--police-titres); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.04em; color: var(--sur-accent); background: linear-gradient(120deg, var(--gold), var(--rose), var(--violet)); border-radius: 10px; padding: 6px 10px; }

/* --- soutenir */
.soutien { padding-top: 36px; }
.soutien .carte { display: grid; gap: 16px; align-items: center; }
.soutien .icone { width: 30px; height: 30px; color: var(--rose); }
.soutien p { color: var(--muted); margin-top: 6px; }
.soutien .bouton { justify-self: start; }
@media (min-width: 720px) { .soutien .carte { grid-template-columns: auto 1fr auto; gap: 22px; } .soutien .bouton { justify-self: end; } }

/* --- ce que fait l'app */
.fonctions { padding-top: 56px; }
.fonctions > h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); margin-bottom: 20px; }
.grille { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grille { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grille { grid-template-columns: repeat(3, 1fr); } }
.fonction { padding: 20px; }
.fonction .icone { width: 26px; height: 26px; color: var(--rose); margin-bottom: 12px; }
.fonction h3 { font-size: 1.1rem; margin-bottom: 6px; }
.fonction p { color: var(--muted); font-size: 0.95rem; }

.captures { padding-top: 44px; }
.captures h2 { margin-bottom: 6px; }
.captures-aide { color: var(--muted); margin-bottom: 14px; }

/* les thèmes de l'app, à essayer sur la page */
/* en pastilles qui passent à la ligne : quatre colonnes fixes débordaient sur un petit écran */
.themes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; max-width: 620px; }
.theme-choix {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 0.88rem; font-weight: 600;
}
.theme-choix[aria-checked="true"] { border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.theme-choix:active { scale: 0.96; }
.theme-pastille {
  width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--a) 50%, var(--b) 50%);
}
.theme-pastille[data-apercu="auto"] { --a: var(--apercu-manga); --b: var(--apercu-noir); }
.theme-pastille[data-apercu="manga"] { --a: var(--apercu-manga); --b: var(--apercu-manga-accent); }
.theme-pastille[data-apercu="manga-noir"] { --a: var(--apercu-noir); --b: var(--apercu-noir-accent); }
.theme-pastille[data-apercu="manga-rose"] { --a: var(--apercu-rose); --b: var(--apercu-rose-accent); }

/* les captures défilent toutes seules, en boucle (la liste est doublée par page.js) */
.defile-cadre {
  overflow: hidden; margin: 0 -16px; padding: 4px 0 8px; /* jusqu'aux bords de l'écran : la marge de .page */
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--ink) 6%, var(--ink) 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, var(--ink) 6%, var(--ink) 94%, transparent);
}
.defile-captures {
  list-style: none; padding: 0; margin: 0; display: flex; gap: 18px; width: max-content;
  animation: defile-captures 70s linear infinite;
}
.defile-captures:hover, .defile-captures.en-pause { animation-play-state: paused; }
.defile-captures li { flex: 0 0 min(62vw, 250px); }
.defile-captures li[hidden] { display: none; }
.captures img { display: block; width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--line); background: var(--panel); }
.captures figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 8px; text-align: center; }
@keyframes defile-captures { to { transform: translateX(calc(-50% - 9px)); } }
@media (prefers-reduced-motion: reduce) {
  .defile-cadre { overflow-x: auto; }
  .defile-captures { animation: none; }
}

/* --- pied de page */
.pied { padding-top: 56px; padding-bottom: 40px; display: grid; gap: 10px; }
.pied details { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; }
.pied summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.pied details p, .pied details form { color: var(--muted); font-size: 0.92rem; padding-bottom: 14px; }
.pied details p + p { margin-top: -4px; }
.pied form { display: grid; gap: 10px; }
.pied form .bouton { justify-self: start; }
.pied form p { padding: 0; }
.signature { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 12px; }

/* --- fenêtre avant la cagnotte */
dialog {
  width: min(92vw, 460px); padding: 24px; border: 1px solid var(--line); border-radius: 20px;
  background: var(--panel); color: var(--text); box-shadow: 0 30px 80px -20px var(--ombre);
}
dialog::backdrop { background: var(--voile); }
dialog h2 { font-size: 1.3rem; margin-bottom: 14px; }
dialog ol { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
dialog .actions .principal { width: auto; }

/* ============================================================ tableau de bord */
.tableau { display: grid; gap: 18px; padding-top: 18px; padding-bottom: 40px; }
.tableau h1 { font-size: 1.6rem; }
.tuiles { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 860px) { .tuiles { grid-template-columns: repeat(4, 1fr); } }
.tuile { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.tuile strong { display: block; font-family: var(--police-titres); font-size: 1.9rem; line-height: 1.1; }
.tuile span { color: var(--muted); font-size: 0.88rem; }
.mini-barre { height: 6px; margin-top: 10px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.mini-barre i { display: block; height: 100%; width: calc(var(--part, 0) * 100%); background: linear-gradient(90deg, var(--rose), var(--violet)); }
/* les sources des inscrits (tableau de bord) */
.aide-sources { color: var(--muted); font-size: 0.92rem; margin: 6px 0 12px; }
.aide-sources code { white-space: nowrap; }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sources li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.sources .mini-barre { grid-column: 1 / -1; margin-top: 0; }
.sources .source-nom { font-weight: 600; }
.sources .vide { color: var(--muted); display: block; }
.deux { display: grid; gap: 18px; }
@media (min-width: 960px) { .deux { grid-template-columns: 1fr 1fr; align-items: start; } }
.ligne-champs { display: grid; gap: 10px; }
@media (min-width: 620px) { .ligne-champs { grid-template-columns: 140px 1fr; align-items: end; } }
.sous-titre { font-family: var(--police-titres); font-size: 1.05rem; margin: 20px 0 4px; }
.editeur-paliers { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.ligne-palier { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: center; }
.ligne-palier button { font: inherit; font-size: 1.1rem; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 6px 8px; border-radius: 999px; }
.ligne-palier button:hover { color: var(--erreur); }
.actions-reglages { margin-top: 16px; }
.outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.outils .saisie { flex: 1 1 220px; }
.outils .case { margin: 0; }
.filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.filtres button { font: inherit; font-size: 0.88rem; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.filtres button[aria-pressed="true"] { color: var(--sur-accent); background: var(--rose); border-color: var(--rose); }
.liste-inscrits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.inscrit { display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.inscrit .qui { min-width: 0; }
.inscrit .pseudo { font-weight: 600; overflow-wrap: anywhere; }
.inscrit .email, .inscrit .quand { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.inscrit .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.etat { font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); margin-left: 6px; }
.etat.ok { color: var(--mint); }
.etat.attente { color: var(--gold); }
.bouton[aria-pressed="true"] { border-color: var(--violet); color: var(--violet); }
@media (max-width: 560px) { .inscrit { grid-template-columns: 1fr; } .inscrit .actions { justify-content: flex-start; } }
.mots { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.mots li { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 0.9rem; }
.mots li em { color: var(--muted); font-style: normal; font-size: 0.75rem; }
.mots button { font: inherit; line-height: 1; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 999px; }
.mots button:hover { color: var(--erreur); }
.connexion-admin { max-width: 440px; margin: 10vh auto 0; }

@media (prefers-reduced-motion: reduce) {
  .piste { animation: none; flex-wrap: wrap; width: auto; }
  .piste .double { display: none; }
  .arc-en-ciel { animation: none; }
  .barre-remplie { transition: none; }
  .bouton { transition: none; }
}
