/* Mini-jeux (/jeux) : accueil, salon d'attente, Tribunal des retardataires, page de résultat.
   Chargé uniquement par les gabarits templates/jeux/*.twig (pas dans style.css).
   Couleurs : uniquement les variables du thème (--bg, --panel, --text, --muted, --accent, --fg-rgb, --vis-*),
   donc rien à ajouter dans theme-light.css. Préfixe des classes : jx-. */

.jx-page {
  max-width: 68rem;
  margin: 1rem auto 2.5rem;
}

.jx-titre {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.jx-sous-titre {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

.jx-intro { max-width: 46rem; margin: 0 0 1rem; }
.jx-discret { color: var(--muted); font-size: 0.92rem; }
.jx-accent { color: var(--accent); font-weight: 600; }
.jx-ok { color: var(--vis-public); font-size: 0.9rem; }
.jx-lien { color: var(--accent); text-decoration: underline; cursor: pointer; }
.jx-vide { padding: 1.25rem; text-align: center; color: var(--muted); border: 1px dashed rgba(var(--fg-rgb), 0.18); border-radius: 10px; }

.jx-bandeau {
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border-left: 4px solid var(--vis-ami);
  background: rgba(var(--fg-rgb), 0.05);
  font-size: 0.92rem;
}

.jx-message {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: rgba(var(--fg-rgb), 0.06);
}
.jx-message--erreur { border-left: 4px solid var(--vis-prive); }

/* Cartes et grilles */
.jx-carte {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--fg-rgb), 0.1);
  background: var(--panel);
}
.jx-carte h2 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.jx-carte h3 { font-size: 1rem; margin: 0; }
.jx-carte > p { margin: 0 0 0.75rem; }
.jx-carte--etroite { max-width: 26rem; }

.jx-grille { display: grid; gap: 1rem; }
.jx-grille--2 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.jx-grille--3 { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

.jx-pseudo { margin-top: 1rem; }
.jx-pseudo summary { cursor: pointer; }
.jx-pseudo form { margin-top: 0.75rem; }

.jx-jeu { position: relative; display: flex; flex-direction: column; gap: 0.4rem; }
.jx-jeu p { flex: 1; color: var(--muted); font-size: 0.92rem; margin: 0; }
.jx-jeu-embleme { font-size: 1.8rem; line-height: 1; }
.jx-jeu--bientot { opacity: 0.72; }

/* Champs et boutons */
.jx-champ { display: flex; flex-direction: column; gap: 0.3rem; margin: 0 0 0.75rem; min-width: 0; }
/* Sur une ligne seulement : dans une colonne, « flex-basis » deviendrait une hauteur de 14rem. */
.jx-ligne > .jx-champ { flex: 1 1 14rem; }
.jx-champ > span { font-size: 0.88rem; color: var(--muted); }

.jx-champ input,
.jx-saisie {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--fg-rgb), 0.2);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.jx-champ input:focus-visible,
.jx-saisie:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.jx-saisie { resize: vertical; min-height: 3.2rem; }
.jx-saisie--mini { width: auto; padding: 0.25rem 0.4rem; font-size: 0.88rem; }
.jx-code-saisie { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 700; max-width: 11rem; }

.jx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--fg-rgb), 0.22);
  background: rgba(var(--fg-rgb), 0.06);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.jx-btn:hover, .jx-btn:focus-visible { background: rgba(var(--fg-rgb), 0.12); border-color: rgba(var(--fg-rgb), 0.35); }
.jx-btn--primaire { background: var(--accent); border-color: var(--accent); color: #06121c; }
.jx-btn--primaire:hover, .jx-btn--primaire:focus-visible { background: var(--accent); filter: brightness(1.12); }
.jx-btn--discret { background: transparent; font-weight: 500; }
.jx-btn--mini { padding: 0.25rem 0.55rem; font-size: 0.82rem; }
.jx-btn--grand { padding: 0.75rem 1.3rem; font-size: 1.05rem; }

.jx-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.jx-ligne > .jx-saisie { flex: 1 1 12rem; width: auto; }
.jx-pousse-droite { margin-left: auto; }
.jx-pied { margin-top: 1rem; justify-content: space-between; }

.jx-pastille {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(var(--fg-rgb), 0.25);
  white-space: nowrap;
}
.jx-pastille--ok { border-color: var(--vis-public); color: var(--vis-public); }
.jx-pastille--gris { color: var(--muted); }
.jx-pastille--phase { border-color: var(--accent); color: var(--accent); }

/* Tableaux (historique, totaux) */
.jx-table-defile { overflow-x: auto; }
.jx-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.jx-table th, .jx-table td { padding: 0.5rem 0.6rem; text-align: left; border-bottom: 1px solid rgba(var(--fg-rgb), 0.1); white-space: nowrap; }
.jx-table th { color: var(--muted); font-weight: 600; }

/* Salon */
.jx-salon-entete { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.jx-salon-entete .jx-titre { margin: 0; }
.jx-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.jx-code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.22em; color: var(--accent); }
.jx-lien-salon { margin: 0.2rem 0 0; overflow-wrap: anywhere; }

.jx-salon-corps { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.jx-colonne-jeu { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (max-width: 820px) {
  .jx-salon-corps { grid-template-columns: minmax(0, 1fr); }
}

.jx-joueurs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.jx-joueur { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; min-width: 0; }
.jx-joueur--absent { opacity: 0.55; }
.jx-joueur-pseudo { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.jx-joueur-etiquettes { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; }
.jx-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.jx-avatar--lettre { display: inline-flex; align-items: center; justify-content: center; background: rgba(var(--fg-rgb), 0.14); font-weight: 700; }

/* Tribunal */
.jx-tribunal { display: flex; flex-direction: column; gap: 0.85rem; }
.jx-tribunal-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.jx-tribunal-entete h2 { margin: 0; }
.jx-tribunal > p { margin: 0; }
.jx-ajout { align-items: stretch; }

.jx-dossier {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 0.95rem;
  border-radius: 10px;
  border: 1px solid rgba(var(--fg-rgb), 0.12);
  background: rgba(var(--fg-rgb), 0.03);
}
.jx-dossier--moi { border-color: var(--accent); }
.jx-dossier-entete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.jx-dossier .jx-champ { margin: 0; }
.jx-dossier > p { margin: 0; }
.jx-outils-hote { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed rgba(var(--fg-rgb), 0.14); }

.jx-excuses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.jx-excuse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(var(--fg-rgb), 0.1);
  background: var(--panel);
}
.jx-excuse-texte { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.jx-excuse-pied { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.86rem; }
.jx-excuse--gagnante { border-color: var(--vis-ami); }
.jx-excuse--choisie { border-color: var(--vis-public); }
.jx-verite { margin: 0; padding: 0.5rem 0.75rem; border-left: 3px solid var(--accent); background: rgba(var(--fg-rgb), 0.04); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }

.jx-classement { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.jx-classement-ligne { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.7rem; border-radius: 8px; background: rgba(var(--fg-rgb), 0.04); }
.jx-classement-ligne--moi { outline: 1px solid var(--accent); }
.jx-rang { width: 2rem; text-align: center; font-weight: 700; }
.jx-classement-pseudo { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.jx-classement-score { white-space: nowrap; }

/* ---------- Soirée Flash (micro-jeux) — classes jxf-… ---------- */
.jx-page--etroite { max-width: 44rem; }
.jx-flash { display: flex; flex-direction: column; gap: 0.75rem; }
.jx-flash > p, .jxf-contenu > p { margin: 0; }
.jxf-contenu { display: flex; flex-direction: column; gap: 0.6rem; }
.jxf-consigne { font-weight: 600; text-align: center; }
.jxf-decompte { font-size: 4.5rem; font-weight: 800; text-align: center; line-height: 1.2; color: var(--accent); }
.jxf-contenu > .jx-discret { text-align: center; }

.jxf-barre { height: 8px; border-radius: 999px; background: rgba(var(--fg-rgb), 0.12); overflow: hidden; }
.jxf-barre-niveau { height: 100%; width: 100%; background: var(--accent); }

.jxf-arene {
  position: relative;
  height: 290px;
  border-radius: 12px;
  border: 1px solid rgba(var(--fg-rgb), 0.14);
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.75rem;
  box-sizing: border-box;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.jxf-score-final { font-size: 2.4rem; font-weight: 800; text-align: center; }
.jxf-score-info { color: var(--muted); font-size: 1.1rem; }
.jxf-carres { font-size: 1.8rem; letter-spacing: 0.15em; text-align: center; }
.jxf-detail { margin: 0; padding-left: 1.3rem; color: var(--muted); font-size: 0.94rem; }

/* Réflexe */
.jxf-reflexe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; font: inherit; font-size: 2rem; font-weight: 800; cursor: pointer;
  background: rgba(var(--fg-rgb), 0.08); color: var(--text);
}
.jxf-reflexe--attente { background: var(--vis-prive); color: #1a0505; }
.jxf-reflexe--go { background: var(--vis-public); color: #04170a; }
.jxf-reflexe--rate { background: var(--vis-ami); color: #1d1002; }

/* Cibles */
.jxf-arene--cibles { cursor: crosshair; }
.jxf-cible {
  position: absolute; transform: translate(-50%, -50%);
  width: 78px; height: 78px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 4px solid var(--text);
  background: radial-gradient(circle, var(--vis-prive) 0 28%, var(--bg) 29% 52%, var(--vis-prive) 53% 100%);
}

/* Mémoire */
.jxf-memoire-message { margin: 0; font-weight: 700; min-height: 1.4em; }
.jxf-memoire { display: grid; grid-template-columns: repeat(2, 92px); gap: 0.6rem; }
.jxf-memoire--erreur { animation: jxf-secousse 0.3s; }
.jxf-pave {
  height: 92px; border-radius: 14px; border: 3px solid transparent; cursor: pointer;
  font-size: 2.2rem; color: #0b0f14; opacity: 0.45; transition: opacity 0.08s, transform 0.08s;
}
.jxf-pave--0 { background: var(--vis-prive); }
.jxf-pave--1 { background: var(--vis-public); }
.jxf-pave--2 { background: var(--accent); }
.jxf-pave--3 { background: var(--vis-ami); }
.jxf-pave--allume { opacity: 1; transform: scale(1.07); border-color: var(--text); }

/* Chrono */
.jxf-chrono-cible { margin: 0; font-size: 1.2rem; font-weight: 700; }
.jxf-chrono-cadran { font-family: ui-monospace, Consolas, monospace; font-size: 3.4rem; font-weight: 800; }

/* Tri */
.jxf-tri-objet { font-size: 5rem; line-height: 1.1; }
.jxf-tri-objet--erreur { animation: jxf-secousse 0.3s; filter: grayscale(1); }
.jxf-tri-boutons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

@keyframes jxf-secousse {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .jxf-memoire--erreur, .jxf-tri-objet--erreur { animation: none; }
}

/* Tableau des scores */
.jxf-table td, .jxf-table th { text-align: right; }
.jxf-table td:nth-child(2), .jxf-table th:nth-child(2) { text-align: left; }
.jxf-col-actuelle { color: var(--accent); }
.jxf-ligne-moi td { background: rgba(var(--fg-rgb), 0.06); }
.jxf-total { font-weight: 800; }

/* ---------- Tier List Clash — classes jxt-… ---------- */
.jx-tierlist { display: flex; flex-direction: column; gap: 0.75rem; }
.jx-tierlist > p { margin: 0; }
.jxt-theme { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 1.1rem; }
.jxt-perso { display: flex; flex-direction: column; gap: 0.5rem; }
.jxt-perso[hidden] { display: none; }

.jxt-elements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.jxt-element {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem;
  padding: 0.45rem 0.65rem; border-radius: 8px;
  border: 1px solid rgba(var(--fg-rgb), 0.1); background: rgba(var(--fg-rgb), 0.03);
}
.jxt-element--classe { border-color: rgba(var(--fg-rgb), 0.28); }
.jxt-nom { flex: 1 1 9rem; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.jxt-choix { display: flex; gap: 0.3rem; }

/* Pastille de tier : couleurs fixes (les mêmes dans les deux thèmes), texte foncé. */
.jxt-tier {
  --jxt: #9aa6b2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem; padding: 0; border-radius: 8px;
  border: 2px solid var(--jxt); background: transparent; color: var(--text);
  font: inherit; font-weight: 800; cursor: pointer;
}
.jxt-tier--S { --jxt: #ff6b6b; }
.jxt-tier--A { --jxt: #ffa24d; }
.jxt-tier--B { --jxt: #ffd84d; }
.jxt-tier--C { --jxt: #7ddc6a; }
.jxt-tier--D { --jxt: #5cb8ff; }
.jxt-tier--F { --jxt: #a9a9b8; }
.jxt-tier--actif, .jxt-tier--etiquette { background: var(--jxt); color: #111417; }
button.jxt-tier:hover, button.jxt-tier:focus-visible { background: var(--jxt); color: #111417; outline: none; }
.jxt-tier--etiquette { cursor: default; flex: 0 0 auto; width: 2.6rem; height: auto; min-height: 2.6rem; align-self: stretch; }

.jxt-tableau { display: flex; flex-direction: column; gap: 0.3rem; }
.jxt-rangee { display: flex; gap: 0.5rem; align-items: stretch; background: rgba(var(--fg-rgb), 0.04); border-radius: 8px; }
.jxt-rangee-elements { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; padding: 0.35rem 0.35rem 0.35rem 0; min-width: 0; }
.jxt-case {
  padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.92rem; overflow-wrap: anywhere;
  border: 1px solid rgba(var(--fg-rgb), 0.16); background: var(--panel);
}
.jxt-case--desaccord { border-style: dashed; }
.jxt-rebelle { margin-left: 0.4rem; }
@media (max-width: 480px) {
  .jxt-tier { width: 2.05rem; height: 2.05rem; }
  .jxt-choix { gap: 0.2rem; }
}

/* ---------- Pixel Téléphone — classes jxp-… ---------- */
.jx-pixel { display: flex; flex-direction: column; gap: 0.75rem; }
.jx-pixel > p { margin: 0; }
.jxp-etape { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 1.05rem; }
.jxp-modele { margin: 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--accent); background: rgba(var(--fg-rgb), 0.04); border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.jxp-modele p { margin: 0 0 0.5rem; }

/* Un dessin est un canvas de 16×16 pixels agrandi sans lissage. */
.jxp-dessin {
  width: 96px; height: 96px; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
  border: 2px solid rgba(var(--fg-rgb), 0.3); border-radius: 6px; background: #f6f2e6;
}
.jxp-dessin--grand { width: 176px; height: 176px; }
.jxp-dessin--edition {
  width: min(100%, 352px); height: auto; aspect-ratio: 1 / 1;
  cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none;
}
.jxp-editeur { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-start; }
.jxp-outils { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; max-width: 14rem; }
.jxp-couleur {
  width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; cursor: pointer;
  border: 3px solid rgba(var(--fg-rgb), 0.3);
}
.jxp-couleur--active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--fg-rgb), 0.25); transform: scale(1.08); }

.jxp-chaine { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch; }
.jxp-etape-revelee {
  display: flex; flex-direction: column; justify-content: space-between; gap: 0.5rem;
  padding: 0.6rem 0.7rem; border-radius: 8px; max-width: 100%;
  border: 1px solid rgba(var(--fg-rgb), 0.1); background: var(--panel);
}
.jxp-etape-revelee--texte { flex: 1 1 11rem; max-width: 18rem; }
.jxp-etape-revelee .jx-excuse-texte { flex: 0 0 auto; font-size: 1.05rem; font-weight: 600; }

/* ---------- Le Placard à jeux (quiz) — classes jxq-… ---------- */
.jx-placard { display: flex; flex-direction: column; gap: 0.75rem; }
.jx-placard > p { margin: 0; }
.jxq-question { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 1.15rem; font-weight: 700; }
.jxq-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.6rem; }
.jxq-proposition { padding: 0.9rem 1rem; font-size: 1.02rem; text-align: center; overflow-wrap: anywhere; }
.jxq-proposition:disabled { cursor: default; opacity: 0.75; }
.jxq-proposition--mienne { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); opacity: 1 !important; }
.jxq-proposition--bonne { border-color: var(--vis-public); box-shadow: inset 0 0 0 2px var(--vis-public); opacity: 1 !important; }
.jxq-proposition--fausse { border-color: var(--vis-prive); box-shadow: inset 0 0 0 2px var(--vis-prive); }
.jxq-fait { padding: 0.55rem 0.8rem; border-left: 3px solid var(--vis-ami); background: rgba(var(--fg-rgb), 0.04); border-radius: 0 8px 8px 0; font-weight: 600; }
.jxq-recap { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: 0.4rem; }

/* ---------- Tribunal : « Les Paris sont ouverts » ---------- */
.jx-paris { gap: 0.4rem 0.6rem; margin: 0; }
.jx-pari-minutes { width: 4.5rem; }

/* Mode streameur : code et lien du salon masqués, boutons à icône (coller, copier, afficher). */
.jx-btn-ico { padding: 0.35rem; min-width: 2.1rem; min-height: 2.1rem; justify-content: center; }
.jx-ico { display: inline-block; width: 1.15rem; height: 1.15rem; background: currentColor;
  -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; }
.jx-ico--copier { -webkit-mask-image: url(../../icons/jx_copier.svg); mask-image: url(../../icons/jx_copier.svg); }
.jx-ico--coller { -webkit-mask-image: url(../../icons/jx_coller.svg); mask-image: url(../../icons/jx_coller.svg); }
.jx-ico--oeil { -webkit-mask-image: url(../../icons/jx_oeil.svg); mask-image: url(../../icons/jx_oeil.svg); }
.jx-ico--oeil-barre { -webkit-mask-image: url(../../icons/jx_oeil_barre.svg); mask-image: url(../../icons/jx_oeil_barre.svg); }
.jx-btn-ico.jx-fait .jx-ico { display: none; }
.jx-btn-ico.jx-fait::after { content: "\2713"; font-weight: 700; line-height: 1; }
.jx-secret { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.jx-secret + .jx-secret { margin-top: 0.4rem; }
.jx-secret .jx-titre, .jx-secret .jx-lien-salon { margin: 0; }
.jx-secret .jx-lien-salon { min-width: 0; }
.jx-code-ligne { display: flex; align-items: center; gap: 0.4rem; }
.jx-code-ligne .jx-code-saisie { flex: 0 1 11rem; min-width: 0; }
