/* Famille Zwiiip : styles communs des écrans animateur (bandeau, scène, classement, panneau, atelier, guide). */
@font-face {
  font-family: "Bricolage"; src: url("bricolage.woff2") format("woff2");
  font-weight: 200 800; font-display: swap;
}
:root {
  /* Couleurs de la famille ; chaque jeu définit en plus --marque, --vif, --fond, --discret et --trait. */
  --encre: #1b1340; --vrai: #1fdd9b; --faux: #ff4f6e; --papier: #fffdf7;
  --sortie: cubic-bezier(.23, 1, .32, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Le document ne défile jamais : seules les zones internes défilent. Le haut de l'écran (barre d'état du téléphone)
   est de la couleur du bandeau, pour que le fondu que le système y applique ne tombe sur rien de lisible. */
html { background: var(--marque); }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0; background: var(--marque); color: var(--encre); display: flex; flex-direction: column;   /* violet : c'est la couleur que le téléphone reprend pour sa barre d'état */
  font-family: "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--marque); outline-offset: 2px; }

/* Bandeau */
.haut { display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--marque); color: #fff; border-bottom: 3px solid var(--encre);
  /* le bandeau se prolonge sous la barre d'état, et son contenu commence en dessous */
  padding-top: calc(10px + env(safe-area-inset-top, 0px)); padding-left: calc(24px + env(safe-area-inset-left, 0px)); padding-right: calc(24px + env(safe-area-inset-right, 0px)); flex: none; }
/* Appli installée : le contenu du bandeau descend nettement sous la barre d'état, hors de la zone que le système estompe */
@media (display-mode: standalone) { .haut { padding-top: calc(28px + env(safe-area-inset-top, 0px)); padding-bottom: 14px; } }
a.marque { display: inline-block; text-decoration: none; }
.marque {
  background: var(--vif); color: var(--encre); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -1px;
  padding: 3px 12px 7px; border: 3px solid var(--encre); border-radius: 12px; box-shadow: 4px 4px 0 var(--encre); transform: rotate(-5deg);
}
.acces { flex: 1; display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 21px; font-weight: 600; min-width: 0; }
#lien-court { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { background: var(--papier); color: var(--encre); font-weight: 800; letter-spacing: 6px; padding: 2px 6px 4px 12px; border: 2px solid var(--encre); border-radius: 10px; }
.nb { font-size: 17px; white-space: nowrap; }
.nb b { font-size: 24px; }

.corps { flex: 1; min-height: 0; display: flex; background: var(--fond); }
.scene { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 24px 36px; overflow: auto; }
.vue { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 20px; }

/* Accueil */
.inviter { display: flex; align-items: center; gap: 44px; flex-wrap: wrap; justify-content: center; }
#qr { width: min(34vh, 300px); height: min(34vh, 300px); background: var(--papier); padding: 14px; border: 3px solid var(--encre); border-radius: 22px; box-shadow: 8px 8px 0 var(--encre); transform: rotate(-3deg); }
#qr svg { width: 100%; height: 100%; display: block; }
.inviter-texte { text-align: left; }
.inviter-texte p { margin: 0 0 4px; font-size: 22px; font-weight: 500; color: var(--discret); }
#lien-long { font-size: clamp(24px, 2.8vw, 38px); font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
#code-grand { font-size: clamp(64px, 10vw, 136px); font-weight: 800; letter-spacing: 10px; line-height: 1; margin-top: 8px; }
#annonce { font-size: 23px; font-weight: 700; margin: 0; min-height: 30px; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 900px; }
.puce {
  background: var(--papier); border: 2px solid var(--encre); border-radius: 999px; padding: 4px 14px 6px; font-size: 19px; font-weight: 600;
  transition: opacity .25s var(--sortie), transform .25s var(--sortie);
}
@starting-style { .puce { opacity: 0; transform: scale(.9) translateY(6px); } }

/* Carte en cours */
.fiche {
  background: var(--papier); border: 4px solid var(--encre); border-radius: 30px; box-shadow: 12px 12px 0 var(--encre);
  padding: 26px 44px 34px; transform: rotate(-1.5deg); max-width: min(100%, 920px); min-width: min(100%, 420px);
}
#sur { font-size: 20px; font-weight: 600; color: var(--discret); margin: 0 0 6px; }
#sur:empty { display: none; }
#texte { font-size: calc(clamp(34px, 6.2vw, 92px) * var(--k, 1)); font-weight: 800; line-height: 1.04; letter-spacing: -.025em; margin: 0; overflow-wrap: anywhere; }
.chrono { width: min(100%, 720px); display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.chrono-barre { flex: 1; height: 22px; border-radius: 999px; background: var(--papier); border: 3px solid var(--encre); overflow: hidden; }
#chrono-in { height: 100%; background: var(--marque); transform-origin: left center; transform: scaleX(0); }
#chrono-in.urgent { background: var(--faux); }
.chrono.libre #chrono-in { background: repeating-linear-gradient(-45deg, var(--fond) 0 12px, #fff 12px 24px); }
#secondes { font-size: 50px; font-weight: 800; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
#compteur { font-size: 23px; font-weight: 500; color: var(--discret); margin: 0; }


#rapides { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 0; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; }
#rapides span { background: var(--papier); border: 2px solid var(--encre); border-radius: 999px; padding: 2px 13px 4px; white-space: nowrap; }
#rapides span:nth-child(2) { background: var(--vif); font-weight: 800; }
#rapides b { font-weight: 800; }
#rapides em { font-style: normal; color: var(--discret); margin-left: 6px; }
#rapides .titre { background: none; border: 0; padding: 0; color: var(--discret); }

/* Classement final */
#v-fin h2 { font-size: 46px; letter-spacing: -.02em; margin: 0; }
/* Classement : la liste défile dans sa boîte, d'où une marge intérieure pour ne jamais rogner les ombres */
#final { list-style: none; margin: 0; padding: 4px 12px 14px 4px; width: min(100%, 660px); max-height: 58vh; overflow: auto;
  display: flex; flex-direction: column; gap: 8px; }
#final li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; text-align: left;
  padding: 9px 20px 10px 12px; border: 2px solid var(--trait); border-radius: 14px; background: #fff;
  font-size: 22px; font-weight: 600; animation: monte .3s var(--sortie) backwards; }
#final li:nth-child(2), #final li:nth-child(3) { border: 2.5px solid var(--encre); font-size: 25px; font-weight: 800; }
#final li:first-child { background: var(--vif); border: 3px solid var(--encre); box-shadow: 5px 5px 0 var(--encre); font-size: 30px; font-weight: 800; padding-block: 12px 13px; }
#final .rang { display: grid; place-items: center; width: 1.8em; height: 1.8em; border-radius: 50%; background: var(--fond);
  font-size: .72em; font-weight: 800; font-variant-numeric: tabular-nums; }
#final li:nth-child(2) .rang, #final li:nth-child(3) .rang { background: var(--encre); color: #fff; }
#final li:first-child .rang { background: var(--encre); color: var(--vif); }
#final .qui { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
#final .nom { overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
#final .temps { font-size: .5em; font-weight: 600; color: var(--discret); font-variant-numeric: tabular-nums; margin-top: 2px; }
#final li:first-child .temps { color: rgba(27, 19, 64, .62); }
#final .score { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
#final .score small { font-size: .55em; font-weight: 700; margin-left: .25em; opacity: .7; }
@media (max-width: 600px) {
  #v-fin h2 { font-size: 36px; }
  #final { padding-right: 9px; }
  /* Petit écran : le prénom prend toute la largeur, temps et score passent dessous */
  #final li { font-size: 18px; column-gap: 10px; row-gap: 2px; padding: 8px 14px 9px 9px;
    grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "rang nom nom" "rang temps score"; }
  #final .qui { display: contents; }
  #final .rang { grid-area: rang; }
  #final .nom { grid-area: nom; }
  #final .temps { grid-area: temps; align-self: center; margin-top: 0; font-size: .62em; }
  #final .score { grid-area: score; }
  #final li:nth-child(2), #final li:nth-child(3) { font-size: 20px; }
  #final li:first-child { font-size: 23px; box-shadow: 4px 4px 0 var(--encre); }
}
@keyframes monte { from { opacity: 0; transform: translateY(10px); } }

/* Boutons d'action sous la scène */
.actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; min-height: 74px; padding-top: 18px; }
.gros {
  border: 3px solid var(--encre); border-radius: 16px; padding: 13px 32px 16px; font-size: 23px; font-weight: 800;
  background: var(--vif); box-shadow: 5px 5px 0 var(--encre); transition: transform .1s ease-out, box-shadow .1s ease-out;
}
.gros:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--encre); }
.gros.neutre { background: var(--papier); }
.gros.rebours { background-image: linear-gradient(rgba(27, 19, 64, .16), rgba(27, 19, 64, .16)); background-repeat: no-repeat;
  background-size: 0 100%; animation: rebours var(--d, 5s) linear forwards; }
@keyframes rebours { to { background-size: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .gros.rebours { animation: none; } }
a.gros { display: inline-block; text-decoration: none; color: var(--encre); }
.astuce { text-align: center; color: var(--discret); font-size: 14px; margin: 10px 0 0; min-height: 18px; }

.signature { text-align: center; font-size: 15px; color: var(--discret); margin: 14px 0 0; }
.signature a { color: var(--encre); font-weight: 700; text-underline-offset: 3px; }

/* Panneau de commande */
/* Panneau de l'animateur : trois blocs nets (jouer, réglages, joueurs), le reste replié */
.panneau { width: 340px; flex: none; background: var(--fond); border-left: 3px solid var(--encre); padding: 14px; overflow: auto;
  display: flex; flex-direction: column; gap: 12px; }
.p-bloc { background: var(--papier); border: 2px solid var(--encre); border-radius: 16px; padding: 14px; }
.panneau h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.p-bloc > h3 { margin-bottom: 10px; }
.p-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.etiquette { font-size: 13px; font-weight: 700; color: var(--discret); }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--fond); border: 2px solid var(--encre); border-radius: 12px; }
.modes button { border: 0; border-radius: 8px; background: none; padding: 7px 4px 9px; font-weight: 800; font-size: 14px; color: var(--discret); cursor: pointer; }
.modes button[aria-selected="true"] { background: var(--encre); color: #fff; }
.p-mode[hidden] { display: none; }
.p-mode .bouton:first-of-type { margin-top: 8px; }
.p-jouer .note { margin-bottom: 0; }
.durees { display: flex; gap: 5px; margin-top: 8px; }
.durees button.libre { font-size: 19px; line-height: 1; padding-block: 4px 7px; }
.durees button { flex: 1; min-width: 0; font-size: 13.5px; padding: 6px 0 8px; border-radius: 10px; border: 2px solid var(--encre); background: #fff; font-weight: 700; cursor: pointer; }
.durees button[aria-pressed="true"] { background: var(--encre); color: #fff; }
.autre { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--discret); }
.autre input { width: 64px; padding: 4px 6px 5px; text-align: center; font-weight: 700; color: var(--encre); }
.coche { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin-top: 10px; }
/* Interrupteurs : un titre, une seule ligne d'explication */
.inter { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; cursor: pointer; }
.inter input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 40px; height: 24px; margin: 1px 0 0;
  border: 2px solid var(--encre); border-radius: 999px; background: #fff; cursor: pointer; transition: background-color .16s ease; }
.inter input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--encre);
  transition: transform .18s var(--sortie), background-color .16s ease; }
.inter input:checked { background: var(--marque); }
.inter input:checked::before { transform: translateX(16px); background: #fff; }
.inter input:focus-visible { outline: 3px solid var(--marque); outline-offset: 2px; }
.inter span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inter b { font-size: 14px; }
.inter small { font-size: 12.5px; color: var(--discret); line-height: 1.35; }
.en-cours { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--vif); border: 2px solid var(--encre); font-size: 14px; }
.en-cours[hidden] { display: none; }
.point { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--vrai); border: 1.5px solid var(--encre); vertical-align: 1px; }
.panneau .lien { font-size: 13px; color: var(--encre); }
.panneau .lien:disabled { opacity: .35; cursor: default; }
.pastille-j { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--encre); color: #fff; font-size: 12.5px; vertical-align: 1px; }
.panneau > * { flex: none; }
/* Le bloc Joueurs prend la place restante ; sa liste défile, « Gérer la salle » reste visible en bas */
/* Le bloc Joueurs ne rétrécit jamais sous son contenu : c'est la liste qui défile, pas le bouton qui déborde */
.panneau > .p-joueurs { flex: 1 0 auto; display: flex; flex-direction: column; }
.p-joueurs #scores { margin-top: 8px; max-height: max(132px, calc(100dvh - 560px)); overflow: auto; overscroll-behavior: contain; }
.p-joueurs .bouton { flex: none; margin-top: 10px; }
#scores[hidden] { display: none; }
.vide-j { margin: 8px 0 0; font-size: 13px; color: var(--discret); }
.vide-j[hidden] { display: none; }
#erreur:empty { display: none; }
.p-salle { border: 2px solid var(--trait); border-radius: 16px; background: var(--papier); }
.p-salle summary { list-style: none; cursor: pointer; padding: 11px 14px; font-weight: 800; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.p-salle summary::-webkit-details-marker { display: none; }
.p-salle summary::after { content: ""; width: 8px; height: 8px; border-right: 2.5px solid var(--encre); border-bottom: 2.5px solid var(--encre); transform: rotate(45deg) translateY(-3px); transition: transform .18s var(--sortie); }
.p-salle[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.p-salle-in { padding: 0 14px 14px; }
.p-salle-in .bouton:first-child { margin-top: 0; }
.bouton.danger { background: #fff; color: #c2183a; border-color: #c2183a; }
@media (hover: hover) and (pointer: fine) {
  .modes button:not([aria-selected="true"]):hover { color: var(--encre); }
  .durees button:not([aria-pressed="true"]):hover { background: var(--fond); }
  .bouton.danger:hover { background: #c2183a; color: #fff; }
}
@media (prefers-reduced-motion: reduce) { .inter input, .inter input::before, .p-salle summary::after { transition: none; } }
.champ { width: 100%; padding: 9px 12px 10px; border-radius: 10px; border: 2px solid var(--encre); background: #fff; }
.bouton { width: 100%; margin-top: 8px; padding: 9px 11px 11px; border-radius: 10px; border: 2px solid var(--encre); background: var(--encre); color: #fff; font-weight: 700; transition: transform .1s ease-out; }
.bouton:active { transform: scale(.97); }
.bouton.clair { background: var(--papier); color: var(--encre); }
.bouton:disabled { opacity: .35; cursor: default; }
.note { font-size: 13px; color: var(--discret); margin: 6px 0; line-height: 1.45; }
#scores { list-style: none; margin: 0; padding: 0; font-size: 15px; }
#scores li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--trait); }
#scores .temps { font-size: 13px; color: var(--discret); font-variant-numeric: tabular-nums; }
#scores .nom { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#scores .oter { border: 0; background: none; color: var(--discret); font-size: 17px; padding: 0 4px; }
#scores .oter:hover { color: #c2183a; }

/* ===== Atelier des séries ===== */
select.champ { appearance: none; -webkit-appearance: none; padding-right: 30px; font-weight: 600; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, var(--encre) 50%), linear-gradient(135deg, var(--encre) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 11px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
#atelier { width: min(1120px, 96vw); height: min(840px, 92vh); max-width: none; max-height: none; padding: 0; color: var(--encre);
  background: var(--papier); border: 4px solid var(--encre); border-radius: 26px; box-shadow: 12px 12px 0 var(--encre); overflow: hidden; }
#atelier[open] { display: flex; flex-direction: column; }
#atelier::backdrop { background: rgba(27, 19, 64, .6); }
.at-haut { display: flex; align-items: center; gap: 18px; padding: 14px 22px; border-bottom: 3px solid var(--encre); background: var(--vif); }
.at-haut h2 { margin: 0 auto 0 0; font-size: 26px; letter-spacing: -.02em; }
.at-haut .coche { margin: 0; font-weight: 600; }
.at-haut .bouton, .at-bas .bouton { width: auto; margin: 0; padding-inline: 16px; }
.at-corps { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.at-liste { border-right: 3px solid var(--encre); padding: 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; background: var(--fond); }
.at-liste > .bouton { margin: 0; }
.depot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 14px 12px; font-size: 14px;
  border: 3px dashed var(--encre); border-radius: 16px; background: var(--papier); transition: background-color .15s ease, transform .15s var(--sortie); }
.depot b { font-size: 16px; }
.depot .bouton { width: auto; margin: 2px 0; padding-inline: 16px; }
.depot .note { margin: 2px 0 0; }
.depot.survol { background: var(--vif); transform: scale(1.02); }
.lien { border: 0; background: none; padding: 0; font-size: 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
#at-series { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#at-series button { width: 100%; text-align: left; display: flex; align-items: baseline; gap: 8px; padding: 8px 12px 10px; border: 2px solid var(--encre); border-radius: 12px; background: var(--papier); font-weight: 700; }
#at-series button[aria-current="true"] { background: var(--encre); color: #fff; }
#at-series .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#at-series .nb { font-size: 13px; font-weight: 500; opacity: .75; white-space: nowrap; }
#at-series .vide { font-size: 14px; color: var(--discret); padding: 4px 2px; }
.at-edition { padding: 18px 22px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.at-edition > .note { margin: 0; font-size: 14px; max-width: 70ch; }
.at-edition kbd { font: inherit; font-weight: 700; border: 1.5px solid var(--encre); border-radius: 6px; padding: 0 5px 1px; background: #fff; }
#at-nom { font-size: 22px; font-weight: 800; padding: 8px 12px 10px; }
#at-cartes { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#at-cartes .num { text-align: right; font-weight: 700; color: var(--discret); font-variant-numeric: tabular-nums; }
#at-cartes input { font-size: 16px; }
#at-cartes .oter { border: 0; background: none; font-size: 20px; color: var(--discret); padding: 0 6px 2px; }
#at-cartes .oter:hover { color: #c2183a; }
#at-ajouter { width: auto; align-self: flex-start; margin: 4px 0 0 calc(2.2ch + 8px); padding-inline: 16px; }
.at-vide { margin: auto; text-align: center; max-width: 46ch; font-size: 18px; line-height: 1.45; }
.at-bas { display: flex; align-items: center; gap: 12px; padding: 12px 22px 16px; border-top: 3px solid var(--encre); }
#at-bilan { flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600; }
#at-bilan.alerte { color: #c2183a; }
.at-bas .gros { font-size: 19px; padding: 9px 22px 12px; }
.at-bas .gros:disabled { opacity: .4; cursor: default; }

/* Aide de l'atelier : repères discrets, guide latéral repliable */
.at-haut .aide { display: inline-flex; align-items: center; gap: 7px; }
.at-haut .aide[aria-expanded="true"] { background: var(--encre); color: #fff; }
.rond { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 2px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 800; line-height: 1; }
.exemple { display: block; max-width: 100%; font: 600 12.5px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--fond); border: 1.5px solid var(--trait); border-radius: 8px; padding: 5px 8px; overflow-wrap: anywhere; }
.depot .liens { font-size: 14px; }
.lien { color: inherit; cursor: pointer; }
.at-edition > .note .lien { font-size: inherit; color: var(--encre); white-space: nowrap; }
.saisie { position: relative; min-width: 0; }
.saisie .champ { width: 100%; }
.saisie.long .champ { padding-right: 70px; }
.compte { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: var(--discret);
  font-variant-numeric: tabular-nums; pointer-events: none; background: #fff; padding: 1px 4px; border-radius: 6px; }
.compte.fort { color: #c2183a; }
.at-vide { margin: auto; max-width: 46ch; text-align: center; }
.at-vide .grand { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 14px; }
.etapes { list-style: none; counter-reset: e; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; text-align: left; }
.etapes li { counter-increment: e; display: flex; gap: 12px; align-items: baseline; font-size: 16px; line-height: 1.4; }
.etapes li::before { content: counter(e); flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 2.5px solid var(--encre);
  border-radius: 50%; background: var(--vif); font-weight: 800; font-size: 14px; transform: translateY(-2px); }
.actions-vide { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; margin: 0; }
.actions-vide .bouton { width: auto; margin: 0; padding-inline: 20px; }
.actions-vide .lien { font-size: 15px; }

.at-corps { position: relative; overflow: hidden; }
.at-guide { position: absolute; top: 0; right: 0; bottom: 0; width: min(410px, 100%); z-index: 2; display: flex; flex-direction: column;
  background: var(--papier); border-left: 3px solid var(--encre); box-shadow: -10px 0 0 rgba(27, 19, 64, .08);
  animation: guide-entre .26s var(--sortie); }
.at-guide[hidden] { display: none; }
@keyframes guide-entre { from { transform: translateX(24px); opacity: 0; } }
.g-haut { display: flex; align-items: center; padding: 14px 18px 8px; }
.g-haut h3 { margin: 0 auto 0 0; font-size: 20px; }
.g-haut .oter { border: 0; background: none; font-size: 24px; color: var(--discret); padding: 0 6px 2px; cursor: pointer; }
.g-haut .oter:hover { color: var(--encre); }
.onglets { display: flex; gap: 4px; margin: 0 18px; padding: 4px; border: 2px solid var(--encre); border-radius: 12px; background: var(--fond); }
.onglets button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 6px 4px 8px; font-weight: 700; font-size: 14px; color: var(--discret); cursor: pointer; }
.onglets button[aria-selected="true"] { background: var(--encre); color: #fff; }
.g-page { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 20px; font-size: 14.5px; line-height: 1.5; }
.g-page:focus-visible { outline: 3px solid var(--marque); outline-offset: -3px; }
.conseils { margin: 0; }
.conseils dt { font-weight: 800; font-size: 15.5px; margin-top: 14px; }
.conseils dt:first-child { margin-top: 0; }
.conseils dd { margin: 3px 0 0; color: var(--discret); }
.oui, .non { display: block; width: fit-content; max-width: 100%; margin: 4px 0; padding: 3px 9px 4px; border-radius: 8px; font-weight: 600; color: var(--encre); }
.oui { background: color-mix(in srgb, var(--vrai) 28%, #fff); }
.non { background: color-mix(in srgb, var(--faux) 22%, #fff); text-decoration: line-through; text-decoration-color: rgba(194, 24, 58, .55); }
.oui::before { content: '✓ '; font-weight: 800; }
.non::before { content: '✗ '; font-weight: 800; display: inline-block; text-decoration: none; }
.g-intro { margin: 0 0 10px; font-weight: 600; }
.g-souci { margin: 0 0 12px; padding: 9px 12px; border: 2px solid #c2183a; border-radius: 12px; background: color-mix(in srgb, var(--faux) 14%, #fff); color: #8f0f2b; font-weight: 600; }
.tableur { width: 100%; border-collapse: collapse; font-size: 13.5px; background: #fff; border: 2px solid var(--encre); border-radius: 10px; overflow: hidden; border-style: hidden; box-shadow: 0 0 0 2px var(--encre); }
.tableur th, .tableur td { border: 1px solid var(--trait); padding: 5px 8px; text-align: left; }
.tableur thead th, .tableur tbody th { background: var(--fond); color: var(--discret); font-weight: 700; font-size: 12px; text-align: center; }
.tableur tr > :first-child { width: 28px; }
.tableur tr > :last-child { width: 70px; text-align: center; }
.tableur td:last-child { font-weight: 800; }
.tableur tbody tr:first-child td { color: var(--discret); font-style: italic; }
.g-etapes { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.g-titre { margin: 16px 0 4px; font-weight: 800; }
.g-puces { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.g-page code { font: 700 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--fond); border-radius: 5px; padding: 0 4px; }
.g-astuce { margin: 16px 0 14px; padding: 10px 12px; background: var(--vif); border: 2px solid var(--encre); border-radius: 12px; }
.g-page > .bouton { width: auto; margin: 0; padding-inline: 16px; }
.ia { margin: 0 0 14px; padding: 0; list-style: none; counter-reset: e; display: grid; gap: 16px; }
.ia > li { counter-increment: e; position: relative; padding-left: 34px; display: grid; gap: 7px; }
.ia > li::before { content: counter(e); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 24px; height: 24px;
  border: 2px solid var(--encre); border-radius: 50%; background: var(--vif); font-weight: 800; font-size: 13px; }
.ia-titre { margin: 0; }
.ia-champ { display: grid; gap: 3px; font-size: 13px; font-weight: 700; color: var(--discret); min-width: 0; }
.ia-champ .champ { font-size: 15px; padding: 7px 10px 8px; color: var(--encre); }
.ia-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 8px; }
.ia textarea { width: 100%; resize: vertical; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 8px 10px; }
.ia-prompt { background: var(--fond); color: var(--encre); }
.ia .bouton { width: auto; justify-self: start; margin: 0; padding-inline: 16px; }
.ia .bouton:disabled { opacity: .4; cursor: default; }
.ia-lien { font-size: 14px; }
.ia-note { font-size: 12.5px; color: var(--discret); line-height: 1.4; }
.controle { list-style: none; margin: 0; padding: 10px 12px; display: grid; gap: 5px; border: 2px solid var(--encre); border-radius: 12px; background: #fff; font-size: 13.5px; line-height: 1.4; }
.controle li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; }
.controle li::before { font-weight: 800; }
.controle .bon::before { content: '✓'; color: #0f8a5f; }
.controle .alerte::before { content: '!'; color: #b25b00; text-align: center; }
.controle .grave::before { content: '✗'; color: #c2183a; }
.controle .grave { color: #8f0f2b; font-weight: 600; }
.controle q { font-style: italic; color: var(--discret); overflow-wrap: anywhere; }
.chiffres { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chiffres li { display: flex; flex-direction: column; padding: 10px 12px; border: 2px solid var(--encre); border-radius: 14px; background: #fff; }
.chiffres b { font-size: 28px; line-height: 1.05; letter-spacing: -.02em; }
.chiffres span { font-size: 13px; color: var(--discret); }
@media (prefers-reduced-motion: reduce) { .at-guide { animation: none; } }

@media (max-width: 860px) {
  #atelier { width: 100vw; height: 100%; max-height: 100dvh; border-radius: 0; border-width: 0; box-shadow: none; }
  .at-corps { display: block; overflow: auto; }
  .at-liste { border-right: 0; border-bottom: 3px solid var(--encre); overflow: visible; }
  .at-edition { overflow: visible; padding: 16px 14px; }
  .at-haut { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .at-haut h2 { font-size: 22px; }
  .at-bas { flex-wrap: wrap; padding: 10px 14px 14px; }
  #at-bilan { flex-basis: 100%; }
  .at-guide { position: fixed; inset: 0; width: auto; border-left: 0; box-shadow: none; }
  .at-haut .aide { padding-inline: 12px; }
  .corps { flex-direction: column; overflow: auto; }
  .panneau { width: auto; border-left: 0; border-top: 3px solid var(--encre); overflow: visible; }
  .p-joueurs #scores { max-height: 50vh; }
  .scene { overflow: visible; padding: 20px 16px; flex: none; min-height: 70vh; }
  .acces #lien-court { display: none; }
  .fiche { padding: 18px 22px 24px; min-width: 0; box-shadow: 7px 7px 0 var(--encre); }
  .haut { padding-bottom: 10px; padding-left: calc(14px + env(safe-area-inset-left, 0px)); padding-right: calc(14px + env(safe-area-inset-right, 0px)); gap: 12px; }
  .corps { overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .inviter { gap: 24px; }
  .inviter-texte { text-align: center; }
  .gros { font-size: 20px; padding: 11px 22px 14px; }
}
@media (max-height: 820px) and (min-width: 861px) {
  .scene { padding-block: 16px; }
  .vue { gap: 12px; }
  .fiche { padding: 16px 36px 22px; }
  #rapides { font-size: 17px; }
  .actions { padding-top: 10px; min-height: 66px; }
  .panneau { gap: 10px; padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .puce, #final li { transition: none; animation: none; }
}
