/*  petitbac.css — une feuille de cahier à grands carreaux (Seyès) posée sur
 *  le pupitre, dans la nuit du manoir ; la lettre dans un médaillon d'or,
 *  le chrono à la craie sur l'ardoise, les corrections rouges du prof, le
 *  score à la plume — et rien qui ne tienne qu'à sa teinte.
 *
 *  ═══ LE JEU EST EN DOM : C'EST DE LA SAISIE ═══
 *
 *  Huit vrais <input> (un par catégorie), pour le clavier virtuel, le
 *  lecteur d'écran et le zoom. Ils font 16 px au moins : un téléphone ne
 *  zoome pas tout seul à la prise de focus. Les commandes sont des BOUTONS
 *  de 44 px — Je rends ma feuille et Manche suivante DANS la feuille, sous
 *  la dernière ligne, avec un rappel du chrono (Fabrice, 15/09) ; Nouvelle
 *  sous le pupitre, à droite sur un téléphone couché ; `touch-action:
 *  manipulation` sur les boutons, jamais sur les champs.
 *
 *  ═══ L'ÉTAT N'EST JAMAIS PORTÉ PAR LA SEULE COULEUR ═══
 *
 *  Un mot juste porte un ✓ vert ÉPAIS ; un mot faux porte un ✗ rouge ET
 *  est barré ; un mot douteux porte un ? et deux boutons ; le joueur dont
 *  c'est la feuille est doré ET porte un point ; le gagnant, une couronne.
 *  Les jetons `--pb-*` sont MESURÉS par le banc : 4,5:1 (textes), 3:1
 *  (repères).
 */
:root {
  /*  Les six jetons communs aux salons récents, gardés tels quels. */
  --pb-nuit:     #1b1526;
  --pb-panneau:  #2a2338;
  --pb-liseré:   #6b5a90;
  --pb-texte:    #f0ead9;
  --pb-doux:     #c9c0dc;
  --pb-or:       #f0d68a;

  /*  Le pupitre de bois, et ce qu'on y pose. */
  --pb-pupitre:   #4a2c1e;
  --pb-pupitre-b: #2e1a10;
  --pb-cadre:     #4b3a63;
  --pb-cadre-b:   #2b2140;

  /*  La feuille : le papier, l'encre, les carreaux, la marge. */
  --pb-papier:    #f7f1df;
  --pb-papier-b:  #e9e1c8;   /* la feuille du dessous, l'ombre du pli */
  --pb-encre:     #1d2a5e;   /* ce qu'on écrit à la plume (texte, 4,5:1 sur le papier) */
  --pb-ligne:     #9fbfe0;   /* les carreaux Seyès (décor) */
  --pb-marge:     #e39a9a;   /* la marge rouge (décor) */
  --pb-mine:      #5a5670;   /* le nom de la catégorie, au crayon (texte, 4,5:1 sur le papier) */
  --pb-rouge:     #b3261e;   /* les corrections du prof : ✗ et barré (texte, 4,5:1 sur le papier) */
  --pb-vert:      #1e6b3a;   /* le ✓ (texte, 4,5:1 sur le papier) */
  --pb-doute:     #7a4a00;   /* le ? d'un mot douteux (texte, 4,5:1 sur le papier) */

  /*  L'ardoise et la craie. */
  --pb-ardoise:   #2f3b36;
  --pb-craie:     #f4f1e6;   /* le chrono (texte, 4,5:1 sur l'ardoise) */
  --pb-craie-rouge: #ffb3a7; /* les dix dernières secondes (texte, 4,5:1 sur l'ardoise) */

  /*  Le médaillon d'or et la lettre. */
  --pb-medaillon:   #f0d68a;
  --pb-medaillon-b: #c9a94f;
  --pb-lettre:      #1b1526; /* la lettre sur l'or (texte, 4,5:1) */

  --pb-sur:    #7fd39a;
  --pb-alerte: #ef8a8a;
  --pb-bord:   #8a78b0;

  /*  Les commandes, en couleurs opaques — reprises de la crapette, mesurées. */
  --pb-ctl:        #231b2d;
  --pb-ctl-vif:    #31293a;
  --pb-ctl-or:     #3d3033;
  --pb-ctl-or-vif: #4e413b;
}

/* ═══════════════════════════════════ LA BARRE, ET SES COMMANDES ═════════ */

.bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px clamp(10px, 2vw, 16px);
}
.sep { width: 1px; align-self: stretch; background: var(--pb-liseré); margin: 0 2px; }

.bar a {
  font-size: 13px; color: var(--pb-texte); text-decoration: none;
  border: 1px solid var(--pb-bord); border-radius: 8px;
  padding: 7px 11px;
  transition: background .16s, border-color .16s;
}
.bar a:hover { background: var(--pb-ctl-vif); border-color: var(--pb-or); }
.bar a:focus-visible { outline: 3px solid var(--pb-or); outline-offset: 2px; }

.bar button, .pb-outils button, .pb-valide button, .pb-groupe button, .pb-voile-carte button {
  font-family: inherit; font-size: 13px; color: var(--pb-texte);
  background: var(--pb-ctl);
  border: 1px solid var(--pb-bord); border-radius: 8px;
  padding: 7px 11px; cursor: pointer; min-height: 40px;
  touch-action: manipulation;
  transition: background .16s, border-color .16s, transform .1s;
}
.bar button:hover:not(:disabled), .pb-outils button:hover:not(:disabled), .pb-valide button:hover:not(:disabled), .pb-groupe button:hover:not(:disabled), .pb-voile-carte button:hover { background: var(--pb-ctl-vif); border-color: var(--pb-or); }
.pb-outils button:active:not(:disabled), .pb-valide button:active:not(:disabled) { transform: translateY(1px); }
.bar button:focus-visible, .pb-outils button:focus-visible, .pb-valide button:focus-visible, .pb-groupe button:focus-visible, .pb-voile-carte button:focus-visible { outline: 3px solid var(--pb-or); outline-offset: 2px; }
@media (pointer: coarse) { .bar button, .pb-outils button, .pb-valide button, .pb-groupe button, .pb-voile-carte button { min-height: 44px; } }

.pb-outils button kbd {
  font: 11px/1 ui-monospace, Menlo, Consolas, monospace; color: var(--pb-doux);
  border: 1px solid var(--pb-bord); border-radius: 4px; padding: 1px 4px; margin-left: 2px;
}
.pb-outils button.gold, .pb-valide button.gold, .pb-voile-carte button.gold { background: var(--pb-ctl-or); border-color: var(--pb-or); font-weight: bold; }
.pb-outils button.gold:hover:not(:disabled), .pb-valide button.gold:hover:not(:disabled), .pb-voile-carte button.gold:hover { background: var(--pb-ctl-or-vif); }
.bar button:disabled, .pb-outils button:disabled, .pb-valide button:disabled, .pb-groupe button:disabled {
  background: transparent; color: var(--pb-doux);
  border-style: dashed; cursor: not-allowed; font-weight: normal;
}
.pb-outils button[hidden], .pb-valide button[hidden] { display: none; }

body.ludi-scene { background: var(--pb-nuit); color: var(--pb-texte); }
h1 { font-family: Fraunces, Georgia, 'Times New Roman', serif; letter-spacing: .3px; }

/* ─────────────────────────────────────────────────────── le bandeau d’état ── */

.etat {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  flex: 0 0 100%; box-sizing: border-box;
  margin: 0 auto 10px; max-width: 1100px; padding: 6px 14px;
  background: var(--pb-panneau); border: 1px solid var(--pb-liseré);
  border-radius: 10px; color: var(--pb-doux); font-size: .94rem;
}
.etat b { color: var(--pb-texte); font-variant-numeric: tabular-nums; }

.pb-jeton {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px 3px 4px; border-radius: 999px;
  background: var(--pb-ctl); border: 1px solid var(--pb-bord);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 3px rgba(0, 0, 0, .45);
  color: var(--pb-doux); font-size: .88rem; white-space: nowrap;
}
.pb-jeton b { font-size: 1rem; min-width: 1.2em; text-align: center; }
.pb-jeton[hidden] { display: none; }
/*  À vous : le jeton du joueur se dore ET porte un point ; le gagnant, une couronne. */
.pb-jeton.a-vous { border-color: var(--pb-or); }
.pb-jeton.a-vous b::after { content: ' ●'; color: var(--pb-or); font-size: .7em; }
.pb-jeton.gagnant { border-color: var(--pb-or); }
.pb-jeton.gagnant b::after { content: ' ♛'; color: var(--pb-or); font-size: .8em; }
#code { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .08em; }
.pb-ico {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 12px/1 Georgia, 'Times New Roman', serif; font-style: normal; color: var(--pb-or);
  background: radial-gradient(circle at 35% 30%, #5a4a78, var(--pb-ctl-or) 70%);
  border: 1px solid var(--pb-or);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -2px 0 rgba(0, 0, 0, .35);
}

.pb-choix { display: inline-flex; gap: 8px; align-items: center; position: relative; margin-left: auto; }
.pb-options {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 300px; max-width: min(92vw, 440px);
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  background: var(--pb-panneau); border: 1px solid var(--pb-or); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); color: var(--pb-texte); font-size: 14px;
  max-height: min(70vh, 600px); overflow: auto; text-align: left;
}
.pb-options[hidden] { display: none; }
.pb-options h4 { margin: 0 0 2px; font-size: 13px; color: var(--pb-or); text-transform: uppercase; letter-spacing: .04em; }
.pb-options .pb-option { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 28px; }
.pb-options .pb-option input { accent-color: var(--pb-or); width: 18px; height: 18px; margin: 0; }
.pb-groupe { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.pb-groupe > span { color: var(--pb-doux); font-size: 13px; margin-right: 2px; min-width: 60px; }
.pb-groupe label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; min-height: 28px; }
.pb-groupe label input { accent-color: var(--pb-or); width: 16px; height: 16px; margin: 0; }
.pb-groupe label:has(input:disabled) { color: var(--pb-doux); opacity: .7; cursor: not-allowed; }
.pb-groupe button { min-width: 40px; padding: 5px 9px; min-height: 36px; }
.pb-code {
  font: 16px/1 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .12em; text-transform: uppercase;
  width: 7.5ch; padding: 6px 8px; border-radius: 8px; box-sizing: content-box;
  background: var(--pb-ctl); color: var(--pb-texte); border: 1px solid var(--pb-bord);
}
.pb-code:focus-visible { outline: 3px solid var(--pb-or); outline-offset: 2px; }
.pb-note { color: var(--pb-doux); font-size: 12.5px; font-style: italic; min-height: 1em; }
.pb-puce {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; cursor: pointer; touch-action: manipulation;
  background: var(--pb-ctl-or); border: 1px solid var(--pb-or); color: var(--pb-texte);
  font: inherit; font-size: .92rem; font-weight: 600;
}
.pb-puce:hover { background: var(--pb-ctl-or-vif); }
.pb-puce:focus-visible { outline: 3px solid var(--pb-or); outline-offset: 2px; }
@media (pointer: coarse) { .pb-puce { min-height: 44px; } }
.pb-chevron { color: var(--pb-or); font-size: .8em; }

/*  ═══ LE VERDICT FLOTTE SUR LA LIGNE DES VOIX ═══ */
.pb-voix { position: relative; width: 100%; max-width: 100%; }
#verdict { display: none; }
#verdict:not(:empty) {
  display: flex; align-items: center; box-sizing: border-box;
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 6;
  padding: 5px 10px; border-radius: 9px; font-weight: 700; font-size: .9rem; line-height: 1.3;
  background: var(--pb-panneau); border: 1px solid var(--pb-or);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .55); overflow: hidden;
}
#verdict.bon   { color: var(--pb-sur); }
#verdict.tiede { color: var(--pb-or); }
#verdict.dur   { color: var(--pb-alerte); }

/* ─────────────────────────────────────────────────────────────── le plateau ── */

.plateau {
  display: flex; flex-wrap: wrap; gap: clamp(10px, 2vw, 20px);
  justify-content: center; align-items: flex-start; align-content: flex-start;
  margin: 0 auto; max-width: min(1500px, 98vw);
  min-height: var(--plateau, auto);
}
.pb-colonne { display: flex; flex-direction: column; gap: 8px; align-items: center; min-width: 0; max-width: 100%; position: relative; width: 100%; }

/*  ═══ LE PUPITRE ═══ un cadre de bois sombre ; la feuille est posée dessus. */
.pb-pupitre {
  position: relative; box-sizing: border-box; width: min(100%, 640px);
  padding: 10px 12px 12px; border-radius: 12px;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, var(--pb-pupitre), var(--pb-pupitre-b));
  border: 2px solid var(--pb-liseré);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .12),
    inset 0 -3px 0 rgba(0, 0, 0, .45),
    0 10px 28px rgba(0, 0, 0, .55);
  transition: box-shadow .2s;
}
.pb-pupitre.refus { animation: pb-refus .3s ease; }
@keyframes pb-refus {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}

/*  Le haut du pupitre : le médaillon, l'ardoise, qui écrit. */
.pb-haut { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 8px; }
.pb-medaillon {
  width: 64px; height: 64px; border-radius: 50%; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #fff1b8, var(--pb-medaillon) 45%, var(--pb-medaillon-b) 100%);
  border: 3px solid var(--pb-medaillon-b);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 4px 12px rgba(0, 0, 0, .5);
  font: 700 40px/1 Fraunces, Georgia, 'Times New Roman', serif; color: var(--pb-lettre);
  text-transform: uppercase; user-select: none;
}
.pb-medaillon.tire { animation: pb-tire .5s ease; }
@keyframes pb-tire { 0% { transform: scale(.6) rotate(-20deg); } 70% { transform: scale(1.12) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
.pb-ardoise {
  position: relative; justify-self: stretch; box-sizing: border-box; min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 4px 14px 10px; border-radius: 6px;
  background: var(--pb-ardoise); border: 4px solid #6b4a2e; outline: 1px solid rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .45), 0 3px 8px rgba(0, 0, 0, .4);
}
.pb-craie {
  font: 700 26px/1 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', 'Chalkboard SE', cursive;
  color: var(--pb-craie); letter-spacing: .06em; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 2px rgba(244, 241, 230, .35);
}
.pb-ardoise.presse .pb-craie { color: var(--pb-craie-rouge); }
.pb-ardoise.presse .pb-craie::after { content: ' !'; }
.pb-ardoise.arrete .pb-craie { opacity: .6; }
.pb-barre { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; background: rgba(244, 241, 230, .18); border-radius: 2px; overflow: hidden; }
.pb-barre b { display: block; height: 100%; width: 100%; background: var(--pb-craie); transition: width .25s linear; }
.pb-ardoise.presse .pb-barre b { background: var(--pb-craie-rouge); }
.pb-qui { color: var(--pb-or); font: 700 14px/1.2 Georgia, 'Times New Roman', serif; text-align: right; max-width: 120px; }

/*  ═══ LA FEUILLE À GRANDS CARREAUX ═══ le fond est un Seyès : une ligne
    bleue tous les 8 mm (ici 40 px), trois interlignes plus fines, les
    verticales tous les 8 mm, la marge rouge à gauche. Chaque ligne du jeu
    occupe exactement un carreau : le mot s'écrit sur la ligne. */
.pb-feuille {
  --pb-car: 40px;
  position: relative; margin: 0; padding: 6px 8px 6px 0; border-radius: 3px 3px 6px 3px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--pb-car) / 4 - 1px), rgba(159, 191, 224, .35) calc(var(--pb-car) / 4 - 1px) calc(var(--pb-car) / 4)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--pb-car) - 1px), var(--pb-ligne) calc(var(--pb-car) - 1px) var(--pb-car)),
    repeating-linear-gradient(to right, transparent 0 calc(var(--pb-car) - 1px), rgba(159, 191, 224, .5) calc(var(--pb-car) - 1px) var(--pb-car)),
    linear-gradient(90deg, transparent 0 46px, var(--pb-marge) 46px 48px, transparent 48px),
    var(--pb-papier);
  background-position: 0 6px, 0 6px, 0 0, 0 0, 0 0;
  box-shadow: 0 1px 0 var(--pb-papier-b), 0 2px 0 rgba(0, 0, 0, .15), 0 6px 14px rgba(0, 0, 0, .45);
}
.pb-feuille::before {
  /*  Les trous du classeur, dans la marge. */
  content: ''; position: absolute; left: 14px; top: 30%; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pb-pupitre-b); box-shadow: 0 calc(40% + 40px) 0 var(--pb-pupitre-b), inset 0 1px 2px rgba(0, 0, 0, .6);
}
.pb-lignes { list-style: none; margin: 0; padding: 0 0 0 54px; }
.pb-ligne {
  display: grid; grid-template-columns: minmax(92px, 34%) 1fr auto auto; align-items: center; gap: 6px;
  height: var(--pb-car); box-sizing: border-box;
}
.pb-ligne label {
  font: 600 14px/1.15 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: var(--pb-mine);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 4px; cursor: text;
}
.pb-ligne label .pb-court { display: none; }
.pb-ligne input {
  box-sizing: border-box; width: 100%; height: calc(var(--pb-car) - 8px); min-width: 0;
  font: 400 18px/1.2 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: var(--pb-encre);
  background: transparent; border: 0; border-bottom: 1px dashed transparent; border-radius: 0; padding: 0 4px;
  caret-color: var(--pb-encre); outline: none;
  -webkit-appearance: none; appearance: none;
}
.pb-ligne input::placeholder { color: rgba(90, 86, 112, .55); font-style: italic; font-size: 14px; }
.pb-ligne input:focus { background: rgba(240, 214, 138, .28); border-bottom-color: var(--pb-encre); }
.pb-ligne input:focus-visible { outline: 2px solid var(--pb-encre); outline-offset: -1px; }
.pb-ligne input:disabled, .pb-ligne input[readonly] { color: var(--pb-encre); opacity: 1; -webkit-text-fill-color: var(--pb-encre); }
/*  ═══ LES CORRECTIONS DU PROF ═══ ✓ vert épais, ✗ rouge ET le mot barré,
    ? et deux boutons pour un mot douteux — jamais la couleur seule. */
.pb-ligne.juste input { text-decoration: underline; text-decoration-color: var(--pb-vert); text-decoration-thickness: 2px; }
.pb-ligne.faux input, .pb-ligne.refuse input { text-decoration: line-through; text-decoration-color: var(--pb-rouge); text-decoration-thickness: 3px; }
.pb-ligne.vide input { border-bottom: 1px dashed var(--pb-rouge); }
.pb-note-c {
  display: inline-flex; align-items: center; gap: 4px; min-width: 52px; justify-content: flex-end;
  font: 700 16px/1 Georgia, 'Times New Roman', serif; white-space: nowrap;
}
.pb-note-c[hidden] { display: none; }
.pb-note-c .pb-marque { font-size: 22px; line-height: 1; font-weight: 900; }
.pb-note-c .pb-pts { font-size: 15px; font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; }
/*  Le libellé complet de la correction, pour le lecteur d'écran seulement. */
.pb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pb-ligne.juste .pb-note-c, .pb-ligne.accepte .pb-note-c { color: var(--pb-vert); }
.pb-ligne.egalite .pb-note-c, .pb-ligne.reel .pb-note-c { color: var(--pb-doute); }
.pb-ligne.faux .pb-note-c, .pb-ligne.vide .pb-note-c, .pb-ligne.refuse .pb-note-c { color: var(--pb-rouge); }
.pb-ligne .pb-tranche { display: none; gap: 4px; }
.pb-ligne.douteux .pb-tranche, .pb-ligne.reel .pb-tranche, .pb-ligne.refuse .pb-tranche, .pb-ligne.accepte .pb-tranche { display: inline-flex; }
.pb-tranche button {
  width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 6px; cursor: pointer; touch-action: manipulation;
  font: 900 18px/1 Georgia, serif; background: var(--pb-papier-b); border: 2px solid var(--pb-mine); color: var(--pb-mine);
}
.pb-tranche button[data-ok="1"] { color: var(--pb-vert); border-color: var(--pb-vert); }
.pb-tranche button[data-ok="0"] { color: var(--pb-rouge); border-color: var(--pb-rouge); }
.pb-tranche button[aria-pressed="true"] { background: var(--pb-encre); color: var(--pb-papier); border-color: var(--pb-encre); }
.pb-tranche button:focus-visible { outline: 3px solid var(--pb-encre); outline-offset: 1px; }
@media (pointer: coarse) { .pb-tranche button { width: 44px; height: 44px; min-height: 44px; } }
.pb-ligne.douteux .pb-note-c { color: var(--pb-doute); }
/*  Le total de la feuille, à la plume, sous la dernière ligne. */
.pb-total {
  display: flex; justify-content: flex-end; align-items: baseline; gap: 8px; padding: 2px 8px 0 54px;
  font: 700 20px/1.6 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: var(--pb-encre);
}
.pb-total small { font-size: 13px; font-weight: 400; color: var(--pb-mine); }
.pb-total[hidden] { display: none; }
.pb-total .pb-plume { display: inline-block; transform-origin: left bottom; }
.pb-total.ecrit .pb-plume { animation: pb-plume .6s ease-out; }
@keyframes pb-plume { 0% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }
/*  ═══ VALIDER, DANS LA FEUILLE ═══ juste sous la dernière ligne (Fabrice,
    15/09 : le bouton fixé en bas de l'écran était à 150-210 px des cases,
    et sous le clavier virtuel). Le bouton d'or et, à côté, le rappel du
    chrono en encre sur le papier (4,5:1 mesuré ; rouge sous dix secondes,
    avec un « ! », jamais la couleur seule). La rangée fait un carreau et
    demi : les lignes du Seyès restent alignées. */
.pb-valide {
  display: flex; align-items: center; gap: 10px; box-sizing: border-box;
  min-height: calc(var(--pb-car) * 1.5); padding: 4px 8px 2px 54px;
}
.pb-valide button { flex: 0 1 auto; min-height: 44px; font-size: 1rem; font-weight: 700; padding: 6px 14px; white-space: nowrap; }
.pb-valide button .lib { font-size: .9rem; }
.pb-valide button .ico { font-size: 1.15rem; }
.pb-rappel {
  display: inline-flex; align-items: baseline; gap: 4px; margin-left: auto;
  font: 700 18px/1 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: var(--pb-encre);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pb-rappel i { font-style: normal; font-size: 15px; }
.pb-rappel.presse { color: var(--pb-rouge); }
.pb-rappel.presse b::after { content: ' !'; }
.pb-rappel.arrete { opacity: .55; }
.pb-rappel[hidden] { display: none; }

/*  Les onglets, pendant l'arbitrage à plusieurs : une feuille par joueur. */
.pb-onglets { display: flex; gap: 4px; padding: 0 8px 4px 54px; flex-wrap: wrap; }
.pb-onglets[hidden] { display: none; }
.pb-onglets button {
  font: 600 13px/1 Georgia, serif; padding: 6px 10px; min-height: 32px; border-radius: 6px 6px 0 0; cursor: pointer; touch-action: manipulation;
  background: var(--pb-papier-b); color: var(--pb-mine); border: 1px solid var(--pb-mine); border-bottom: 0;
}
.pb-onglets button[aria-selected="true"] { background: var(--pb-encre); color: var(--pb-papier); border-color: var(--pb-encre); }
.pb-onglets button:focus-visible { outline: 3px solid var(--pb-encre); outline-offset: 1px; }

/*  ═══ LE VOILE « PASSEZ L'APPAREIL » ═══ entre deux joueurs sur un écran :
    la feuille est cachée, le suivant confirme qu'il est prêt. */
.pb-voile {
  position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center;
  background: rgba(27, 21, 38, .92); border-radius: 12px;
}
.pb-voile[hidden] { display: none; }
.pb-voile-carte { text-align: center; padding: 16px 20px; max-width: 320px; }
.pb-voile-carte p { margin: 0 0 12px; font: 700 20px/1.3 Fraunces, Georgia, serif; color: var(--pb-or); }
.pb-voile-carte button { font-size: 1rem; padding: 10px 18px; }

/*  ═══ L'ANNONCE TRAVERSE L'ÉCRAN ═══ (Manche gagnée !, la lettre, la fin) */
.pb-annonce {
  position: absolute; left: 0; right: 0; top: 40%; z-index: 5;
  transform: translateX(-100%); opacity: 0; pointer-events: none; text-align: center;
  font: 700 clamp(1.2rem, 4.2vw, 2rem)/1 Fraunces, Georgia, 'Times New Roman', serif; color: var(--pb-or);
  letter-spacing: .04em; text-shadow: 0 0 16px rgba(0, 0, 0, .9), 0 2px 0 var(--pb-cadre-b);
  padding: 10px 0; line-height: 1;
  background: linear-gradient(90deg, rgba(27, 21, 38, 0), rgba(27, 21, 38, .94) 12%, rgba(27, 21, 38, .94) 88%, rgba(27, 21, 38, 0));
  border-top: 1px solid var(--pb-or); border-bottom: 1px solid var(--pb-or);
}
.pb-annonce.dur { color: var(--pb-alerte); border-color: var(--pb-alerte); }
.pb-annonce.on { animation: pb-annonce 1.6s linear forwards; }
@keyframes pb-annonce {
  0%      { opacity: 0; transform: translateX(-100%); animation-timing-function: cubic-bezier(.2, .8, .3, 1); }
  18%     { opacity: 1; transform: translateX(0); }
  82%     { opacity: 1; transform: translateX(0); animation-timing-function: cubic-bezier(.6, 0, .8, .4); }
  100%    { opacity: 0; transform: translateX(100%); }
}

/*  ═══ LES COMMANDES ═══ Je rends ma feuille, Manche suivante, Nouvelle. */
.pb-outils { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.pb-outils button { min-width: 44px; min-height: 44px; font-size: 1rem; font-weight: 700; padding: 6px 12px; }
.pb-outils button .lib { font-size: .8rem; font-weight: 400; }
.pb-outils button .ico { font-size: 1.15rem; }

.pb-dit {
  box-sizing: border-box; width: 100%; max-width: 100%; min-height: 2.6em;
  padding: 5px 10px; border-radius: 9px;
  background: var(--pb-panneau); border: 1px dashed var(--pb-bord);
  color: var(--pb-doux); font: 13.5px/1.35 Georgia, 'Times New Roman', serif;
  transition: border-color .3s, color .3s;
}
.pb-dit b { color: var(--pb-or); font-weight: 700; margin-right: 4px; }
.pb-dit.skelet b { color: var(--pb-doux); }
.pb-dit.on { border-style: solid; border-color: var(--pb-or); color: var(--pb-texte); }
.pb-dit.on.skelet { border-color: var(--pb-doux); }

.pb-legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .84rem; color: var(--pb-doux); justify-content: center; }
.pb-legende span { display: inline-flex; align-items: center; gap: 7px; }
.pb-legende i { flex: 0 0 auto; width: 18px; height: 18px; border-radius: 3px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; font: 900 14px/1 Georgia, serif; font-style: normal; background: var(--pb-papier); }
.pb-legende i.pb-leg-ok { color: var(--pb-vert); }
.pb-legende i.pb-leg-ko { color: var(--pb-rouge); }
.pb-legende kbd {
  font: 11px/1 ui-monospace, Menlo, Consolas, monospace; color: var(--pb-doux);
  border: 1px solid var(--pb-bord); border-radius: 4px; padding: 1px 4px;
}

@media (min-width: 1081px) {
  .pb-voix, .pb-legende { max-width: calc(100vw - 360px); }
}
@media (max-width: 1500px) {
  .etat { gap: 6px 8px; padding: 6px 10px; }
  .pb-jeton { padding: 3px 8px 3px 3px; }
  .pb-jeton .pb-lib { display: none; }
  .pb-outils button kbd { display: none; }
}
@media (max-height: 860px) {
  .pb-legende { display: none; }
}

.lb-sur .lb-sep { display: inline-block; }

/* ─────────────────────────────────────────────────────────── petits écrans ── */

@media (max-width: 640px), (max-height: 480px) {
  h1 { font-size: 1.05rem; margin: 4px 0 4px; }
  .bar { display: none; }
  .etat { font-size: 13px; gap: 3px 5px; padding: 3px 6px 3px; margin-bottom: 4px; }
  .pb-jeton { padding: 1px 6px 1px 2px; font-size: 12px; gap: 3px; }
  .pb-jeton .pb-lib { display: none; }
  .pb-jeton b { font-size: 13px; min-width: 0; }
  .pb-ico { width: 18px; height: 18px; font-size: 10px; }
  #jeton-meilleur { display: none; }
  .pb-choix { margin-left: 0; }
  .pb-puce#variantes { max-width: min(40vw, 200px); }
  .pb-puce#variantes #titre-variante { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .pb-puce#options { padding-left: 8px; padding-right: 8px; }
  .pb-options { right: auto; left: 0; min-width: min(92vw, 340px); }
  .pb-legende { display: none; }
  .plateau { gap: 4px; max-width: none; width: calc(100% + 16px); margin-left: -8px; }
  .pb-colonne { width: 100%; gap: 4px; }
  .pb-pupitre { padding: 6px 6px 8px; border-radius: 8px; width: 100%; }
  .pb-haut { gap: 6px; margin-bottom: 4px; }
  .pb-medaillon { width: 48px; height: 48px; font-size: 30px; }
  .pb-ardoise { min-height: 40px; padding: 2px 10px 8px; }
  .pb-craie { font-size: 22px; }
  .pb-qui { font-size: 12px; max-width: 90px; }
  .pb-feuille { --pb-car: 38px; padding: 4px 6px 4px 0; }
  .pb-feuille::before { left: 8px; width: 8px; height: 8px; }
  .pb-lignes { padding-left: 34px; }
  .pb-feuille { background-image:
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--pb-car) / 4 - 1px), rgba(159, 191, 224, .35) calc(var(--pb-car) / 4 - 1px) calc(var(--pb-car) / 4)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--pb-car) - 1px), var(--pb-ligne) calc(var(--pb-car) - 1px) var(--pb-car)),
    repeating-linear-gradient(to right, transparent 0 calc(var(--pb-car) - 1px), rgba(159, 191, 224, .5) calc(var(--pb-car) - 1px) var(--pb-car)),
    linear-gradient(90deg, transparent 0 28px, var(--pb-marge) 28px 30px, transparent 30px); }
  .pb-ligne { grid-template-columns: minmax(78px, 30%) 1fr auto auto; gap: 4px; }
  .pb-ligne label { font-size: 12.5px; }
  .pb-ligne label .pb-long { display: none; }
  .pb-ligne label .pb-court { display: inline; }
  .pb-ligne input { font-size: 16px; }
  /*  « Vous écrivez » passe DANS l'ardoise, à la craie, en haut à gauche :
      le bouton ☰ du bandeau flotte dans le coin haut droit, et la place
      manque à côté du chrono. */
  .pb-haut { grid-template-columns: auto 1fr; }
  .pb-ardoise { grid-area: 1 / 2; }
  .pb-qui { grid-area: 1 / 2; align-self: start; justify-self: start; margin: 3px 0 0 10px; font-size: 11px; color: var(--pb-craie); max-width: 46%; text-align: left; pointer-events: none; position: relative; z-index: 2; }
  .pb-note-c { min-width: 44px; }
  .pb-total { padding-left: 34px; font-size: 17px; }
  .pb-valide { padding-left: 34px; padding-right: 6px; gap: 8px; min-height: calc(var(--pb-car) * 1.4); }
  .pb-valide button { padding: 4px 10px; font-size: .95rem; }
  .pb-rappel { font-size: 17px; }
  .pb-onglets { padding-left: 34px; }
  .pb-dit {
    max-width: calc(100vw - 8px); font-size: 12px; line-height: 1.25;
    min-height: 0; height: calc(2 * 1.25em + 8px); padding: 4px 8px; overflow: hidden;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  .pb-voix { max-width: calc(100vw - 8px); }
  #verdict:not(:empty) { font-size: 12px; padding: 4px 8px; }
  .pb-dit, #verdict:not(:empty) { padding-right: 112px; }
}
@media (max-width: 640px) and (orientation: portrait) {
  /*  Debout : plus de barre fixée en bas (elle portait « Je rends ma
      feuille » à 150-210 px des cases, et le clavier virtuel la couvrait
      ou la poussait). Rendre et Manche suivante sont dans la feuille ;
      Nouvelle reste seule, en ligne sous le pupitre, 44 px. */
  .pb-outils { position: static; display: flex; justify-content: flex-end; padding: 0 6px; }
  .pb-outils button { min-width: 0; padding: 4px 10px; font-size: 1rem; }
  .pb-outils button .lib { font-size: .8rem; }
  .pb-valide button { flex: 1 1 auto; }
}

/*  ═══ LE TÉLÉPHONE TOURNÉ ═══ le bandeau à gauche, la feuille au centre,
    les commandes à droite en colonne. */
@media (max-height: 480px) and (orientation: landscape) {
  h1 { display: none; }
  .plateau {
    display: grid; grid-template-columns: 170px minmax(0, 1fr) 72px;
    grid-template-areas: "etat cadre outils" "dit cadre outils"; column-gap: 6px; row-gap: 4px;
    align-items: start; justify-content: center; width: calc(100% + 16px); margin-left: -8px;
  }
  .etat {
    grid-area: etat; margin: 0; max-width: none; padding: 4px 6px; gap: 4px;
    flex-wrap: wrap; align-content: start;
  }
  .etat .pb-choix { width: 100%; flex-wrap: wrap; gap: 4px; }
  .etat .pb-puce#variantes { max-width: 100%; }
  .pb-options { left: 0; right: auto; }
  .pb-colonne { display: contents; }
  .pb-pupitre { grid-area: cadre; justify-self: center; width: 100%; max-width: 560px; padding: 4px 6px 6px; }
  .pb-haut { margin-bottom: 2px; }
  .pb-medaillon { width: 40px; height: 40px; font-size: 26px; }
  .pb-ardoise { min-height: 34px; padding: 1px 8px 7px; }
  .pb-craie { font-size: 19px; }
  .pb-feuille { --pb-car: 30px; padding: 2px 6px 2px 0; }
  .pb-ligne label { font-size: 12px; }
  .pb-ligne input { font-size: 16px; height: calc(var(--pb-car) - 4px); }
  .pb-total { font-size: 15px; line-height: 1.3; }
  .pb-valide { min-height: 44px; padding: 0 6px 0 34px; }
  .pb-valide button { min-height: 44px; padding: 2px 10px; font-size: .9rem; }
  /*  Le bouton ☰ du bandeau flotte dans le coin haut droit : la colonne
      des commandes commence sous lui. */
  .pb-outils { grid-area: outils; display: grid; grid-template-columns: 1fr; gap: 4px; align-self: start; position: static; margin-top: 48px; }
  .pb-outils button { min-width: 0; padding: 4px 2px; }
  .pb-outils button .lib { display: none; }
  .pb-voix { grid-area: dit; width: auto; max-width: none; align-self: stretch; }
  .pb-dit { width: auto; max-width: none; min-height: 0; height: 100%; -webkit-line-clamp: 8; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pb-pupitre.refus { animation: none; }
  .pb-annonce.on { animation: none; opacity: 1; transform: none; }
  .pb-medaillon.tire { animation: none; }
  .pb-total.ecrit .pb-plume { animation: none; }
  .pb-barre b { transition: none; }
  .pb-pupitre, .bar button, .bar a, .pb-dit { transition: none; }
}

.bar .pb-option { display: inline-flex; align-items: center; gap: 5px; color: var(--pb-doux); font-size: 13px; cursor: pointer; white-space: nowrap; }
.bar .pb-option input { accent-color: var(--pb-or); width: 16px; height: 16px; margin: 0; }
