/**------- Structure commune des écrans de l'application. Aucune couleur ici : chaque proposition fournit ses jetons dans sa feuille de thème -------*/
.app {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-corps);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

/**------- :where garde ces remises à zéro sans poids, pour que n'importe quelle classe de composant les batte -------*/
:where(.app) *, :where(.app) *::before, :where(.app) *::after { box-sizing: border-box; }

:where(.app) button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:where(.app) h1, :where(.app) h2, :where(.app) p { margin: 0; }

.app img {
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
}

.app svg { display: block; flex: none; }

.app :focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

.contenu {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 20px 20px;
}

.pied {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px 22px;
}

/**------- Barre du haut : la roue dentée reste toujours à droite -------*/
.barre {
  flex: none;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px 16px 8px;
}

.barre--profil { grid-template-columns: minmax(0, 1fr) 0 44px; gap: 0 10px; }

.barre__titre {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: center;
}

.barre__nom {
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  font-size: 17px;
  line-height: 1.15;
}

.barre__sous { font-size: 12.5px; color: var(--doux); }

.rond {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: var(--bord) solid var(--trait);
}

.rond svg { width: 22px; height: 22px; }

.profil {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profil__pastille {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--sur-accent);
  font-family: var(--police-titre);
  font-weight: 800;
  font-size: 20px;
}

.profil__texte { display: flex; flex-direction: column; min-width: 0; }
.profil__nom { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profil__niveau { font-size: 12.5px; color: var(--doux); }

/**------- Textes -------*/
.titre {
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  font-size: 28px;
  line-height: 1.1;
  text-wrap: balance;
}

.sous-titre { font-size: 14px; color: var(--doux); }

.note {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--doux);
}

.note--centre { text-align: center; }

.note--encadre {
  padding: 12px 14px;
  border-radius: var(--rayon);
  border: var(--bord) dashed var(--trait);
}

/**------- Boutons -------*/
.bouton {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-radius: var(--rayon-bouton);
  background: var(--accent);
  color: var(--sur-accent);
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 17px;
  text-align: center;
}

.bouton svg { width: 22px; height: 22px; }

.bouton--second {
  background: transparent;
  color: var(--texte);
  border: 2px solid var(--trait-fort);
}

.bouton--petit {
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14.5px;
}

.bouton--petit svg { width: 18px; height: 18px; }

/**------- Compte -------*/
.accueil {
  position: relative;
  flex: 1 1 36%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 20px 14px;
  text-align: center;
}

.accueil__image {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--police-titre);
  line-height: 0.9;
}

.logo__ra { font-size: 64px; font-weight: 800; }
.logo__games { font-size: 20px; font-weight: 700; letter-spacing: 0.42em; margin-right: -0.42em; }

.accueil__phrase {
  margin-top: 10px;
  font-size: 14px;
  color: var(--doux);
  text-wrap: balance;
}

.compte { flex: none; gap: 12px; padding-top: 16px; }

.etiquette { font-weight: 600; font-size: 14px; }

.champ {
  flex: none;
  display: flex;
  align-items: center;
  border-radius: var(--rayon);
  background: var(--champ-fond);
  border: 2px solid var(--trait-fort);
}

.champ input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
}

.champ:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

.champ__etat { width: 44px; display: grid; place-items: center; }
.champ__etat svg { width: 22px; height: 22px; }

.champ--libre { border-color: var(--ok); }
.champ--libre .champ__etat { color: var(--ok); }
.champ--pris, .champ--manquant { border-color: var(--danger); }
.champ--pris .champ__etat { color: var(--danger); }

.champ__message {
  min-height: 18px;
  margin-top: -4px;
  font-size: 13px;
  font-weight: 600;
}

.champ--libre + .champ__message { color: var(--ok); }
.champ--pris + .champ__message, .champ--manquant + .champ__message { color: var(--danger); }

.ou {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--doux);
}

.ou::before, .ou::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--trait);
}

/**------- Choix du jeu -------*/
.jeux {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.jeu {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: var(--bord) solid var(--trait);
}

.jeu__signe { display: none; }

.jeu__image {
  position: relative;
  flex: 0 0 44%;
  align-self: stretch;
}

.jeu__texte {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.jeu__nom {
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  font-size: 26px;
  line-height: 1;
}

.jeu__sous { font-size: 12.5px; color: var(--doux); text-wrap: balance; }

/**------- Les cartes et les dominos sont posés en éventail dans leur cadre -------*/
.visuel { position: absolute; inset: 0; display: block; }

.visuel img {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 66%;
  width: auto;
  border-radius: 7px;
  box-shadow: var(--ombre-carte);
}

/**------- Éventail d'une main : la carte de droite recouvre celle de gauche, dont l'indice reste lisible -------*/
.visuel--gwinch img { height: 62%; }
.visuel--gwinch img:nth-child(1) { transform: translate(-90%, -52%) rotate(-8deg); }
.visuel--gwinch img:nth-child(2) { transform: translate(-16%, -47%) rotate(7deg); }
.visuel--tafaron img { height: 84%; transform: translate(-50%, -50%) rotate(-5deg); }

.visuel--domino img { height: 58%; border-radius: 9px; }
.visuel--domino img:nth-child(1) { transform: translate(-128%, -48%) rotate(-12deg); }
.visuel--domino img:nth-child(2) { z-index: 1; transform: translate(-50%, -57%) rotate(3deg); }
.visuel--domino img:nth-child(3) { transform: translate(28%, -46%) rotate(14deg); }

/**------- Joindre ou créer -------*/
.mode { gap: 18px; }

.mode__image {
  position: relative;
  flex: 1 1 0;
  min-height: 160px;
}

/**------- Le cadre grandit avec l'écran, pas les cartes : au-delà, l'éventail sortirait par les côtés -------*/
.mode__image .visuel img { height: 70%; max-height: 250px; }
.mode__image .visuel--tafaron img { height: 84%; max-height: 290px; }
.mode__image .visuel--domino img { height: 58%; max-height: 200px; }

.mode__titres {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.choix {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choix__bouton {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 76px;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--rayon-bouton);
}

.choix__bouton--joindre { background: var(--accent); color: var(--sur-accent); }
.choix__bouton--creer { border: 2px solid var(--trait-fort); }

.choix__nom {
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
}

.choix__detail { font-size: 13px; opacity: 0.88; }

/**------- Créer une partie -------*/
.groupe {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.groupe__titre { font-weight: 600; font-size: 14px; }

.segments { display: grid; gap: 8px; }
.segments--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segments--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.segment {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: 2px solid var(--trait);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
}

.segments--2 .segment { min-height: 92px; }

.segment svg { width: 20px; height: 20px; margin-bottom: 2px; }
.segment small { font-weight: 500; font-size: 12px; color: var(--doux); }

.segment.est-choisi {
  background: var(--choisi-fond);
  color: var(--choisi-texte);
  border-color: var(--choisi-trait);
}

.segment.est-choisi small { color: inherit; opacity: 0.85; }

.code-partie {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: var(--bord) dashed var(--trait-fort);
}

.code-partie__titre { font-size: 13px; font-weight: 600; color: var(--doux); }

.chiffres { display: flex; gap: 8px; }

.chiffres span {
  width: 48px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--chiffre-fond);
  color: var(--chiffre-texte);
  font-family: var(--police-corps);
  font-weight: 800;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

/**------- Parties à joindre -------*/
.parties {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.partie {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: var(--bord) solid var(--trait);
}

.partie__avatar {
  width: 52px;
  height: 52px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: var(--cam-rayon);
  background: var(--cam-fond);
}

.partie__avatar img { width: 100%; height: 100%; object-fit: cover; }

.partie__initiale {
  font-family: var(--police-corps);
  font-weight: 800;
  font-size: 22px;
  color: var(--cam-texte);
}

.partie__texte { min-width: 0; }

/**------- Le numéro de la table, en haut de sa tuile : c'est par lui qu'on la désigne -------*/
.partie__numero {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--doux);
}

.partie__nom {
  display: block;
  font-family: var(--police-titre);
  font-weight: 700;
  font-size: 16.5px;
  line-height: 1.15;
}

.partie__infos {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--doux);
}

.partie__temps, .partie__acces { display: inline-flex; align-items: center; gap: 4px; }
.partie__infos svg { width: 14px; height: 14px; }
.partie--privee .partie__acces { color: var(--accent-texte); font-weight: 700; }

.partie__places {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.pions { display: flex; gap: 3px; }

.pions i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.pions i.est-pris { background: currentColor; }

/**------- Code d'une partie privée -------*/
.code { align-items: center; gap: 12px; text-align: center; }

.code__cadenas {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: var(--bord) solid var(--trait);
}

.code__cadenas svg { width: 26px; height: 26px; }

.saisie { flex: none; display: flex; gap: 10px; margin-top: 6px; }

.saisie span {
  width: 54px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--champ-fond);
  border: 2px solid var(--trait-fort);
  font-family: var(--police-corps);
  font-weight: 800;
  font-size: 32px;
  font-variant-numeric: tabular-nums;
}

.saisie span.est-courant { box-shadow: 0 0 0 4px var(--halo); }
.saisie--faux span { border-color: var(--danger); }

.erreur {
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.clavier {
  width: 100%;
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.touche {
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--rayon);
  background: var(--surface);
  border: var(--bord) solid var(--trait);
  font-family: var(--police-corps);
  font-weight: 700;
  font-size: 22px;
}

.touche svg { width: 24px; height: 24px; }
.touche--vide { visibility: hidden; }

/**------- Caméra et micro avant d'entrer -------*/
.apercu {
  position: relative;
  flex: 1 1 0;
  min-height: 180px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: var(--rayon-grand);
  background: var(--cam-fond);
}

.apercu img { width: 100%; height: 100%; object-fit: cover; }

.apercu__coupee {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--cam-texte);
}

.apercu__coupee svg { width: 40px; height: 40px; }

.apercu__nom {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
}

.bascules {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bascule {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--rayon);
  background: var(--surface);
  border: 2px solid var(--trait);
}

.bascule svg { width: 24px; height: 24px; }
.bascule__texte { display: flex; flex-direction: column; }
.bascule__nom { font-weight: 700; font-size: 15px; }
.bascule__etat { font-size: 12px; color: var(--doux); }

.bascule.est-active {
  background: var(--choisi-fond);
  color: var(--choisi-texte);
  border-color: var(--choisi-trait);
}

.bascule.est-active .bascule__etat { color: inherit; opacity: 0.85; }

/**------- Table : quatre sièges, un par côté du téléphone -------*/
.table {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 6px 14px 0;
}

.table__tapis {
  position: absolute;
  inset: 62px 58px;
  display: grid;
  place-items: center;
  border-radius: var(--table-rayon);
  background: var(--table-fond);
  border: var(--table-bord);
  box-shadow: var(--table-ombre);
  color: var(--table-texte);
}

.table__centre {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 10px;
  text-align: center;
}

/**------- Le code se range dans le haut du tapis : au milieu, il toucherait les sièges de gauche et de droite -------*/
.table__centre--haut { align-self: start; margin-top: 76px; }

.table__jeu {
  max-width: 140px;
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  font-size: 20px;
  line-height: 1.1;
}

.table__info { font-size: 12.5px; font-weight: 600; opacity: 0.9; }

.table .chiffres { gap: 5px; }
.table .chiffres span { width: 36px; height: 46px; border-radius: 8px; font-size: 25px; }

.table__partage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  font-weight: 700;
  font-size: 13px;
}

.table__partage svg { width: 16px; height: 16px; }

.table__paquet img {
  width: 62px;
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25), var(--ombre-carte);
  transform: rotate(-6deg);
}

.siege {
  position: absolute;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.siege--haut { top: 0; left: 50%; transform: translateX(-50%); }
.siege--bas { bottom: 0; left: 50%; transform: translateX(-50%); }
.siege--gauche { left: 0; top: 50%; transform: translateY(-50%); }
.siege--droite { right: 0; top: 50%; transform: translateY(-50%); }

.cam {
  position: relative;
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cam__image {
  width: 88px;
  height: 88px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: var(--cam-rayon);
  background: var(--cam-fond);
  border: var(--cam-bord);
  box-shadow: var(--cam-ombre);
}

.cam__image img { width: 100%; height: 100%; object-fit: cover; }

.cam__initiale {
  font-family: var(--police-corps);
  font-weight: 800;
  font-size: 34px;
  color: var(--cam-texte);
}

.cam--robot .cam__image svg { width: 44px; height: 44px; color: var(--cam-texte); }

.cam__nom {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--etiquette-fond);
  color: var(--etiquette-texte);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cam__micro {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coupe-fond);
  color: #FFFFFF;
}

.cam__micro svg { width: 14px; height: 14px; }

/**------- Contrat de la main : les points annoncés et l'atout, sous le nom du preneur -------*/
.cam__contrat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--etiquette-fond);
  color: var(--etiquette-texte);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.cam__contrat svg { width: 15px; height: 15px; }

.siege__libre {
  width: 88px;
  height: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--cam-rayon);
  background: var(--libre-fond);
  border: 2px dashed var(--trait-fort);
  color: var(--texte);
  font-size: 12px;
  font-weight: 700;
}

.siege__libre svg { width: 22px; height: 22px; }

/**------- Table en jeu : la main et la barre du joueur passent sous la table, le tapis garde toute sa zone -------*/
/**------- Le haut du tapis est réservé au siège du haut, qui mord dessus ; le tapis se mesure lui-même pour que le pli en cours s'ajuste à la place qui reste -------*/
/**------- --reserve-haut : la part du tapis que recouvre le siège du haut. Elle grandit quand ce siège porte le contrat sous son nom -------*/
.ecran--pret .table { --reserve-haut: 50px; }
.ecran--pret .table:has(.siege--haut .cam__contrat) { --reserve-haut: 84px; }
.ecran--pret .table__tapis { bottom: 6px; padding-top: var(--reserve-haut); container-type: size; }
.ecran--pret .siege--gauche, .ecran--pret .siege--droite { top: calc(50% + 28px + var(--reserve-haut) / 2); }

/**------- Barre du joueur, sous sa main : sa caméra en petit, le micro et la caméra, puis les plis de la manche -------*/
.pied--jeu {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 14px;
}

.pied__moi { flex: none; display: flex; justify-content: center; min-width: 72px; }
.pied__moi .cam { --cam-l: 48px; width: 48px; }
.pied__moi .cam__image { width: 48px; height: 48px; }
/**------- Le pseudo déborde de la petite vignette plutôt que d'être coupé -------*/
.pied__moi .cam__nom { max-width: 76px; padding-left: 5px; padding-right: 5px; }

.pied__voix { flex: none; display: flex; gap: 8px; }
.pied--jeu .score { margin-left: auto; }

.main {
  --carte-l: 86px;
  flex: none;
  display: flex;
  margin: 8px 8px 0;
}

/**------- Chaque carte n'occupe qu'un pas et déborde sur la suivante : seul son bord gauche reste visible. La dernière est entière -------*/
.main__carte { flex: 1 1 0; min-width: 0; }
.main__carte:last-child { flex: 0 0 var(--carte-l); }

.main__carte img {
  display: block;
  width: var(--carte-l);
  max-width: none;
}

/**------- Pli en cours : une carte par côté, tirée vers le joueur qui l'a posée. Celles de gauche et de droite laissent un passage au milieu, celles du haut et du bas les recouvrent un peu, comme sur une vraie table -------*/
.pose {
  --pose-l: 68px;
  position: relative;
  width: calc(var(--pose-l) * 2.58);
  height: calc(var(--pose-l) * 3);
}

/**------- Sur un écran court ou étroit, la carte rétrécit : elle ne passe ni sous le siège du haut ni sous ceux des côtés -------*/
@supports (width: 1cqh) {
  .pose { --pose-l: min(68px, (100cqh - 24px) / 3, (100cqw - 64px) / 2.58); }
}

.pose__carte { position: absolute; width: var(--pose-l); }
.pose__carte img { display: block; width: 100%; }
.pose__carte--haut { top: 0; left: 50%; transform: translateX(-50%); }
.pose__carte--bas { bottom: 0; left: 50%; transform: translateX(-50%); }
.pose__carte--gauche { left: 0; top: 50%; transform: translateY(-50%); }
.pose__carte--droite { right: 0; top: 50%; transform: translateY(-50%); }

/**------- Domino : sept pièces debout, côte à côte. Elles ne se recouvrent pas, chacune se lit en entier -------*/
.main--domino { justify-content: center; gap: 6px; }
.main__piece { flex: 0 1 48px; min-width: 0; }
.main__piece img { display: block; width: 100%; }

/**------- Domino : la chaîne posée au centre. Une pièce couchée fait deux fois sa largeur ; un double se pose en travers, debout -------*/
.chaine {
  --d: 22px;
  display: flex;
  align-items: center;
  gap: 2px;
}

/**------- La chaîne d'exemple mesure huit largeurs de pièce : elle rétrécit pour tenir entre les sièges de côté -------*/
@supports (width: 1cqw) {
  .chaine { --d: min(22px, (100cqw - 72px) / 8); }
}

.chaine__piece { position: relative; flex: none; width: calc(var(--d) * 2); height: var(--d); }
.chaine__piece--debout { width: var(--d); height: calc(var(--d) * 2); }

/**------- L'image est toujours debout : couchée, elle tourne autour de son centre dans une case deux fois plus large que haute -------*/
.chaine__piece img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--d);
  height: calc(var(--d) * 2);
  max-width: none;
  transform: translate(-50%, -50%);
}

.chaine__piece--gauche img { transform: translate(-50%, -50%) rotate(-90deg); }
.chaine__piece--droite img { transform: translate(-50%, -50%) rotate(90deg); }

.pied--jeu .vocal { justify-content: flex-end; text-align: right; }

/**------- Dernier pli : au-dessus du tapis, dans le coin gauche que le siège du haut laisse libre ; le score global occupe le coin droit -------*/
.pli {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.pli__titre, .score__titre {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--etiquette-fond);
  color: var(--etiquette-texte);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

/**------- Quatre cartes entières dans un carré, à la place de leur joueur : gauche et droite à mi-hauteur, haut et bas dans la colonne du milieu -------*/
.pli__cartes { position: relative; width: 73px; height: 72px; }

.pli__carte {
  position: absolute;
  width: 23px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}

.pli__carte--haut { top: 0; left: 25px; }
.pli__carte--bas { top: 38px; left: 25px; }
.pli__carte--gauche { top: 19px; left: 0; }
.pli__carte--droite { top: 19px; left: 50px; }

.pli__signe { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pli__rang { font-size: 13px; font-weight: 800; line-height: 1; letter-spacing: -0.7px; }
.pli__carte svg { width: 11px; height: 11px; }

/**------- Scores : le global dans le coin haut droit de la table, les plis de la manche dans la barre du joueur -------*/
.score { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.score--global { position: absolute; z-index: 1; top: 0; right: 0; }
.score--plis { flex-direction: row; align-items: center; gap: 8px; }

.score__equipes { display: grid; gap: 4px; }

.score__case {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 86px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.score__valeur { font-weight: 800; font-variant-numeric: tabular-nums; }

/**------- Chacun pour soi : quatre scores rangés comme les joueurs autour de la table, celui du joueur en bas -------*/
.score__croix { position: relative; width: 98px; height: 68px; }

.score__croix .score__valeur {
  position: absolute;
  min-width: 38px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 13px;
}

.score__valeur--haut { top: 0; left: 50%; transform: translateX(-50%); }
.score__valeur--bas { bottom: 0; left: 50%; transform: translateX(-50%); }
.score__valeur--gauche { left: 0; top: 50%; transform: translateY(-50%); }
.score__valeur--droite { right: 0; top: 50%; transform: translateY(-50%); }

/**------- Minuterie : un anneau qui se vide autour de la caméra du joueur qui doit jouer, sans chiffre. La propriété est déclarée comme un nombre, sans quoi elle ne s'anime pas -------*/
@property --reste {
  syntax: '<number>';
  inherits: true;
  initial-value: 100;
}

.cam__minuterie {
  position: absolute;
  top: -8px;
  left: 50%;
  width: calc(var(--cam-l, 88px) + 16px);
  height: calc(var(--cam-l, 88px) + 16px);
  transform: translateX(-50%);
  border-radius: 18px;
  animation: minuterie var(--minuterie-duree, 15s) linear infinite;
  pointer-events: none;
}

/**------- Deux anneaux découpés par masque : le cerne, puis par-dessus la part de temps qui reste -------*/
.cam__minuterie::before, .cam__minuterie::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.cam__minuterie::before { inset: 0; padding: 8px; background: var(--minuterie-cerne, #161616); }

.cam__minuterie::after {
  inset: 2px;
  padding: 4px;
  background: conic-gradient(var(--minuterie-reste, #E8362B) calc(var(--reste) * 1%), var(--minuterie-vide, #FFFFFF) 0);
}

@keyframes minuterie {
  from { --reste: 100; }
  to { --reste: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cam__minuterie { animation: none; --reste: 65; }
}

.pied--table { gap: 12px; }

.commandes { display: flex; align-items: center; gap: 10px; }

.vocal {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--doux);
}

.vocal svg { width: 18px; height: 18px; }

.commande {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: var(--bord) solid var(--trait);
}

.commande svg { width: 22px; height: 22px; }

.commande.est-coupe {
  background: var(--coupe-fond);
  border-color: transparent;
  color: #FFFFFF;
}

.attente {
  min-height: 54px;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-wrap: balance;
}

/**------- Publicité vidéo : identique dans les trois propositions, c'est la régie qui dessine cet écran -------*/
.ecran--pub {
  justify-content: center;
  background: #000000;
  color: #FFFFFF;
}

.pub {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.pub__video {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 10px;
  background: #111111;
}

.pub__video img { width: 100%; height: 100%; object-fit: cover; }

.pub__etiquette {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.pub__barre {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.28);
}

.pub__barre i { display: block; height: 100%; background: #FFFFFF; }

.pub__texte { font-size: 17px; font-weight: 600; }
.pub__texte b { font-variant-numeric: tabular-nums; }
.pub__note { font-size: 13px; color: #C9C9C9; }

/**------- Feuille des réglages -------*/
.voile {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.55);
}

.feuille {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px 26px;
  border-radius: 24px 24px 0 0;
  background: var(--feuille-fond);
  color: var(--texte);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
}

.feuille__tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feuille__tete h2 {
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  font-size: 22px;
}

.ligne {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding-top: 10px;
  border-top: 1px solid var(--trait);
}

.ligne--bloc { flex-direction: column; align-items: stretch; gap: 8px; padding-top: 14px; }

.ligne__texte {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.ligne__texte svg { width: 22px; height: 22px; }
.ligne__texte--ok { color: var(--ok); }

.interrupteur {
  position: relative;
  flex: none;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: var(--inter-fond);
}

.interrupteur::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.interrupteur.est-actif { background: var(--inter-actif); }
.interrupteur.est-actif::after { transform: translateX(22px); }

.toast {
  position: absolute;
  top: 78px;
  left: 20px;
  right: 20px;
  z-index: 8;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--toast-fond);
  color: var(--toast-texte);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: no-preference) {
  .interrupteur::after { transition: transform 0.15s ease; }
  .toast { animation: toast-arrive 0.2s ease-out; }
}

@keyframes toast-arrive {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/**------- Deux boutons à droite de la barre (le son ou l'invitation, puis la roue) : la colonne de gauche s'élargit d'autant, le titre reste au milieu -------*/
.barre__droite { display: flex; justify-content: flex-end; gap: 8px; }
.barre--deux { grid-template-columns: 96px minmax(0, 1fr) 96px; }
.barre--profil.barre--deux { grid-template-columns: minmax(0, 1fr) 0 96px; }

/**------- Avant d'entrer sans compte : l'avertissement en grand, puis les conditions qui défilent dans leur cadre -------*/
.conditions { gap: 14px; min-height: 0; padding-top: 18px; }

.conditions__alerte {
  padding: 14px 16px;
  border: var(--bord) solid var(--encre);
  border-radius: 18px;
  background: var(--recit);
  box-shadow: 4px 4px 0 var(--encre);
  color: var(--encre);
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  font-size: 19px;
  line-height: 1.25;
  text-wrap: balance;
}

.conditions__texte {
  flex: 1;
  min-height: 110px;
  overflow-y: auto;
  padding: 14px 16px;
  border: var(--bord) solid var(--trait);
  border-radius: 18px;
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.45;
}

.conditions__chapeau {
  margin: 0 0 4px;
  font-family: var(--police-titre);
  font-weight: var(--graisse-titre);
  font-size: 19px;
}

.conditions__titre { margin: 14px 0 4px; font-size: 15.5px; font-weight: 700; }
.conditions__texte p { margin: 0 0 6px; }
.conditions__pied { margin-top: 14px; font-size: 12px; color: var(--doux); }

/**------- Écran de connexion : l'œil du mot de passe, « Se souvenir de moi », puis les autres portes -------*/
.champ__oeil {
  width: 46px;
  display: grid;
  place-items: center;
  color: var(--texte);
}

.champ__oeil svg { width: 22px; height: 22px; }

.souvenir {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 2px;
  color: var(--texte);
  font-weight: 700;
  font-size: 14.5px;
}

.souvenir__case {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: var(--bord) solid var(--trait);
  border-radius: 6px;
  background: var(--surface);
}

.souvenir[aria-checked="true"] .souvenir__case { background: var(--recit); }
.souvenir__case svg { width: 14px; height: 14px; stroke-width: 3.5; }

.ou {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  color: var(--doux);
  font-weight: 700;
  font-size: 13px;
}

.ou::before, .ou::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--trait);
  opacity: 0.3;
}

/**------- Deux boutons de même largeur et de même hauteur. Leur géométrie est celle que Google publie pour le sien (40 de haut, coins de 4, logo de 20 à 12 du bord, 10 avant le texte) : une charte ne se met pas au thème -------*/
.tiers { display: flex; flex-direction: column; gap: 10px; }

.tiers__bouton {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 4px;
  font-family: var(--police-corps);
  font-weight: 700;
  font-size: 15px;
  line-height: 20px;
}

.tiers__bouton svg, .tiers__bouton img { flex: none; width: 20px; height: 20px; }
.tiers__bouton--maison { background: var(--btn); color: #FFFFFF; border: 2px solid var(--encre); }

.tiers__bouton--google {
  padding: 0 11px;
  border: 1px solid #747775;
  background: #FFFFFF;
  color: #1F1F1F;
  font-family: "Google Sans", Roboto, Arial, sans-serif;
  font-weight: 500;
  font-size: 14px;
}

.compte--connexion { gap: 8px; }

/**------- Les règles du mot de passe neuf : une carte au-dessus du champ, tant qu'il a la main et que tout n'est pas coché. Elle ne prend aucun toucher -------*/
.champ--mdp { position: relative; }

.bulle-mdp {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 4;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border: var(--bord) solid var(--encre);
  border-radius: 14px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  box-shadow: 3px 4px 0 var(--encre);
  pointer-events: none;
}

.champ--mdp:focus-within .bulle-mdp:not(.est-complete) { display: flex; }

.bulle-mdp__ligne { display: flex; align-items: center; gap: 8px; color: var(--encre); opacity: 0.62; }
.bulle-mdp__ligne::before { content: "\2022"; flex: none; width: 14px; font-weight: 800; text-align: center; }
.bulle-mdp__ligne.est-ok { color: var(--btn); opacity: 1; }
.bulle-mdp__ligne.est-ok::before { content: "\2713"; }

/**------- Le score des parties d'affilée, sous le nom de la table : plus petit que lui, sur deux lignes au plus quand les pseudos sont longs -------*/
.barre__serie { font-size: 12px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }

/**------- Liste des tables : le champ de recherche reste en haut, hors de la zone qui défile ; une table où l'on ne peut plus entrer s'efface un peu -------*/
.recherche { flex: none; padding: 0 20px 6px; }
.recherche .champ input { height: 44px; }
.partie--complete { opacity: 0.6; cursor: default; }

/**------- La marche à suivre pour rendre la caméra au jeu : la cause, puis des étapes numérotées -------*/
.aide__cause { margin: 0; font-weight: 700; }
.aide__etapes { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
