/* =====================================================================
   Typographe — styles propres au jeu (préfixe typ-)
   Atelier d'imprimerie : caractères en bois, marbre, encres, papier.
   La barre, le plein écran et les infobulles sont dans css/games.css.
   ===================================================================== */

.typ-jeu {
  --mg-jeu-largeur: 1204px; /* barre de 1180 px + marges de 12 px : ne pas changer */
  --mgb-fond: radial-gradient(120% 180% at 0% 0%, rgba(214, 74, 47, 0.28), transparent 55%),
    linear-gradient(120deg, #1c1916, #3a2e24);
  --mgb-accent: #d64a2f;
  --mgb-titre: linear-gradient(100deg, #fbf3df, #f2c14e);
  --mgb-police-titre: "Alfa Slab One", serif;
  --mgb-doux: #c9b89b;
  --mgb-texte: #fbf3df;
  --mg-stat-largeur: 4.5em;
  --mg-fs-fond: #1a1714;
  --mg-bulle-fond: #2a221b;

  --typ-papier: #fbf6ea;
  --typ-papier-2: #f1e8d3;
  --typ-encre: #231e19;
  --typ-doux: #7a6a55;
  --typ-filet: rgba(35, 30, 25, 0.14);
  --typ-vermillon: #d64a2f;
  --typ-bleu: #2d5f9a;
  --typ-vert: #2f7d5a;
  --typ-or: #c9972c;
  --typ-bois-1: #f6e4bd;
  --typ-bois-2: #dcb87e;
  --typ-case: 36px;
}

.typ-jeu [hidden] {
  display: none !important;
}

.typ-stat-table b {
  font-family: "Courier Prime", monospace;
  letter-spacing: 0.08em;
}

.typ-stat-tour {
  --mg-stat-largeur: 7.5em;
}

.typ-stat-tour b {
  display: block;
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Zone ---------- */
.typ-zone {
  position: relative;
  box-sizing: border-box;
  align-self: center;
  width: min(var(--mg-barre-largeur, 1180px), calc(100vw - 24px));
  font-family: "Outfit", sans-serif;
  color: var(--typ-encre);
}

.typ-jeu.mg-fs .typ-zone {
  align-self: stretch;
  width: auto;
  flex: 1;
  min-height: 0;
}

.typ-ecran {
  height: 100%;
  box-sizing: border-box;
}

/* Feuille de papier */
.typ-carton {
  position: relative;
  box-sizing: border-box;
  padding: 18px 20px;
  border-radius: 6px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(45, 95, 154, 0.05) 27px 28px),
    var(--typ-papier);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 14px 30px -18px rgba(35, 30, 25, 0.55), 0 0 0 1px rgba(35, 30, 25, 0.08);
}

.typ-carton h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: "Alfa Slab One", serif;
  font-weight: 400;
  font-size: 1.35em;
  color: var(--typ-encre);
  letter-spacing: 0.01em;
}

.typ-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--typ-vermillon);
  color: var(--typ-vermillon);
  font-size: 0.75em;
  transform: rotate(-8deg);
}

/* ---------- Boutons et champs ---------- */
.typ-bouton {
  margin: 0;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 8px;
  background: var(--typ-vermillon);
  color: #fff;
  font-family: "Alfa Slab One", serif;
  font-size: 1em;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 0 #8f2a17, 0 10px 18px -10px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s, box-shadow 0.1s, filter 0.2s;
}

.typ-bouton:hover:not(:disabled) {
  filter: brightness(1.08);
}

.typ-bouton:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8f2a17;
}

.typ-bouton:disabled {
  opacity: 0.45;
  cursor: default;
}

.typ-bouton-bleu {
  background: var(--typ-bleu);
  box-shadow: 0 4px 0 #1b3b63, 0 10px 18px -10px rgba(0, 0, 0, 0.5);
}

.typ-bouton-bleu:active:not(:disabled) {
  box-shadow: 0 1px 0 #1b3b63;
}

.typ-bouton-clair {
  background: var(--typ-papier-2);
  color: var(--typ-encre);
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  box-shadow: 0 3px 0 #c9b893, inset 0 0 0 1px rgba(35, 30, 25, 0.12);
}

.typ-bouton-clair:active:not(:disabled) {
  box-shadow: 0 1px 0 #c9b893;
}

.typ-champ {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 12px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--typ-doux);
}

.typ-champ input {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 12px;
  border: none;
  border-bottom: 2px solid var(--typ-encre);
  border-radius: 4px 4px 0 0;
  background: rgba(255, 255, 255, 0.7);
  color: var(--typ-encre);
  font: 400 1.25rem "Courier Prime", monospace;
  letter-spacing: 0.02em;
  text-transform: none;
}

.typ-champ input:focus {
  outline: none;
  border-bottom-color: var(--typ-vermillon);
  background: #fff;
}

#typ-f-rejoindre input[name="code"] {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 700;
}

.typ-choix-lib {
  margin: 4px 0 5px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--typ-doux);
}

.typ-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.typ-segments button {
  margin: 0;
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid rgba(35, 30, 25, 0.25);
  background: transparent;
  color: var(--typ-encre);
  font: 700 0.92em "Outfit", sans-serif;
  cursor: pointer;
}

.typ-segments button[aria-pressed="true"] {
  background: var(--typ-encre);
  border-color: var(--typ-encre);
  color: var(--typ-papier);
}

.typ-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 16px;
  font-size: 0.9em;
  line-height: 1.35;
  cursor: pointer;
}

.typ-jeu input[type="checkbox"]:checked {
  background: var(--typ-vermillon);
  border-color: #a83620;
}

/* ---------- L'atelier ---------- */
.typ-accueil {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 2px;
}

.typ-affiche {
  text-align: center;
  padding: 16px 12px 12px;
  border-radius: 6px;
  background: radial-gradient(120% 140% at 50% 0%, #3a2e24, #1c1916);
  color: var(--typ-papier);
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.6);
}

.typ-affiche-titre {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.typ-affiche-titre .typ-tuile {
  --t: 46px;
  animation: typ-tombe 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
}

.typ-affiche p {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.5;
  color: #e6d8bd;
}

@keyframes typ-tombe {
  from {
    transform: translateY(-30px) rotate(-12deg);
    opacity: 0;
  }
}

.typ-accueil-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

.typ-accueil-droite {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.typ-mes-tables ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.typ-mes-tables .typ-vide {
  color: var(--typ-doux);
  font-style: italic;
  font-family: "Libre Baskerville", serif;
  font-size: 0.9em;
}

.typ-ligne-table {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 0 0 1px var(--typ-filet);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.typ-ligne-table:hover {
  transform: translateX(3px);
  box-shadow: inset 0 0 0 1.5px var(--typ-encre);
}

.typ-ligne-table.a-moi {
  box-shadow: inset 4px 0 0 var(--typ-vermillon), inset 0 0 0 1px rgba(214, 74, 47, 0.4);
  background: #fff3ea;
}

.typ-ligne-code {
  font: 700 1.05em "Courier Prime", monospace;
  letter-spacing: 0.12em;
}

.typ-ligne-info {
  min-width: 0;
  font-size: 0.85em;
  line-height: 1.3;
}

.typ-ligne-info small {
  display: block;
  color: var(--typ-doux);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.typ-pastille {
  padding: 4px 9px;
  border-radius: 99px;
  font-size: 0.75em;
  font-weight: 700;
  white-space: nowrap;
  background: var(--typ-papier-2);
  color: var(--typ-doux);
}

.a-moi .typ-pastille {
  background: var(--typ-vermillon);
  color: #fff;
}

.typ-oublier {
  margin: 0 0 0 4px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--typ-doux);
  cursor: pointer;
  font-size: 1em;
}

.typ-oublier:hover {
  background: rgba(214, 74, 47, 0.12);
  color: var(--typ-vermillon);
}

/* ---------- Salle d'attente ---------- */
.typ-attente {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.typ-attente-carton {
  width: min(560px, 100%);
  text-align: center;
}

.typ-attente-carton h2 {
  justify-content: center;
  font-size: 1.6em;
}

.typ-attente-carton p {
  margin: 0 0 10px;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  color: var(--typ-doux);
}

.typ-code {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 14px;
}

.typ-code .typ-tuile {
  --t: 52px;
}

.typ-partage {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.typ-sieges {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.typ-sieges li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px var(--typ-filet);
  font-weight: 700;
  text-align: left;
}

.typ-sieges li.libre {
  color: var(--typ-doux);
  font-weight: 500;
  font-style: italic;
  box-shadow: inset 0 0 0 1.5px rgba(35, 30, 25, 0.18);
  background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(35, 30, 25, 0.04) 6px 12px);
}

.typ-encrier {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c, #999);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.3);
}

/* ---------- Partie ---------- */
.typ-partie {
  display: flex;
  gap: 12px;
}

.typ-table {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Le marbre de l'imprimeur, dans son châssis de bois */
.typ-marbre {
  position: relative;
  padding: 10px;
  border-radius: 10px;
  /* Quatre vis de laiton aux coins du châssis */
  background:
    radial-gradient(circle at 6px 6px, #fff3c4 0, #c9972c 2.5px, #7a5a12 4px, transparent 4.6px),
    radial-gradient(circle at calc(100% - 6px) 6px, #fff3c4 0, #c9972c 2.5px, #7a5a12 4px, transparent 4.6px),
    radial-gradient(circle at 6px calc(100% - 6px), #fff3c4 0, #c9972c 2.5px, #7a5a12 4px, transparent 4.6px),
    radial-gradient(circle at calc(100% - 6px) calc(100% - 6px), #fff3c4 0, #c9972c 2.5px, #7a5a12 4px, transparent 4.6px),
    radial-gradient(140% 100% at 30% 20%, rgba(255, 255, 255, 0.12), transparent 60%),
    linear-gradient(135deg, #8a5a32, #5e3b1f 50%, #7a4e2a);
  box-shadow: 0 18px 34px -16px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.15), inset 0 -3px 6px rgba(0, 0, 0, 0.3);
}

.typ-plateau {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n, 15), var(--typ-case));
  grid-auto-rows: var(--typ-case);
  gap: 2px;
  padding: 2px;
  border-radius: 4px;
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(50% 60% at 80% 70%, rgba(0, 0, 0, 0.18), transparent),
    linear-gradient(135deg, #4a514c, #2f3532 45%, #444b46 70%, #2a2f2c);
}

.typ-case {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: #ece2cb;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  user-select: none;
  -webkit-user-select: none;
  font-family: "Libre Baskerville", serif;
  line-height: 1;
  text-align: center;
}

.typ-case.cible {
  outline: 3px solid var(--typ-vermillon);
  outline-offset: -3px;
  background: #fff3e6;
}

.typ-case.libre-clic {
  cursor: pointer;
}

.typ-case.libre-clic:hover {
  background: #fffaf0;
}

/* Encres */
.typ-case[data-e] {
  color: rgba(255, 255, 255, 0.92);
  font-size: calc(var(--typ-case) * 0.26);
  font-weight: 700;
  flex-direction: column;
}

.typ-case[data-e] small {
  font-size: 0.62em;
  font-style: italic;
  font-weight: 400;
  opacity: 0.85;
}

.typ-case[data-e="L2"] {
  background: radial-gradient(circle at 50% 40%, #4f82bd, var(--typ-bleu));
}

.typ-case[data-e="L3"] {
  background: radial-gradient(circle at 50% 40%, #4ea67d, var(--typ-vert));
}

.typ-case[data-e="M2"] {
  background: radial-gradient(circle at 50% 40%, #e66d52, var(--typ-vermillon));
}

.typ-case[data-e="M3"] {
  background: radial-gradient(circle at 50% 40%, #f0c45a, var(--typ-or));
  color: #3b2a07;
}

.typ-case.centre {
  font-size: calc(var(--typ-case) * 0.6);
}

/* ---------- Les caractères en bois ---------- */
.typ-tuile {
  --t: var(--typ-case);
  position: relative;
  width: var(--t);
  height: var(--t);
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--t) * 0.12);
  background:
    repeating-linear-gradient(95deg, rgba(120, 70, 20, 0.06) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, var(--typ-bois-1), var(--typ-bois-2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    inset 0 -2px 0 rgba(120, 70, 20, 0.35),
    0 2px 0 #9b6f35,
    0 3px 4px rgba(0, 0, 0, 0.35);
  color: var(--typ-encre);
  font-family: "Alfa Slab One", serif;
  font-size: calc(var(--t) * 0.58);
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.typ-tuile b {
  font-family: "Alfa Slab One", serif;
  font-weight: 400;
  color: var(--typ-encre);
  transform: translateY(-4%);
}

.typ-tuile i {
  position: absolute;
  right: 9%;
  bottom: 6%;
  font-family: "Outfit", sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: calc(var(--t) * 0.24);
  color: rgba(35, 30, 25, 0.7);
}

/* Blanc : lettre à l'encre rouge, sans valeur */
.typ-tuile.blanc b {
  color: var(--typ-vermillon);
}

.typ-tuile.vide b::after {
  content: "";
}

.typ-case > .typ-tuile {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
}

/* Lettres du coup en cours : encre fraîche */
.typ-tuile.posee {
  cursor: pointer;
  background: linear-gradient(160deg, #fff6dc, #ecd09c);
  box-shadow:
    inset 0 0 0 2px var(--typ-vermillon),
    0 2px 0 #9b6f35,
    0 4px 8px rgba(214, 74, 47, 0.45);
  animation: typ-pose 0.25s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes typ-pose {
  from {
    transform: scale(1.25);
  }
}

/* Dernier coup joué */
.typ-tuile.dernier::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 4%;
  height: 3px;
  border-radius: 2px;
  background: var(--c, var(--typ-vermillon));
}

.typ-tuile.dernier {
  animation: typ-imprime 0.7s ease-out;
}

@keyframes typ-imprime {
  0% {
    transform: translateY(-40%) scale(1.3);
    opacity: 0;
  }
  60% {
    transform: translateY(0) scale(0.96);
    opacity: 1;
  }
}

.typ-mot-faux {
  background: linear-gradient(160deg, #ffe1d6, #f4b9a6) !important;
}

/* ---------- Composteur (chevalet) ---------- */
.typ-composteur-ligne {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.typ-composteur {
  display: flex;
  gap: 6px;
  min-height: 56px;
  padding: 8px 12px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #d9dde0, #9aa1a6 55%, #c3c8cc);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(0, 0, 0, 0.25), 0 10px 18px -10px rgba(0, 0, 0, 0.6);
}

.typ-fente {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.typ-composteur .typ-tuile {
  --t: 48px;
  cursor: grab;
  transition: transform 0.15s;
}

.typ-composteur .typ-tuile:hover {
  transform: translateY(-3px);
}

.typ-composteur .typ-tuile.choisie {
  transform: translateY(-7px);
  box-shadow:
    inset 0 0 0 2px var(--typ-vermillon),
    0 2px 0 #9b6f35,
    0 8px 12px rgba(0, 0, 0, 0.35);
}

.typ-composteur .typ-tuile.utilisee {
  visibility: hidden;
}

.typ-composteur.inactif .typ-tuile {
  cursor: default;
}

/* Tuile qui suit le pointeur pendant un glisser */
.typ-volante {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3000;
  pointer-events: none;
  --t: 52px;
  transform: translate(-50%, -50%) rotate(-4deg) scale(1.08);
  box-shadow: 0 14px 22px rgba(0, 0, 0, 0.4);
}

.typ-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.typ-act {
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--typ-papier);
  color: var(--typ-encre);
  box-shadow: 0 3px 0 #c9b893, inset 0 0 0 1px rgba(35, 30, 25, 0.12);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.typ-act:hover:not(:disabled) {
  background: #fff;
}

.typ-act:disabled {
  opacity: 0.4;
  cursor: default;
}

.typ-act svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.typ-valider {
  height: 46px;
  margin: 0 0 0 4px;
  padding: 0 22px;
  border: none;
  border-radius: 8px;
  background: var(--typ-vermillon);
  color: #fff;
  font-family: "Alfa Slab One", serif;
  font-size: 1.05em;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 0 #8f2a17, 0 10px 18px -10px rgba(0, 0, 0, 0.5);
}

.typ-valider:disabled {
  background: #b9ad99;
  box-shadow: 0 4px 0 #8f8471;
  cursor: default;
}

.typ-valider:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8f2a17;
}

/* ---------- Panneau ---------- */
.typ-panneau {
  width: 300px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 12px;
  box-sizing: border-box;
  border-radius: 6px;
  background: linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)), var(--typ-papier);
  box-shadow: 0 14px 30px -18px rgba(35, 30, 25, 0.55), 0 0 0 1px rgba(35, 30, 25, 0.08);
}

.typ-joueurs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.typ-joueur {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px var(--typ-filet);
  transition: box-shadow 0.2s, transform 0.2s;
}

.typ-joueur.actif {
  box-shadow: inset 4px 0 0 var(--c), inset 0 0 0 1.5px var(--c);
  transform: translateX(-3px);
  background: #fff;
}

.typ-joueur.abandon {
  opacity: 0.45;
  text-decoration: line-through;
}

.typ-joueur-nom {
  min-width: 0;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.typ-joueur-nom small {
  display: block;
  font-weight: 500;
  font-size: 0.76em;
  color: var(--typ-doux);
}

.typ-joueur-nom small .en-ligne {
  color: var(--typ-vert);
  font-weight: 700;
}

.typ-joueur-score {
  font-family: "Alfa Slab One", serif;
  font-size: 1.3em;
  font-variant-numeric: tabular-nums;
}

.typ-chrono {
  color: var(--typ-vermillon);
  font-weight: 700;
}

/* Épreuve : aperçu du coup */
.typ-epreuve {
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1.5px dashed rgba(35, 30, 25, 0.25);
  font-family: "Courier Prime", monospace;
  font-size: 0.92em;
  line-height: 1.45;
}

.typ-epreuve h3 {
  margin: 0 0 4px;
  font: 700 0.75em "Outfit", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--typ-doux);
}

.typ-epreuve .mot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.typ-epreuve .mot.faux {
  color: var(--typ-vermillon);
  text-decoration: line-through wavy rgba(214, 74, 47, 0.6);
}

.typ-epreuve .total {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--typ-filet);
  font-weight: 700;
  font-size: 1.1em;
}

.typ-epreuve .info {
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 0.92em;
  color: var(--typ-doux);
}

.typ-epreuve .alerte {
  color: var(--typ-vermillon);
  font-family: "Outfit", sans-serif;
  font-weight: 600;
}

.typ-epreuve.a-moi {
  border-color: var(--typ-vermillon);
  background: rgba(214, 74, 47, 0.05);
}

.typ-bloc h3 {
  margin: 0 0 6px;
  font: 700 0.75em "Outfit", sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--typ-doux);
}

.typ-defis {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.typ-defis li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(201, 151, 44, 0.12);
  font-size: 0.82em;
  line-height: 1.25;
}

.typ-defis li b {
  font-family: "Alfa Slab One", serif;
  font-weight: 400;
}

.typ-defis li span {
  grid-column: 1 / -1;
  color: var(--typ-doux);
}

.typ-defis li em {
  font-style: normal;
  font-weight: 700;
  color: var(--typ-or);
}

.typ-defis li.pris {
  background: rgba(35, 30, 25, 0.05);
  opacity: 0.75;
}

.typ-defis li.pris em {
  color: var(--c);
}

.typ-histo-bloc {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.typ-histo {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: auto;
  font-family: "Courier Prime", monospace;
  font-size: 0.8em;
  line-height: 1.35;
}

.typ-histo li {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 7px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dotted var(--typ-filet);
}

.typ-histo li::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}

.typ-histo li b {
  font-weight: 700;
}

.typ-lien {
  margin: 0;
  padding: 2px;
  border: none;
  background: none;
  color: var(--typ-doux);
  font: 600 0.8em "Outfit", sans-serif;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
}

.typ-lien:hover {
  color: var(--typ-vermillon);
}

/* ---------- Fenêtres ---------- */
.typ-voile {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 8px;
  background: rgba(28, 25, 22, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.typ-fenetre {
  box-sizing: border-box;
  width: min(520px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 22px 24px;
  border-radius: 6px;
  background: var(--typ-papier);
  box-shadow: 0 24px 60px -20px #000;
  text-align: center;
  animation: typ-tombe 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.typ-fenetre h2 {
  margin: 0 0 10px;
  font-family: "Alfa Slab One", serif;
  font-weight: 400;
  font-size: 1.4em;
}

.typ-fenetre p {
  margin: 0 0 14px;
  font-family: "Libre Baskerville", serif;
  font-size: 0.92em;
  color: var(--typ-doux);
  line-height: 1.5;
}

.typ-fenetre-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.typ-joker-lettres,
.typ-echange-lettres {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.typ-joker-lettres .typ-tuile,
.typ-echange-lettres .typ-tuile {
  --t: 42px;
  cursor: pointer;
}

.typ-joker-lettres .typ-tuile:hover {
  transform: translateY(-3px);
}

.typ-echange-lettres .typ-tuile.choisie {
  transform: translateY(-6px);
  box-shadow: inset 0 0 0 2.5px var(--typ-vermillon), 0 2px 0 #9b6f35, 0 8px 12px rgba(0, 0, 0, 0.3);
}

.typ-fin-titre {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.typ-fin-titre .typ-tuile {
  --t: 40px;
  animation: typ-tombe 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
}

.typ-podium {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 340px;
  text-align: left;
}

.typ-podium li {
  display: grid;
  grid-template-columns: 26px 14px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px dotted var(--typ-filet);
  font-weight: 700;
}

.typ-podium li:first-child {
  background: rgba(201, 151, 44, 0.16);
  border-radius: 6px;
}

.typ-podium .rang {
  font-family: "Alfa Slab One", serif;
  color: var(--typ-doux);
}

.typ-podium .pts {
  font-family: "Alfa Slab One", serif;
  font-weight: 400;
}

/* Petit message en bas de la zone */
.typ-toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  max-width: 80%;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--typ-encre);
  color: var(--typ-papier);
  font-weight: 600;
  font-size: 0.95em;
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.typ-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.typ-toast.erreur {
  background: var(--typ-vermillon);
}

.typ-credit {
  font-size: 0.85em;
  opacity: 0.75;
}

/* ---------- Écrans étroits ---------- */
@media (max-width: 860px) {
  .typ-accueil-cols {
    grid-template-columns: 1fr;
  }

  .typ-partie {
    flex-direction: column;
  }

  .typ-panneau {
    width: auto;
  }

  .typ-histo {
    max-height: 180px;
  }

  .typ-sieges {
    grid-template-columns: 1fr;
  }

  .typ-composteur .typ-tuile,
  .typ-fente {
    --t: 38px;
    width: 38px;
    height: 38px;
  }

  .typ-composteur {
    gap: 4px;
    padding: 6px 8px 8px;
  }
}

/* Le gras des textes : encre du jeu, pas le violet du site */
.typ-zone b:not(.typ-tuile b),
.typ-zone strong {
  color: inherit;
}

.typ-option b {
  color: var(--typ-vermillon);
}

.typ-champ input::placeholder {
  font-style: normal;
  letter-spacing: 0.1em;
  color: rgba(35, 30, 25, 0.3);
}

.typ-histo li.typ-histo-vide {
  display: block;
  border: none;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  color: var(--typ-doux);
}

.typ-histo li.typ-histo-vide::before {
  display: none;
}

/* Blanc sur le composteur : une étoile discrète à la place de la lettre */
.typ-composteur .typ-tuile.blanc b:empty::after,
.typ-echange-lettres .typ-tuile.blanc b:empty::after {
  content: "✱";
  font-size: 0.6em;
  color: rgba(214, 74, 47, 0.55);
}

/* Deux réglages côte à côte */
.typ-rangee {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 22px;
}

.typ-segments button:disabled {
  opacity: 0.3;
  cursor: default;
}

.typ-sieges li small {
  font-weight: 500;
  color: var(--typ-doux);
}

/* Creux laissé dans le composteur par la pièce tenue en main */
.typ-composteur .typ-tuile.en-main {
  visibility: visible;
  background: rgba(0, 0, 0, 0.14);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
  transform: none;
}

.typ-composteur .typ-tuile.en-main > * {
  visibility: hidden;
}

/* ---------- Coups des adversaires ---------- */
.typ-tuile.typ-cache {
  visibility: hidden;
}

/* Lettre en vol, de la ligne du joueur jusqu'à sa case */
.typ-volante-coup {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 3000;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 2px var(--c),
    0 2px 0 #9b6f35,
    0 14px 22px rgba(0, 0, 0, 0.35);
}

/* Arrivée sur le marbre : un petit coup de presse */
.typ-tuile.typ-arrivee {
  animation: typ-arrivee 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes typ-arrivee {
  0% {
    transform: scale(1.18);
    box-shadow: 0 0 0 4px var(--c, var(--typ-vermillon)), 0 3px 4px rgba(0, 0, 0, 0.35);
  }
}

/* Points du coup, au-dessus du mot */
.typ-gain {
  position: fixed;
  z-index: 3001;
  pointer-events: none;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--c);
  color: #fff;
  font: 400 1.05em "Alfa Slab One", serif;
  white-space: nowrap;
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.45);
}

/* Aide (contre les bots) */
.typ-aide {
  position: relative;
  color: #8a6400;
  background: #fff4cf;
  box-shadow: 0 3px 0 #d9b75c, inset 0 0 0 1px rgba(201, 151, 44, 0.45);
}

.typ-aide:hover:not(:disabled) {
  background: #ffeaa6;
}

.typ-aide-nb {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 99px;
  background: var(--typ-or);
  color: #fff;
  font: 700 11px/18px "Outfit", sans-serif;
}

.typ-aide.cherche svg {
  animation: typ-cherche 0.8s ease-in-out infinite;
}

@keyframes typ-cherche {
  50% {
    transform: scale(1.2);
    filter: drop-shadow(0 0 4px #f2c14e);
  }
}
