/* ============ Classofus — feuille de style publique ============ */

:root{
  --bg:#0f1117;
  --surface:#171a23;
  --surface-2:#1e222d;
  --line:#2a2f3d;
  --text:#e8eaf0;
  --muted:#9aa1b4;
  --accent:#4f8ef7;
  --accent-soft:rgba(79,142,247,.14);
  --star:#f2b544;
  --star-off:#333846;
  --radius:10px;
  --shadow:0 8px 30px rgba(0,0,0,.45);
}

*,*::before,*::after{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:16px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}

.wrap{max-width:1280px;margin:0 auto;padding:0 20px}

.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

a{color:var(--accent)}

/* ---------- En-tête ---------- */

.site-header{
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#141824,#0f1117);
}
.header-inner{
  display:flex;align-items:center;justify-content:space-between;
  gap:20px;flex-wrap:wrap;padding-top:26px;padding-bottom:26px;
}
.brand h1{
  margin:0;font-size:1.9rem;letter-spacing:-.02em;
}
/* Titre animé : favicon + nom aux couleurs qui défilent */
.brand-title{display:flex;align-items:center;gap:12px}
.brand-favicon{
  width:40px;height:40px;flex:none;border-radius:9px;object-fit:contain;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.4));
  animation:brand-bob 4.5s ease-in-out infinite;
}
.brand-name{
  background:linear-gradient(90deg,#7db2ff,#8a6cf0,#c9a6ff,#7db2ff);
  background-size:300% 100%;
  -webkit-background-clip:text;background-clip:text;color:transparent;
  animation:brand-hue 8s linear infinite;
}
@keyframes brand-hue{to{background-position:300% 0}}
@keyframes brand-bob{
  0%,100%{transform:translateY(0) rotate(0)}
  50%{transform:translateY(-3px) rotate(-4deg)}
}
@media(prefers-reduced-motion:reduce){
  .brand-name{animation:none}
  .brand-favicon{animation:none}
}
.tagline{margin:6px 0 0;color:var(--muted);font-size:.92rem}

.version-badge{
  display:flex;flex-direction:column;align-items:flex-end;
  padding:8px 14px;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);cursor:help;
}
.version-label{font-size:.7rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.version-badge strong{font-size:1.05rem;font-variant-numeric:tabular-nums}

/* Actions d'en-tête : bouton quiz + badge version */
.header-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap}

.quiz-cta{
  display:inline-flex;align-items:center;gap:12px;
  padding:10px 18px;border-radius:12px;text-decoration:none;
  color:#fff;
  background:linear-gradient(120deg,#4f8ef7,#8a6cf0 55%,#c9a6ff);
  box-shadow:0 6px 20px rgba(79,142,247,.28);
  transition:transform .15s ease,box-shadow .15s ease,filter .15s ease;
}
.quiz-cta:hover{transform:translateY(-1px);box-shadow:0 10px 26px rgba(122,108,240,.4);filter:brightness(1.04)}
.quiz-cta:focus-visible{outline:2px solid #fff;outline-offset:2px}
.quiz-cta:active{transform:translateY(0)}

.quiz-cta-icon{
  display:grid;place-items:center;flex:none;
  width:30px;height:30px;border-radius:50%;
  background:rgba(255,255,255,.18);font-size:1rem;line-height:1;
}
.quiz-cta-text{display:flex;flex-direction:column;line-height:1.2}
.quiz-cta-title{font-weight:700;font-size:.98rem}
.quiz-cta-sub{font-size:.72rem;opacity:.85}

@media(max-width:560px){
  .quiz-cta{padding:9px 14px}
  .quiz-cta-sub{display:none}
}

/* Bouton secondaire d'en-tête (ex. retour au tableau depuis le quiz) */
.header-btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 16px;border-radius:10px;text-decoration:none;
  color:var(--text);font-weight:600;font-size:.92rem;
  background:var(--surface);border:1px solid var(--line);
  transition:border-color .15s ease,background .15s ease,transform .15s ease;
}
.header-btn:hover{border-color:var(--accent);background:var(--surface-2);transform:translateY(-1px)}
.header-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.header-btn-icon{font-size:1.05rem;line-height:1}

/* ---------- Barre d'outils ---------- */

.toolbar{
  display:flex;align-items:center;justify-content:space-between;
  gap:16px;flex-wrap:wrap;margin:26px 0 14px;
}
.search input{
  width:260px;max-width:100%;padding:9px 12px;
  border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);color:var(--text);font-size:.95rem;
}
.search input:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:transparent}
.hint{margin:0;color:var(--muted);font-size:.85rem;flex:1 1 260px;min-width:220px}

/* Bascule tableau / tier-list */
.view-switch{
  display:inline-flex;padding:3px;gap:3px;
  border:1px solid var(--line);border-radius:10px;background:var(--surface);
}
.view-btn{
  padding:7px 16px;border:0;border-radius:8px;cursor:pointer;
  background:none;color:var(--muted);font:inherit;font-size:.88rem;font-weight:600;
  transition:background .15s,color .15s;
}
.view-btn:hover{color:var(--text)}
.view-btn.is-active{background:var(--accent-soft);color:#9dc0ff}
.view-btn:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

/* ---------- Tier-list ---------- */

.tierlist{
  border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);overflow:hidden;
}
.tier-row{
  display:flex;align-items:stretch;
  border-bottom:1px solid var(--line);min-height:84px;
}
.tier-row:last-of-type{border-bottom:0}

.tier-label{
  flex:none;width:120px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:2px;padding:10px;color:#1b1205;text-align:center;
}
.tier-letter{font-size:1.7rem;font-weight:800;line-height:1}
.tier-desc{font-size:.68rem;font-weight:600;opacity:.85;text-transform:uppercase;letter-spacing:.03em}

/* Couleurs des tiers, du plus fort au plus faible */
.tier-s .tier-label{background:linear-gradient(135deg,#8fd0c0,#5fb3a0)}
.tier-a .tier-label{background:linear-gradient(135deg,#a9d97f,#84c65a)}
.tier-b .tier-label{background:linear-gradient(135deg,#f2d264,#e6c04a)}
.tier-c .tier-label{background:linear-gradient(135deg,#ffb066,#f2953f)}
.tier-d .tier-label{background:linear-gradient(135deg,#ff7a7a,#e0616a)}

.tier-items{
  flex:1;display:flex;flex-wrap:wrap;align-content:center;gap:10px;
  padding:12px 14px;
}
.tier-empty{color:var(--muted);font-size:1.1rem;align-self:center}

.tier-chip{
  display:flex;flex-direction:column;align-items:center;gap:5px;
  width:74px;padding:8px 4px;border:1px solid var(--line);border-radius:10px;
  background:var(--surface-2);color:var(--text);cursor:pointer;font:inherit;
  transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease;
}
.tier-chip:hover{transform:translateY(-2px);border-color:var(--accent);box-shadow:0 6px 16px rgba(0,0,0,.35)}
.tier-chip:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tier-chip img,.tier-chip .tier-ph{
  width:52px;height:52px;border-radius:8px;object-fit:cover;flex:none;
  border:1px solid var(--line);background:var(--surface);
}
.tier-chip .tier-ph{display:grid;place-items:center;color:var(--muted);font-weight:700;font-size:.9rem}
.tier-chip-name{font-size:.74rem;font-weight:600;line-height:1.15;text-align:center;color:var(--text)}

.tier-note{margin:12px 2px 0;color:var(--muted);font-size:.8rem}

@media(max-width:560px){
  .tier-label{width:76px}
  .tier-letter{font-size:1.3rem}
  .tier-desc{display:none}
  .tier-chip{width:64px}
  .tier-chip img,.tier-chip .tier-ph{width:44px;height:44px}
}

/* ---------- Tableau ---------- */

.table-scroll{
  overflow:auto;
  max-height:calc(100vh - 120px);
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--surface);
}

.grid{border-collapse:separate;border-spacing:0;width:100%}

/* Sur desktop, toutes les colonnes tiennent sans défilement latéral.
   Sur écran étroit, on rétablit une largeur minimale + le scroll. */
@media(max-width:860px){
  .grid{min-width:760px}
}

.grid th,.grid td{
  border-bottom:1px solid var(--line);
  padding:0;text-align:center;vertical-align:middle;
}
.grid tbody tr:last-child th,
.grid tbody tr:last-child td{border-bottom:0}

.grid thead th{
  position:sticky;top:0;z-index:3;
  background:var(--surface-2);
  border-bottom:1px solid var(--line);
}

/* Colonne « Classe » figée au scroll horizontal */
.col-class{
  position:sticky;left:0;z-index:2;
  background:var(--surface);
  text-align:left;min-width:168px;
  box-shadow:1px 0 0 var(--line);
}
thead .col-class{z-index:4;background:var(--surface-2)}

.grid tbody tr:hover .col-class{background:var(--surface-2)}
.grid tbody tr:hover td{background:rgba(255,255,255,.02)}

/* Boutons d'en-tête (tri) */
.th-btn{
  display:flex;align-items:center;justify-content:center;gap:7px;
  width:100%;padding:12px 6px;
  background:none;border:0;cursor:pointer;
  color:var(--muted);font:inherit;font-size:.8rem;
  font-weight:600;text-transform:uppercase;letter-spacing:.05em;
}
thead .col-class .th-btn{justify-content:flex-start;padding-left:16px}
.th-btn:hover{color:var(--text)}
.th-btn:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:6px}

.arrow{
  width:0;height:0;flex:none;
  border-left:4px solid transparent;border-right:4px solid transparent;
  opacity:0;transition:opacity .15s;
}
[data-dir="asc"] .arrow{border-bottom:5px solid var(--accent);opacity:1}
[data-dir="desc"] .arrow{border-top:5px solid var(--accent);opacity:1}
.sortable:hover .arrow{opacity:.45}
[data-dir="asc"]:hover .arrow,[data-dir="desc"]:hover .arrow{opacity:1}

/* En-tête de rôle : bouton de tri + bouton d'information */
.th-role{display:flex;align-items:center;justify-content:center;gap:2px;padding-right:6px}
.th-role .th-btn{width:auto;padding-right:4px}

.role-info{
  flex:none;width:20px;height:20px;margin-top:2px;
  border:1px solid var(--line);border-radius:50%;
  background:var(--surface);color:var(--muted);
  font:inherit;font-size:.68rem;font-weight:700;line-height:1;
  display:grid;place-items:center;cursor:pointer;
}
.role-info:hover{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.role-info:focus-visible{outline:2px solid var(--accent);outline-offset:1px}

.role-icon{
  width:28px;height:28px;border-radius:6px;object-fit:cover;
  display:grid;place-items:center;flex:none;
}
.role-icon.ph{
  background:var(--accent-soft);color:#9dc0ff;
  font-size:.72rem;font-weight:700;letter-spacing:0;
}

/* Cellule classe */
.class-cell{
  display:flex;align-items:center;gap:12px;
  width:100%;padding:10px 16px;
  background:none;border:0;cursor:pointer;
  color:var(--text);font:inherit;text-align:left;
}
.class-cell:hover .class-name{color:var(--accent)}
.class-cell:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}

.class-thumb{
  width:44px;height:44px;border-radius:8px;object-fit:cover;flex:none;
  border:1px solid var(--line);background:var(--surface-2);
}
.class-thumb.ph{
  display:grid;place-items:center;
  color:var(--muted);font-weight:700;font-size:.85rem;
}
.class-name{font-weight:600;font-size:.98rem}

/* Colonne « Prise en main » */
.col-diff{min-width:120px;padding:8px 12px;text-align:center}
thead .col-diff .th-btn{white-space:nowrap}
.diff-pill{
  display:inline-block;padding:3px 11px;border-radius:99px;
  font-size:.76rem;font-weight:600;border:1px solid transparent;
}
.diff-facile   {background:rgba(78,194,127,.14);color:#7fd6a4;border-color:rgba(78,194,127,.3)}
.diff-moyenne  {background:rgba(242,181,68,.14);color:#f0c766;border-color:rgba(242,181,68,.3)}
.diff-difficile{background:rgba(224,97,106,.14);color:#ea9298;border-color:rgba(224,97,106,.3)}
.diff-none     {background:var(--surface-2);color:var(--muted)}

/* Cellules de notes : pastille compacte colorée selon la note (rouge→jaune) */
.col-role{padding:6px 4px;min-width:52px}

.note-pill{
  display:inline-grid;place-items:center;
  min-width:30px;height:26px;padding:0 6px;border-radius:7px;
  font-size:.82rem;font-weight:700;font-variant-numeric:tabular-nums;
  color:#1b1205;                 /* texte sombre : lisible sur rouge comme sur jaune */
  background:var(--pill,var(--star));
}
.note-pill.is-zero{
  color:var(--muted);font-weight:600;
  background:var(--surface-2);border:1px solid var(--line);
}

/* Étoiles (conservées pour la fiche détaillée / modale) */
.rating{display:flex;justify-content:center;gap:2px;--star-on:var(--star)}

.star{
  width:13px;height:13px;flex:none;
  background:var(--star-off);
  clip-path:polygon(50% 0%,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
}
.star.is-full{background:var(--star-on)}
.star.is-half{
  background:linear-gradient(90deg,var(--star-on) 0 50%,var(--star-off) 50% 100%);
}

.num{
  display:block;margin-top:3px;
  font-size:.72rem;color:var(--muted);font-variant-numeric:tabular-nums;
}

.no-result,.empty{
  text-align:center;color:var(--muted);
  padding:36px 0;
}

/* ---------- Modale ---------- */

.modal{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:20px}
.modal[hidden]{display:none}

.modal-backdrop{
  position:absolute;inset:0;
  background:rgba(6,8,13,.78);backdrop-filter:blur(3px);
}

.modal-box{
  position:relative;width:min(720px,100%);
  max-height:88vh;overflow-y:auto;
  background:var(--surface);border:1px solid var(--line);
  border-radius:14px;box-shadow:var(--shadow);
  animation:pop .18s ease-out;
}
@keyframes pop{from{opacity:0;transform:translateY(8px) scale(.98)}}
@media(prefers-reduced-motion:reduce){
  .modal-box{animation:none}
  html{scroll-behavior:auto}
}

.modal-close{
  position:absolute;top:12px;right:14px;z-index:2;
  width:34px;height:34px;border-radius:8px;
  border:1px solid var(--line);background:var(--surface-2);
  color:var(--muted);font-size:1.4rem;line-height:1;cursor:pointer;
}
.modal-close:hover{color:var(--text);border-color:var(--accent)}

.modal-body{padding:26px}

.m-head{display:flex;align-items:center;gap:18px;margin-bottom:6px}
.m-head img,.m-head .ph{
  width:88px;height:88px;border-radius:12px;object-fit:cover;flex:none;
  border:1px solid var(--line);
}
.m-head .ph{display:grid;place-items:center;background:var(--surface-2);color:var(--muted);font-weight:700;font-size:1.4rem}
.m-head h2{margin:0;font-size:1.6rem}

.m-diff{
  display:inline-block;margin-top:6px;padding:3px 11px;
  border-radius:99px;font-size:.75rem;font-weight:600;
  background:var(--accent-soft);color:#9dc0ff;
}
/* Quand la difficulté est connue, on reprend la coloration du tableau
   (les classes diff-* sont appliquées en plus de .m-diff dans la fiche). */
.m-diff.diff-pill{margin-top:6px;font-size:.75rem}
.m-diff.diff-facile   {background:rgba(78,194,127,.14);color:#7fd6a4}
.m-diff.diff-moyenne  {background:rgba(242,181,68,.14);color:#f0c766}
.m-diff.diff-difficile{background:rgba(224,97,106,.14);color:#ea9298}

.m-desc{color:var(--muted);margin:16px 0 22px;line-height:1.65}

.m-cols{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:22px}
.m-cols h3{
  margin:0 0 8px;font-size:.78rem;text-transform:uppercase;
  letter-spacing:.06em;color:var(--muted);
}
.m-cols ul{margin:0;padding-left:18px}
.m-cols li{margin-bottom:5px;font-size:.92rem}
.m-pros li::marker{color:#4ec27f}
.m-cons li::marker{color:#e0616a}
.m-cols .none{color:var(--muted);font-size:.88rem;font-style:italic}

.m-notes h3{
  margin:0 0 12px;font-size:.78rem;text-transform:uppercase;
  letter-spacing:.06em;color:var(--muted);
}
.m-note-row{
  display:flex;align-items:center;gap:12px;
  padding:8px 0;border-top:1px solid var(--line);
}
.m-note-row img,.m-note-row .ph{
  width:26px;height:26px;border-radius:6px;object-fit:cover;flex:none;
}
.m-note-row .ph{display:grid;place-items:center;background:var(--accent-soft);color:#9dc0ff;font-size:.62rem;font-weight:700}
.m-note-row .lbl{flex:1;font-size:.92rem}
.m-note-row .val{color:var(--muted);font-size:.8rem;min-width:26px;text-align:right;font-variant-numeric:tabular-nums}

.m-role-top{margin-top:22px}
.m-role-top .m-note-row .lbl{font-weight:600}

/* Média de présentation (GIF ou vidéo) */
.m-gif{margin:0 0 22px}
.m-gif img,.m-gif video{
  display:block;width:100%;max-width:700px;object-fit:contain;
  border-radius:12px;border:1px solid var(--line);background:var(--surface-2);
}

/* Efficacité en jeu */
.m-eff{margin:0 0 22px}
.m-eff h3{
  margin:0 0 12px;font-size:.78rem;text-transform:uppercase;
  letter-spacing:.06em;color:var(--muted);
}
.m-eff-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px}
.m-eff-item{
  display:flex;flex-direction:column;gap:4px;
  padding:12px;border-radius:10px;border:1px solid var(--line);
  background:var(--surface-2);
}
.m-eff-mode{font-size:.78rem;color:var(--muted)}
.m-eff-level{font-weight:700;font-size:1rem}
.m-eff-item.eff-tres_faible{border-color:rgba(214,69,79,.55)}
.m-eff-item.eff-tres_faible .m-eff-level{color:#e0666d}
.m-eff-item.eff-faible{border-color:rgba(224,97,106,.4)}
.m-eff-item.eff-faible .m-eff-level{color:#ea9298}
.m-eff-item.eff-bonne{border-color:rgba(242,181,68,.4)}
.m-eff-item.eff-bonne .m-eff-level{color:#f0c766}
.m-eff-item.eff-forte{border-color:rgba(78,194,127,.45)}
.m-eff-item.eff-forte .m-eff-level{color:#7fd6a4}
.m-eff-item.eff-tres_forte{border-color:rgba(95,179,160,.6)}
.m-eff-item.eff-tres_forte .m-eff-level{color:#5fb3a0}

@media(max-width:560px){.m-eff-grid{grid-template-columns:1fr}}

/* Tutoriels */
.m-tutos{margin-top:24px}
.m-tutos h3{
  margin:0 0 14px;font-size:.78rem;text-transform:uppercase;
  letter-spacing:.06em;color:var(--muted);
}
.tuto{
  padding:16px;margin-bottom:14px;border-radius:12px;
  border:1px solid var(--line);background:var(--surface-2);
}
.tuto:last-child{margin-bottom:0}
.tuto--video{border-left:3px solid var(--accent)}
.tuto--texte{border-left:3px solid #8a6cf0}
.tuto-title{margin:0 0 12px;font-size:1rem}

.tuto-embed{
  position:relative;width:100%;aspect-ratio:16/9;
  border-radius:8px;overflow:hidden;background:#000;
}
.tuto-embed iframe,.tuto-embed video{
  position:absolute;inset:0;width:100%;height:100%;border:0;display:block;
}
.tuto-link{
  display:inline-block;padding:8px 14px;border-radius:8px;
  background:var(--accent);color:#fff;text-decoration:none;font-weight:600;font-size:.9rem;
}
.tuto-link:hover{background:#3d7ce6}

/* Rendu Markdown des tutos écrits */
.tuto-md{color:var(--text);line-height:1.7;font-size:.94rem}
.tuto-md h1,.tuto-md h2,.tuto-md h3,.tuto-md h4{margin:16px 0 8px;line-height:1.3}
.tuto-md h1{font-size:1.3rem}
.tuto-md h2{font-size:1.15rem}
.tuto-md h3{font-size:1.02rem;text-transform:none;letter-spacing:0;color:var(--text)}
.tuto-md h4{font-size:.95rem}
.tuto-md :first-child{margin-top:0}
.tuto-md p{margin:0 0 12px}
.tuto-md ul,.tuto-md ol{margin:0 0 12px;padding-left:22px}
.tuto-md li{margin-bottom:5px}
.tuto-md a{color:var(--accent);text-decoration:underline}
.tuto-md code{
  background:var(--bg);padding:2px 6px;border-radius:5px;
  font-size:.86em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
.tuto-md blockquote{
  margin:0 0 12px;padding:8px 14px;color:var(--muted);
  border-left:3px solid var(--line);background:var(--bg);border-radius:0 8px 8px 0;
}
.tuto-md strong{color:#fff}
/* Médias intégrés dans le Markdown */
.tuto-md-figure{margin:0 0 14px}
.tuto-md-img{
  max-width:100%;height:auto;display:block;border-radius:8px;
  border:1px solid var(--line);
}
.tuto-md p .tuto-md-img{display:inline-block;vertical-align:middle;margin:0 2px}
.tuto-md-figure .tuto-md-img{margin-inline:auto}
.tuto-md .tuto-embed--inline{margin:0 0 14px}

/* ---------- Pied de page ---------- */

.site-footer{
  margin-top:56px;padding:28px 0;
  border-top:1px solid var(--line);
  color:var(--muted);font-size:.88rem;
}
.site-footer p{margin:0 0 6px}
.site-footer .muted{font-size:.82rem;opacity:.75}

/* ---------- Adaptatif ---------- */

@media(max-width:720px){
  .brand h1{font-size:1.55rem}
  .m-cols{grid-template-columns:1fr}
  .m-head{flex-direction:column;text-align:center}
  .modal-body{padding:22px 18px}
  .col-class{min-width:150px}
  .class-thumb{width:36px;height:36px}
  .class-name{font-size:.9rem}
  .th-role{gap:0;padding-right:2px}
  .table-scroll{max-height:calc(100vh - 170px)}
}

/* ==========================================================================
 * Tutoriels — statuts, en-tête, liste modale, pages dédiées
 * ======================================================================== */

/* Lien de navigation générique dans l'en-tête */
.nav-link{
  padding:8px 14px;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);color:var(--text);text-decoration:none;font-weight:600;
  font-size:.9rem;white-space:nowrap;
}
.nav-link:hover{border-color:var(--accent);color:#fff}

/* Petit badge générique (type de tuto, etc.) */
.badge{
  display:inline-block;padding:2px 8px;border-radius:999px;font-size:.72rem;
  font-weight:600;background:var(--surface-2);border:1px solid var(--line);color:var(--muted);
}

/* Pastilles de statut */
.tuto-statut{
  display:inline-block;padding:2px 9px;border-radius:999px;font-size:.72rem;
  font-weight:700;border:1px solid transparent;white-space:nowrap;
}
.tuto-statut--a_jour{background:rgba(78,194,127,.16);color:#7ddba3;border-color:rgba(78,194,127,.35)}
.tuto-statut--a_confirmer{background:rgba(242,181,68,.16);color:#f2c877;border-color:rgba(242,181,68,.35)}
.tuto-statut--depasse{background:rgba(224,97,106,.16);color:#e88b92;border-color:rgba(224,97,106,.35)}
.tuto-version{
  display:inline-block;padding:2px 8px;border-radius:999px;font-size:.72rem;
  font-weight:600;background:var(--bg);border:1px solid var(--line);color:var(--muted);
}

/* Liste des tutoriels dans la modale de classe */
.m-tuto-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.m-tuto-link{
  display:flex;align-items:center;gap:12px;padding:10px 12px;text-decoration:none;
  border:1px solid var(--line);border-radius:10px;background:var(--surface-2);color:var(--text);
}
.m-tuto-link:hover{border-color:var(--accent);background:var(--surface)}
.m-tuto-ico{font-size:1.4rem;line-height:1;flex:0 0 auto}
.m-tuto-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.m-tuto-title{font-weight:600;font-size:.95rem}
.m-tuto-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.m-tuto-go{color:var(--muted);font-size:1.3rem;flex:0 0 auto}

/* Page liste des tutoriels */
.tutos-page{padding-top:24px;padding-bottom:60px}
.page-title-row{display:flex;align-items:baseline;gap:12px;margin-bottom:18px}
.page-title{margin:0;font-size:1.6rem}
.page-count{color:var(--muted);font-size:.9rem}
.tutos-filters{
  display:flex;flex-wrap:wrap;gap:14px;align-items:center;justify-content:space-between;
  margin-bottom:20px;
}
.filter-group{display:flex;flex-wrap:wrap;gap:8px}
.filter-chip{
  display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;
  border:1px solid var(--line);background:var(--surface);color:var(--muted);
  text-decoration:none;font-size:.85rem;font-weight:600;
}
.filter-chip:hover{color:var(--text);border-color:var(--accent)}
.filter-chip.is-active{background:var(--accent-soft);color:#9dc0ff;border-color:var(--accent)}
.filter-n{font-size:.72rem;opacity:.8}
.filter-classe select{
  padding:8px 12px;border-radius:10px;border:1px solid var(--line);
  background:var(--surface);color:var(--text);font-size:.88rem;
}

.tuto-cards{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.tuto-card{
  display:flex;align-items:center;gap:14px;padding:12px 14px;text-decoration:none;
  border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);
}
.tuto-card:hover{border-color:var(--accent);background:var(--surface-2)}
.tuto-card-icon{font-size:1.7rem;line-height:1;flex:0 0 auto}
.tuto-card-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px}
.tuto-card-title{font-weight:600;font-size:1rem}
.tuto-card-sub{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--muted);font-size:.82rem}
.tuto-card-sub img{border-radius:4px;vertical-align:middle}
.tuto-card-type{padding:1px 7px;border-radius:999px;border:1px solid var(--line);font-size:.72rem}
.tuto-card-side{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex:0 0 auto}

/* Page d'un tutoriel */
.tuto-page{padding-top:24px;padding-bottom:60px;max-width:860px}
.crumbs{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:.85rem;margin-bottom:18px}
.crumbs a{color:var(--muted)}
.crumbs a:hover{color:var(--text)}
.tuto-full{
  border:1px solid var(--line);border-radius:14px;background:var(--surface);
  padding:24px;
}
.tuto-full-head{display:flex;gap:16px;align-items:flex-start;margin-bottom:18px}
.tuto-full-icon{font-size:2.4rem;line-height:1;flex:0 0 auto}
.tuto-full-meta{flex:1;min-width:0}
.tuto-full-title{margin:0 0 10px;font-size:1.5rem}
.tuto-full-tags{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.tuto-class-chip{
  display:inline-flex;align-items:center;gap:6px;padding:3px 10px 3px 4px;border-radius:999px;
  border:1px solid var(--line);background:var(--surface-2);color:var(--text);
  text-decoration:none;font-size:.82rem;font-weight:600;
}
.tuto-class-chip img{border-radius:50%}
.tuto-class-chip:hover{border-color:var(--accent)}
.tuto-warn{padding:12px 16px;border-radius:10px;font-size:.9rem;margin:0 0 18px}
.tuto-warn--confirmer{background:rgba(242,181,68,.1);border:1px solid rgba(242,181,68,.35);color:#f2c877}
.tuto-warn--depasse{background:rgba(224,97,106,.1);border:1px solid rgba(224,97,106,.35);color:#e88b92}
.tuto-full-body{margin-top:8px}

@media(max-width:640px){
  .tuto-card-side{flex-direction:row;align-items:center}
  .tutos-filters{flex-direction:column;align-items:stretch}
}

/* ==========================================================================
 * Contributions publiques (notation, proposition de tuto)
 * ======================================================================== */
.contrib-page{padding-top:24px;padding-bottom:60px;max-width:820px}
.contrib-intro{color:var(--muted);font-size:.95rem;line-height:1.6;margin:0 0 22px}

/* Honeypot : hors flux, invisible, non focusable visuellement */
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

.alert-pub{
  padding:11px 15px;border-radius:10px;margin:0 0 14px;font-size:.9rem;
  border:1px solid transparent;
}
.alert-pub.err{background:rgba(224,97,106,.1);border-color:rgba(224,97,106,.35);color:#e88b92}

.card-pub{
  border:1px solid var(--line);border-radius:14px;background:var(--surface);
  padding:20px;margin-bottom:16px;
}
.card-pub h3{margin:0 0 6px;font-size:1.05rem}
.card-pub-sub{margin:0 0 14px;color:var(--muted);font-size:.85rem}
.card-pub .opt{color:var(--muted);font-weight:400;font-size:.85rem}

.fld{display:block;margin-bottom:14px;font-size:.9rem;font-weight:600;color:var(--text)}
.fld:last-child{margin-bottom:0}
.fld input[type=text],.fld input[type=url],.fld select,.fld textarea{
  display:block;width:100%;margin-top:6px;padding:9px 12px;font:inherit;
  background:var(--bg);color:var(--text);border:1px solid var(--line);border-radius:9px;
}
.fld textarea{resize:vertical;line-height:1.6}

.note-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.note-field{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);
  font-weight:600;font-size:.9rem}
.note-field-lbl{display:flex;align-items:center;gap:8px}
.note-field-lbl img{border-radius:4px}
/* (i) d'aide sur le rôle, aligné dans le libellé du champ de note. */
.role-info-sm{margin-top:0;width:18px;height:18px;font-size:.62rem}
.note-field input{width:70px;padding:6px 8px;background:var(--bg);color:var(--text);
  border:1px solid var(--line);border-radius:8px;font:inherit;text-align:center}

.eff-fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}

.type-switch{display:flex;flex-wrap:wrap;gap:18px;margin:0 0 14px}
.pub-radio{display:inline-flex;align-items:center;gap:8px;font-weight:600;cursor:pointer}
.pub-radio input{width:auto}

.contrib-done{
  border:1px solid var(--line);border-radius:14px;background:var(--surface);
  padding:32px;text-align:center;max-width:600px;margin:20px auto;
}
.contrib-done h2{margin:0 0 12px}
.contrib-done p{color:var(--muted);line-height:1.6;margin:0 0 20px}
.contrib-done .actions{justify-content:center}

/* Aide Markdown : réutilise le style admin, redéclaré léger pour le front */
.md-help{margin:0 0 16px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);overflow:hidden}
.md-help>summary{cursor:pointer;padding:10px 14px;font-size:.85rem;font-weight:600;color:var(--muted);list-style:none}
.md-help>summary::-webkit-details-marker{display:none}
.md-help>summary::before{content:"▸ ";color:var(--accent)}
.md-help[open]>summary::before{content:"▾ "}
.md-help-body{padding:4px 14px 14px;border-top:1px solid var(--line)}
.md-help-intro{margin:12px 0 10px;color:var(--muted);font-size:.83rem}
.md-help-table{width:100%;border-collapse:collapse;font-size:.83rem}
.md-help-table th{text-align:left;padding:6px 10px;color:var(--muted);border-bottom:1px solid var(--line)}
.md-help-table td{padding:6px 10px;border-bottom:1px solid var(--line);vertical-align:top}
.md-help-table tr:last-child td{border-bottom:0}
.md-help-table td:first-child{white-space:nowrap}
.md-help-note{margin:12px 0 0;color:var(--muted);font-size:.8rem;line-height:1.5}

/* ==========================================================================
 * Boutons (front) — cohérents avec l'admin, utilisés par les pages de
 * contribution, les pages tuto et les écrans de remerciement.
 * ======================================================================== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  padding:9px 16px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface-2);color:var(--text);
  font:inherit;font-size:.9rem;font-weight:600;
  cursor:pointer;text-decoration:none;
}
.btn:hover{border-color:var(--accent)}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-primary:hover{background:#3d7ce6}
.btn-danger{background:transparent;border-color:rgba(224,97,106,.45);color:var(--err,#e0616a)}
.btn-danger:hover{background:rgba(224,97,106,.12);border-color:var(--err,#e0616a)}
.btn-sm{padding:5px 10px;font-size:.8rem}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}

/* Icônes de tuto téléversées (images) — alignées avec les emplacements glyphes */
.m-tuto-ico img{width:1.4rem;height:1.4rem;border-radius:5px;object-fit:cover;vertical-align:middle}
.tuto-card-icon img{width:1.7rem;height:1.7rem;border-radius:6px;object-fit:cover;vertical-align:middle}
.tuto-full-icon img{width:2.4rem;height:2.4rem;border-radius:8px;object-fit:cover;vertical-align:middle}

/* ---------- Post-it d'accueil ---------- */
/* Petit message éditorial affiché en tête de l'index. Teinte bleutée discrète,
   alignée sur l'accent du site : un filet et une pastille bleus le distinguent
   sans trancher avec le thème sombre. */
.postit{
  display:flex;gap:12px;align-items:flex-start;
  margin:0 0 22px;padding:14px 18px;
  background:linear-gradient(180deg,var(--surface-2),var(--surface));
  color:var(--text);
  border:1px solid var(--line);
  border-left:3px solid var(--accent);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  position:relative;
}
.postit-pin{
  flex:none;width:10px;height:10px;margin-top:5px;border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 3px var(--accent-soft);
}
.postit-text{
  margin:0;font-size:.95rem;line-height:1.55;
  overflow-wrap:anywhere;
}
.postit-text a{color:var(--accent);text-decoration:underline}
@media(max-width:640px){
  .postit{padding:12px 14px}
  .postit-text{font-size:.9rem}
}
