:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --border: #e2e1dc;
  --text: #1c1b19;
  --muted: #6b6a66;
  --accent: #1f5f4b;
  --accent-soft: #e4efe9;
  --bar: #2f7d63;
  --bar-track: #eceae5;
  --warn: #8a5a12;
  --on-accent: #ffffff;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 10px;
  --maxw: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --surface: #1f2124;
    --border: #32353a;
    --text: #ececea;
    --muted: #a0a29f;
    --accent: #6cc3a1;
    --accent-soft: #23342e;
    --bar: #4fae8c;
    --bar-track: #2a2d31;
    --warn: #d9a441;
    --on-accent: #10231c;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  padding: 0 16px 6rem;
}

.wrap { max-width: var(--maxw); margin: 0 auto; }
.wrap-wide { max-width: 68rem; margin: 0 auto; }

header.page {
  padding: 2rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 .35rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); font-size: .9rem; }
.intro { color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1rem;
  margin-bottom: 1rem;
}

.card .prompt { font-size: 1.05rem; font-weight: 600; margin: 0 0 .15rem; }
.card .help { color: var(--muted); font-size: .9rem; margin: 0 0 .8rem; }

.choices { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }

.choice {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: transparent;
  transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--accent); }
.choice input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; margin: 0; flex: none; }
.choice.selected { border-color: var(--accent); background: var(--accent-soft); }

textarea {
  width: 100%;
  min-height: 5.5rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  resize: vertical;
}
textarea:focus, .choice:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

.entry { margin-bottom: .6rem; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.status { font-size: .85rem; color: var(--muted); min-height: 1.2rem; }
.status.saved { color: var(--accent); }
.hint { font-size: .8rem; margin-left: auto; }
.status.error { color: var(--warn); }

button, .btn {
  font: inherit;
  padding: .6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-small { padding: .35rem .7rem; font-size: .85rem; }

.sticky-foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: .7rem 16px;
  /* Encoche des téléphones, et remontée quand le clavier tactile est ouvert. */
  padding-bottom: calc(.7rem + env(safe-area-inset-bottom, 0px));
  transition: transform .12s ease-out;
  z-index: 10;
}
/* Clavier ouvert : le pied de page flotte au-dessus du contenu. */
.sticky-foot.lifted { box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }

/* Un champ qui reçoit le focus ne doit pas se caler juste sous le pied de page. */
textarea { scroll-margin-bottom: 7rem; }
.sticky-foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.progress { height: 4px; background: var(--bar-track); border-radius: 2px; overflow: hidden; flex: 1; }
.progress i { display: block; height: 100%; background: var(--bar); width: 0; transition: width .2s; }

/* Résultats */
.result-card { margin-bottom: 1.1rem; }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.count { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.bar-row { margin: .55rem 0; }
.bar-label { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; margin-bottom: .2rem; }
.bar-label b { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 10px; background: var(--bar-track); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--bar); border-radius: 5px; transition: width .4s; }

.theme { border-top: 1px solid var(--border); padding-top: .8rem; margin-top: .8rem; }
.theme:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.theme.is-highlighted { border-left: 3px solid var(--accent); padding-left: .8rem; }
.theme-head { display: flex; justify-content: space-between; align-items: baseline; gap: .8rem; }
.theme-head strong { font-size: 1rem; }
.keywords { display: flex; flex-wrap: wrap; gap: .35rem; margin: .45rem 0; }
.kw {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: .15rem .65rem;
  font-size: .85rem;
}
.quotes { margin: .4rem 0 0; padding: 0; list-style: none; }
.quotes li { color: var(--muted); font-size: .92rem; padding: .2rem 0 .2rem .8rem; border-left: 2px solid var(--border); margin-bottom: .25rem; }
.quotes li.is-highlighted { color: var(--text); border-left-color: var(--accent); font-weight: 500; }

.empty { color: var(--muted); font-style: italic; }

/* Écran projeté */
body.screen {
  padding: 0;
  height: 100vh;
  overflow: hidden;
}
body.screen .slide {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4vh 6vw;
  gap: 1.2rem;
}
body.screen h1 { font-size: clamp(1.8rem, 4vw, 3.2rem); margin-bottom: .5rem; }
body.screen .count { font-size: clamp(1rem, 1.5vw, 1.4rem); }
body.screen .bar-label { font-size: clamp(1.1rem, 2vw, 1.9rem); }
body.screen .bar { height: clamp(14px, 2vw, 26px); }
body.screen .kw { font-size: clamp(.9rem, 1.4vw, 1.4rem); }
body.screen .theme-head strong { font-size: clamp(1.2rem, 2vw, 2rem); }
body.screen .quotes li { font-size: clamp(.95rem, 1.4vw, 1.4rem); }
body.screen .screen-foot {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-between;
  padding: .8rem 6vw;
  color: var(--muted);
  font-size: .9rem;
}

/* Les diapositives se superposent le temps de l'effet de passage. */
body.screen .deck { position: relative; height: 100vh; overflow: hidden; }
body.screen .deck .slide {
  position: absolute;
  inset: 0;
  transition: transform var(--tr-dur, 420ms) ease, opacity var(--tr-dur, 420ms) ease;
}
body.screen[data-transition="aucune"] .deck .slide { transition: none; }

body.screen[data-transition="fondu"] .slide.is-enter,
body.screen[data-transition="fondu"] .slide.is-leave { opacity: 0; }

body.screen[data-transition="glissement"] .slide.is-enter { transform: translateX(100%); }
body.screen[data-transition="glissement"] .slide.is-enter.is-rev { transform: translateX(-100%); }
body.screen[data-transition="glissement"] .slide.is-leave { transform: translateX(-100%); }
body.screen[data-transition="glissement"] .slide.is-leave.is-rev { transform: translateX(100%); }

body.screen[data-transition="fondu-glissement"] .slide.is-enter { transform: translateX(9%); opacity: 0; }
body.screen[data-transition="fondu-glissement"] .slide.is-enter.is-rev { transform: translateX(-9%); }
body.screen[data-transition="fondu-glissement"] .slide.is-leave { transform: translateX(-9%); opacity: 0; }
body.screen[data-transition="fondu-glissement"] .slide.is-leave.is-rev { transform: translateX(9%); }

body.screen[data-transition="montee"] .slide.is-enter { transform: translateY(12%); opacity: 0; }
body.screen[data-transition="montee"] .slide.is-enter.is-rev { transform: translateY(-12%); }
body.screen[data-transition="montee"] .slide.is-leave { transform: translateY(-12%); opacity: 0; }
body.screen[data-transition="montee"] .slide.is-leave.is-rev { transform: translateY(12%); }

body.screen[data-transition="zoom"] .slide.is-enter { transform: scale(1.08); opacity: 0; }
body.screen[data-transition="zoom"] .slide.is-leave { transform: scale(.94); opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  body.screen .deck .slide { transition: opacity 150ms linear; transform: none !important; }
}

/* Administration */
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], input[type=url], input[type=date],
input[type=time], input[type=datetime-local], select {
  font: inherit;
  line-height: 1.55;
  padding: .5rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  max-width: 100%;
}
/* Les listes déroulantes ignorent line-height : on leur impose la hauteur
   d'un champ de saisie pour que les formulaires restent alignés. */
select { min-height: calc(1.55em + 1rem + 2px); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Colonne d'actions d'un tableau : les boutons se suivent sans se coller. */
td.actions { white-space: nowrap; }
td.actions form { display: inline-block; margin: 0 .3rem .3rem 0; }
label.field { display: block; margin-bottom: .7rem; }
label.field span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
nav.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
nav.tabs a { padding: .4rem .8rem; border-radius: var(--radius); text-decoration: none; color: var(--text); border: 1px solid var(--border); }
nav.tabs a.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.notice { padding: .7rem .9rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); margin-bottom: 1rem; }
.card.callout { border-left: 4px solid var(--accent); background: var(--accent-soft); }
.card.callout .muted { color: var(--text); }
.notice.error { background: #f6e6cf; color: #7a4d0c; }
.inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.qr { background: #fff; padding: .8rem; border-radius: var(--radius); display: inline-block; }
/* Le QR code est un SVG sans dimensions : c'est la page qui les fixe. */
.qr svg { display: block; width: 170px; height: 170px; }
.join-qr svg { display: block; }
code.url { background: var(--bg); padding: .2rem .45rem; border-radius: 6px; word-break: break-all; }
details { margin: .6rem 0; }
summary { cursor: pointer; color: var(--muted); }

/* Aperçu d'apparence dans l'administration */
.preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-top: .8rem;
  background: var(--p-bg, var(--bg));
  color: var(--p-text, var(--text));
  font-family: var(--p-font, var(--font));
}
.preview .preview-title { font-weight: 600; font-size: 1.15rem; margin: 0 0 .6rem; }
.preview .preview-bar { height: 12px; border-radius: 6px; background: var(--p-track, var(--bar-track)); margin: .35rem 0 .7rem; overflow: hidden; }
.preview .preview-bar i { display: block; height: 100%; background: var(--p-bar, var(--bar)); border-radius: 6px; }
.preview .preview-kw {
  display: inline-block; border-radius: 999px; padding: .15rem .65rem; font-size: .85rem; margin-right: .3rem;
  background: var(--p-soft, var(--accent-soft)); color: var(--p-accent, var(--accent));
}
.preview .preview-muted { color: var(--p-muted, var(--muted)); font-size: .9rem; }

/* ------------------------------------------------- Question ligne du temps */

.tl-launch { margin-top: .6rem; }

body.tl-open { overflow: hidden; }

.tl-overlay {
  /* Largeur de la colonne des visuels : les cartes posées, les repères Avant
     et Après s'alignent dessus, à droite de l'écran. */
  --tl-img-w: 4.8rem;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.tl-overlay[hidden] { display: none; }

.tl-stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }

/* L'intitulé occupe toute la largeur, sous le compteur et le bouton de sortie :
   une question longue se lit d'un trait au lieu d'être coupée. */
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .8rem;
  padding: .5rem .9rem;
  border-bottom: 1px solid var(--border);
}
.tl-head .tl-prompt {
  order: 3;
  flex: 1 0 100%;
  font-weight: 600;
  font-size: .98rem;
  /* Garde-fou : un intitulé interminable ne doit pas manger l'écran. */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.tl-head .tl-progress { order: 1; flex: 1; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.tl-head .tl-quit { order: 2; }

/* La ligne du temps est verticale : c'est le sens dans lequel un téléphone a
   de la place, et le libellé de chaque carte tient à côté de son visuel. */
.tl-board {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: .4rem .8rem 1rem;
  scroll-padding: 4rem 0;
}
.tl-track { display: flex; flex-direction: column; max-width: 34rem; margin: 0 auto; }
.tl-edge {
  display: flex;
  justify-content: flex-end;
  color: var(--muted);
  font-size: .8rem;
  padding: .2rem .5rem;
}
.tl-edge span { width: var(--tl-img-w); text-align: center; }

.tl-gap {
  height: 10px;
  border-radius: 8px;
  transition: height .18s ease, background .18s ease;
}
.tl-track.is-armed .tl-gap {
  height: 2.6rem;
  border: 2px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  cursor: pointer;
}
.tl-track.is-armed .tl-gap::after { content: "Déplacer ici"; }
.tl-gap.is-active {
  height: 2.6rem;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

/* Une carte de la ligne : vignette et libellé côte à côte. */
.tl-card {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .35rem .5rem;
  margin: 2px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.tl-card img {
  width: 4.4rem;
  height: 3.2rem;
  /* Le visuel est montré en entier ; le vide autour prend la couleur de la
     carte, sinon un fond blanc dessine un rectangle autour de chaque image. */
  object-fit: contain;
  border-radius: 6px;
  flex: none;
  display: block;
  user-select: none;
}
.tl-card figcaption { font-size: .95rem; line-height: 1.25; }

/* Sur la ligne du temps, le descriptif se lit à gauche et le visuel se cale à
   droite, en colonne : l'œil suit une seule ligne verticale d'images. */
.tl-track .tl-card.is-placed { flex-direction: row-reverse; }
.tl-track .tl-card.is-placed figcaption { flex: 1; text-align: right; }
.tl-track .tl-card.is-placed img {
  width: var(--tl-img-w);
  height: auto;
  max-height: 7.5rem;
}
.tl-track .tl-card.is-placed.is-textonly figcaption { flex: 1; text-align: center; }
/* Libellé masqué : le visuel prend toute la largeur qui se libère. */
.tl-card.no-label img { width: 100%; height: 5.6rem; }
/* Sans libellé, le cadre épouse le visuel : une carte, pas un bandeau vide. */
.tl-track .tl-card.is-placed.no-label {
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  padding: .3rem;
}
.tl-track .tl-card.is-placed.no-label img { width: auto; max-width: 100%; height: 6rem; }
.tl-card.is-textonly { justify-content: center; min-height: 3.2rem; }
.tl-card.is-textonly figcaption { text-align: center; font-weight: 500; }
.tl-card.just-placed { animation: tl-pop .4s ease; }
@keyframes tl-pop { 0% { transform: scale(.94); opacity: .35; } 100% { transform: scale(1); opacity: 1; } }

/* La carte à placer, en bas, aussi grande que possible. */
.tl-deck {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: .6rem .8rem;
  display: flex;
  justify-content: center;
}
.tl-deck .tl-card.is-current {
  flex-direction: column;
  justify-content: center;
  gap: .4rem;
  width: min(30rem, 100%);
  min-height: 7.5rem;
  padding: .6rem;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  cursor: grab;
  touch-action: none;
}
.tl-deck .tl-card.is-current img {
  width: 100%;
  height: min(30vh, 15rem);
  border-radius: 8px;
}
.tl-deck .tl-card.is-current.no-label { width: max-content; max-width: 100%; }
.tl-deck .tl-card.is-current.no-label img { width: auto; max-width: 100%; height: min(36vh, 19rem); }
.tl-deck .tl-card.is-current figcaption {
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}
.tl-card.is-armed { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Carte reprise sur la ligne : on la voit soulevée, et son ancienne place
   reste visible pour se repérer. */
.tl-track .tl-card.is-placed.is-armed {
  opacity: .75;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.tl-track .tl-card.is-placed { cursor: pointer; }
.tl-deck .tl-card.is-dragging { opacity: .3; }

/* Écran bas — téléphone couché, ordinateur portable : la carte passe en ligne. */
@media (max-height: 560px) {
  /* Écran bas : l'intitulé revient sur la même ligne que le compteur, sinon
     l'en-tête mange la place de la ligne du temps. */
  .tl-head { flex-wrap: nowrap; }
  .tl-head .tl-prompt { order: 0; flex: 1 1 auto; -webkit-line-clamp: 2; line-clamp: 2; }
  .tl-head .tl-progress { order: 1; flex: none; }

  .tl-deck .tl-card.is-current { flex-direction: row; align-items: center; }
  .tl-deck .tl-card.is-current img { width: 40%; height: min(26vh, 8rem); }
  .tl-deck .tl-card.is-current figcaption { text-align: left; flex: 1; }
  .tl-deck .tl-card.is-current.no-label img { width: 100%; height: min(30vh, 7.5rem); }
  .tl-card img { width: 3.6rem; height: 2.6rem; }
  .tl-card.no-label img { width: 100%; height: 3.4rem; }
}

.tl-ghost {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  width: 12rem;
  transform: translate(-50%, -50%) rotate(-2deg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  margin: 0;
  opacity: .95;
}
.tl-ghost img { width: 3.6rem; height: 2.6rem; }

.tl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem .9rem;
  border-top: 1px solid var(--border);
}
.tl-foot .tl-hint { color: var(--muted); font-size: .85rem; }
.tl-next[disabled] { opacity: .45; cursor: not-allowed; }

/* Étape de sélection */
.tl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: .5rem;
  /* Marges automatiques : la grille se centre sans jamais dépasser la ligne. */
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
}
.tl-grid .tl-card.is-pickable {
  flex-direction: column;
  align-items: stretch;
  gap: .3rem;
  cursor: pointer;
  position: relative;
}
.tl-grid .tl-card.is-pickable img {
  /* Le cadre épouse le visuel, et la vignette reste assez grande pour être
     reconnue : le descriptif, lui, se lit dessous. */
  width: auto;
  max-width: 100%;
  height: 7rem;
  margin: 0 auto;
}
.tl-grid .tl-card.is-pickable.no-label img { height: 9rem; }
.tl-grid .tl-card.is-pickable figcaption { font-size: .85rem; text-align: center; }
.tl-grid .tl-card.is-picked { outline: 3px solid var(--accent); outline-offset: -1px; }
.tl-grid .tl-card.is-picked::after {
  content: "✓";
  position: absolute;
  inset: 6px 6px auto auto;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 999px;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  font-size: .85rem;
}

/* Restitution */
.tl-result-strip { display: flex; gap: .4rem; flex-wrap: wrap; align-items: flex-end; margin: .6rem 0; }
.tl-result-strip .tl-mini { width: var(--mini-w, 74px); }
.tl-result-strip .tl-mini img { width: 100%; border-radius: 8px; display: block; border: 1px solid var(--border); }
.tl-result-strip .tl-mini figcaption { font-size: .78rem; color: var(--muted); text-align: center; margin-top: .2rem; }
.tl-rank { display: flex; align-items: center; gap: .7rem; margin: .45rem 0; }
.tl-rank img { width: 56px; border-radius: 8px; border: 1px solid var(--border); flex: none; }
.tl-rank .tl-rank-body { flex: 1; }

/* Aperçu des cartes dans l'administration */
.card-strip { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; margin-top: .6rem; }
.mini-card { margin: 0; width: 88px; }
.mini-card img { width: 100%; border-radius: 8px; display: block; border: 1px solid var(--border); }
.mini-card figcaption { font-size: .8rem; color: var(--muted); text-align: center; }
.mini-card .mini-blank {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 66px;
  padding: .2rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: .72rem;
  text-align: center;
}

/* Écran projeté : cartes plus grandes */
body.screen .tl-result-strip .tl-mini { width: var(--mini-w-screen, clamp(80px, 9vw, 150px)); }
body.screen .tl-rank { margin: .25rem 0; gap: 1rem; }
body.screen .tl-rank img { width: clamp(44px, 4vw, 74px); }
body.screen .tl-rank .bar { height: clamp(10px, 1.4vw, 18px); }
body.screen .tl-rank .bar-label { font-size: clamp(1rem, 1.7vw, 1.6rem); margin-bottom: .1rem; }
body.screen .slide { overflow: hidden; }

/* Confrontation aux valeurs réelles */
.tl-group-line { display: flex; align-items: center; gap: .6rem; margin-top: .25rem; }
.tl-group-line .bar.is-group { height: 6px; flex: 1; opacity: .75; }
.tl-group-line .bar.is-group i { background: var(--muted); }
body.screen .tl-group-line .bar.is-group { height: clamp(5px, .7vw, 9px); }
body.screen .tl-group-line .count { font-size: clamp(.8rem, 1.1vw, 1.1rem); }

/* Page d'accueil et page à projeter pour rejoindre */
.code-input {
  font-size: 2rem;
  letter-spacing: .5rem;
  text-align: center;
  width: 8.5rem;
  font-variant-numeric: tabular-nums;
}

.join-slide { justify-content: center; }
.join-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 5rem);
}
.join-qr {
  background: #fff;
  padding: 1.2rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  min-width: clamp(190px, 26vw, 400px);
  min-height: clamp(190px, 26vw, 400px);
  line-height: 0;
}
.join-steps { font-size: clamp(1.1rem, 2.2vw, 2.1rem); }
.join-step { display: flex; align-items: baseline; gap: .7rem; margin: .3rem 0; }
.join-num {
  background: var(--accent); color: var(--on-accent);
  border-radius: 50%; width: 1.7em; height: 1.7em;
  display: inline-grid; place-items: center;
  font-size: .75em; flex: none;
}
.join-or { color: var(--muted); margin: .5rem 0 .5rem 2.2em; }
.join-code {
  font-size: clamp(3.5rem, 11vw, 9rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .1em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin: .3rem 0 0;
}
@media (max-width: 760px) {
  .join-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .join-step { justify-content: center; }
}

/* Compte à rebours de l'écran d'accueil */
.join-timer {
  margin-top: clamp(.8rem, 3vh, 2.5rem);
  display: grid;
  gap: .4rem;
  max-width: min(900px, 84vw);
}
.timer-value {
  margin: 0;
  font-size: clamp(2.6rem, 13vh, 7rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.timer-track {
  height: clamp(8px, 1.2vh, 16px);
  background: var(--accent-soft);
  border-radius: 999px;
  overflow: hidden;
}
.timer-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width .3s linear;
}
.timer-state {
  margin: 0;
  color: var(--muted);
  font-size: clamp(.85rem, 1.8vh, 1.3rem);
}
.join-timer.is-final .timer-value { color: var(--accent); }
.join-timer.is-over .timer-value {
  color: var(--accent);
  animation: timer-blink 1.2s steps(2, start) infinite;
}
@keyframes timer-blink { 50% { opacity: .2; } }

/* Avec le décompte, le QR code et le code laissent un peu de place. */
.join-slide.has-timer .join-qr {
  min-width: clamp(150px, 19vw, 300px);
  min-height: clamp(150px, 19vw, 300px);
}
.join-slide.has-timer .join-code { font-size: clamp(2.6rem, 8vw, 6.5rem); }
.join-slide.has-timer .join-steps { font-size: clamp(1rem, 1.9vw, 1.7rem); }

.screen-next {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

/* Régie de projection */
.regie-now {
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  font-weight: 600;
  margin: .2rem 0 .1rem;
}
.regie-controls { display: flex; gap: .8rem; margin-top: 1rem; flex-wrap: wrap; }
.btn-big {
  font-size: 1.15rem;
  padding: .9rem 1.6rem;
  min-width: 11rem;
}
.btn-big:disabled { opacity: .45; cursor: default; }
.regie-timer {
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: .2rem 0 0;
  line-height: 1;
}
.regie-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .4rem; }
.regie-slide {
  width: 100%;
  text-align: left;
  display: grid;
  gap: .15rem;
  padding: .7rem .9rem;
}
.regie-slide strong { font-weight: 600; }
.regie-slide .muted { font-size: .85rem; }
.regie-slide.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.regie-list li { counter-increment: regie; }
.regie-list { counter-reset: regie; }
.regie-slide strong::before {
  content: counter(regie) ". ";
  color: var(--muted);
  font-weight: 400;
}

/* Code de participation dans l'administration */
.code-badge {
  display: inline-block;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: .25rem;
  font-variant-numeric: tabular-nums;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius);
  padding: .3rem 1rem;
}
