@charset "UTF-8";
/* =====================================================================
   Morpho Toutou — game-v32-board.css
   Refonte mobile du plateau en partie (solo + multijoueur)
   D'après les maquettes : cartes en haut, main en bas.
   Tout est scopé sous .mti__board.mti--v32 / .mtn
   ===================================================================== */

/* ── Page hôte (WooCommerce / template) ── */
.pl-woo-page { background: #F8F3EE !important; padding: 0 !important; }

/* libellés repris sur la police du site (pas Nunito) */
.mti--v32 .mtn__pile-cap,
.mti--v32 .mtn__hand-head-lbl,
.mti--v32 .mtn__dw-title,
.mti--v32 .mtn__banner-lbl,
.mti--v32 .mtn__banner-pts-long {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

/* ── Conteneur ── */
.mti__board.mti--v32 {
  display: block;
  grid-template-columns: none;
  gap: 0;
  background: none;
  padding: 0;
  max-width: 480px;
  margin: 0 auto;
}
#mti-app:has(.mti--v32) { padding: 8px; max-width: 520px; }

.mtn {
  font-family: 'Nunito', 'Segoe UI', Tahoma, sans-serif;
  color: #2b2b2b;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 12px 16px;
  position: relative;
}

/* on masque l'ancien lien "Quitter" : géré par le menu ⋯ */
.mti__quit-wrap { display: none !important; }

/* =========================================================
   HEADER : pioche · scoreboard · menu
   ========================================================= */
.mtn__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 5px;
  padding-top: 16px;
}

/* — Pioche (haut gauche) — */
.mtn__pile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 50px; flex-shrink: 0;
}
.mtn__pile-stack { position: relative; width: 46px; height: 62px; }
.mtn__pile-bg, .mtn__pile-top {
  position: absolute; inset: 0;
  border-radius: 9px; overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.28);
  background: #c8956c;
}
.mtn__pile-bg img, .mtn__pile-top img,
.mtn__pile-bg > div, .mtn__pile-top > div { width: 100%; height: 100%; object-fit: cover; display: block; }
.mtn__pile-bg--3 { transform: translate(4px,-4px) rotate(5deg);   z-index: 1; }
.mtn__pile-bg--2 { transform: translate(2.5px,-2.5px) rotate(3deg); z-index: 2; }
.mtn__pile-bg--1 { transform: translate(1px,-1px) rotate(1.5deg);  z-index: 3; }
.mtn__pile-top   { transform: none; z-index: 4; }
/* Pioche complètement vide : grisée et inactive */
.mtn__pile--empty { cursor: default; }
.mtn__pile--empty .mtn__pile-stack { filter: grayscale(1); opacity: .4; }
.mtn__pile--empty .mtn__pile-bg,
.mtn__pile--empty .mtn__pile-top { box-shadow: none; }
.mtn__pile-badge {
  position: absolute; top: -8px; right: -9px; z-index: 10;
  width: 24px; height: 24px; border-radius: 50%;
  background: #E8A93A; color: #fff; border: 2px solid #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.28);
}
.mtn__pile-label { font-size: 11px; font-weight: 800; color: #2b2b2b; }
.mtn__pile-hit { position: absolute; inset: 0; background: none; border: 0; cursor: pointer; padding: 0; }
.mtn__pile-hit:disabled { cursor: default; }

/* — Menu ⋯ (haut droite) — */
.mtn__menu {
  flex-shrink: 0; width: 40px; height: 40px;
  border: 0; background: none; cursor: pointer;
  font-size: 28px; line-height: 1; color: #8a857d; letter-spacing: 1px;
}
.mtn__menu-pop {
  position: fixed; z-index: 9500;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
  padding: 6px; min-width: 180px;
  display: flex; flex-direction: column; gap: 2px;
}
.mtn__menu-item {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; cursor: pointer;
  padding: 11px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 700; color: #3a352f;
}
.mtn__menu-item:hover { background: #f4f1ea; }
.mtn__menu-item--danger { color: #cf4156; }

/* — Scoreboard (centre) — */
.mtn__score {
  flex: 1; align-self: center;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  background: #EFE9DF; border-radius: 40px;
  padding: 6px 8px; min-height: 50px;
}
.mtn__score.mtn__score--solo { gap: 0; }
.mti--v32 .mti__mp-player-card {
  position: relative; display: flex; align-items: center;
  padding: 5px 10px 5px 5px; border-radius: 30px; background: transparent;
  box-shadow: none; min-width: 0;
}
.mti--v32 .mti__mp-player-card--active { background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.10); }
.mti--v32 .mti__mp-turn-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: #E0612A; color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 9px; border-radius: 20px; white-space: nowrap;
}
.mti--v32 .mti__mp-player-inner { display: flex; align-items: center; gap: 7px; }
.mti--v32 .mti__mp-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mti--v32 .mti__mp-player-info { display: flex; flex-direction: column; gap: 0; line-height: 1.05; min-width: 0; }
.mti--v32 .mti__mp-player-name { font-size: 12px; font-weight: 700; color: #9a948b; white-space: nowrap; }
.mti--v32 .mti__mp-player-pts  { font-size: 14px; font-weight: 800; color: #b8b2a8; white-space: nowrap; }
.mti--v32 .mti__mp-player-card--active .mti__mp-player-name { color: #3a352f; }
.mti--v32 .mti__mp-player-card--active .mti__mp-player-pts  { color: #E0612A; }
.mti--v32 .mti__mp-vs { font-size: 12px; font-weight: 700; color: #b8b2a8; padding: 0 3px; }

/* =========================================================
   PLAY AREA
   ========================================================= */
.mtn__play { display: flex; flex-direction: column; gap: 12px; }

/* — Bannière "MOT TROUVÉ" — */
.mti--v32 .mtn__banner { display: none; transform: none; }
.mti--v32 .mtn__banner.has-word {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg,#EBBB4C,#D89E2C);
  border: 1px solid #C68C1F; border-radius: 16px;
  padding: 12px 14px; box-shadow: 0 4px 14px rgba(213,158,46,.35);
}
.mtn__banner-lbl {
  font-size: 11px; font-weight: 800; letter-spacing: .07em;
  color: #6a4f17; text-transform: uppercase; white-space: nowrap;
}
.mtn__banner-word { flex: 1; font-size: 24px; font-weight: 800; line-height: 1; }
.mtn__banner-rad { color: #9c7f33; }
.mtn__banner-suf { color: #3a2c0a; }
.mtn__banner-pts {
  background: #2c2c2c; color: #fff; font-weight: 800; font-size: 14px;
  padding: 6px 12px; border-radius: 20px; white-space: nowrap;
}

/* — Grandes cartes — */
.mtn__cards { display: flex; align-items: stretch; gap: 8px; position: relative; }
.mti--v32 .mti__piece.mtn__bigcard {
  flex: 1; position: relative; aspect-ratio: 3/4;
  border-radius: 18px; overflow: hidden;
  background: #e9e4db; border: 0; padding: 0; min-height: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.16);
  display: block; cursor: default; transform: none; top: 0;
}
.mti--v32 .mti__piece.mtn__bigcard.filled { background: #fff; }
.mti--v32 .mti__piece.mtn__bigcard::before { content: none; }
.mti--v32 .mti__piece--suf { top: 0; }
/* léger angle des grandes cartes */
.mti--v32 #mti-piece-rad { transform: rotate(-2deg); }
.mti--v32 #mti-piece-suf { transform: rotate(2deg); }
.mtn__bc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mtn__bc-img--empty { background: #ded8cf; }
.mtn__bc-label {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; pointer-events: none;
  font-family: 'HollyJourney', cursive; font-synthesis: none;
  color: #fff; font-size: 34px; text-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.mti--v32 .mti__piece-remove {
  position: absolute; top: -7px; right: -7px; z-index: 20;
  width: 34px; height: 34px; border-radius: 50%;
  background: #E8423E; color: #fff; border: 3px solid #fff;
  font-size: 18px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.3); padding: 0;
}
.mti--v32 .mti__piece-remove:hover { background: #d6322e; transform: scale(1.08); }
.mtn__plus {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 15;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: #9a948b; font-weight: 700; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  padding-bottom: 5px;
}
.mtn__bc-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 2px dashed #cabfae; border-radius: 18px; text-align: center; padding: 8px;
}
.mti--v32 .mti__piece--rad .mtn__bc-empty { border-color: #9fc3d6; }
.mtn__bc-empty-ic { display: none; }
.mtn__bc-empty-t  { font-weight: 800; font-size: 13px; color: #8a847a; letter-spacing: .05em; }
.mtn__bc-empty-s  { font-size: 11px; color: #aaa39a; }
.mti--v32 .mti__piece.drag-over,
.mti--v32 .mti__piece.drag-target.drag-over { box-shadow: 0 0 0 3px #F4B942, 0 4px 14px rgba(0,0,0,.16); }

/* — joker input (sur grande carte) — */
.mti--v32 .mti__joker-input {
  position: absolute; left: 8%; right: 8%; top: 50%; transform: translateY(-50%);
  width: 84%; background: rgba(0,0,0,.25); border: 0; border-radius: 8px;
  color: #fff; text-align: center; font-size: 22px; padding: 6px 4px;
  font-family: 'HollyJourney', cursive; z-index: 12;
}

/* — Main — */
.mtn__hand-head { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.mtn__hand-head-lbl { font-size: 13px; font-weight: 800; letter-spacing: .06em; color: #8a847a; }
.mtn__hand-head-cnt { font-size: 13px; font-weight: 600; color: #9a948b; }

.mti--v32 .mti__mp-hand-zone {
  display: flex; justify-content: center; align-items: flex-end;
  flex-wrap: nowrap; gap: 0; padding: 6px 0 2px; width: 100%;
  order: 0; /* annule le order:-1 hérité qui remontait la main au-dessus des cartes */
}
/* Mode solo sur ordinateur : la main peut passer à la ligne (wrap).
   Cible l'ID pour primer sur le flex-wrap:nowrap ci-dessus. Mobile déjà en wrap. */
@media (min-width: 641px) {
  .mti--solo #mti-mp-hand-zone { flex-wrap: wrap; }
  /* En solo sur ordinateur : on masque le bandeau de score (redondant avec le compteur) */
  .mti--solo #mti-mp-scorebar { display: none; }
}
.mti--v32 .mti__mp-hand-card {
  position: relative; flex-shrink: 0;
  width: 66px; height: 88px; margin: 0 -7px;
  border: 3px solid #fff; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transform: rotate(var(--rot,0deg));
}
.mti--v32 .mti__mp-hand-card:hover:not(.mti--placed) {
  transform: rotate(var(--rot,0deg)) translateY(-12px) scale(1.06);
  box-shadow: 0 12px 26px rgba(0,0,0,.3); z-index: 20; margin: 0 -4px;
}
.mti--v32 .mti__mp-hand-card.mti--placed { display: none; }
.mti--v32 .mti__mp-hand-card--bonus { border-color: #f0c040; box-shadow: 0 4px 12px rgba(200,160,0,.4), 0 0 0 1px #e8b000; }
.mti--v32 .mti__hc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* libellé syllabe en overlay permanent */
.mti--v32 .mti__hc-banner {
  position: absolute; inset: 0; bottom: 0;
  background: none; opacity: 1; transform: none; padding: 0;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.mti--v32 .mti__hc-label {
  display: block;
  font-family: 'HollyJourney', cursive; font-synthesis: none;
  color: #fff; font-size: 17px; text-shadow: 0 2px 5px rgba(0,0,0,.5);
}
.mti--v32 .mti__hc-pill { display: none; }
.mti--v32 .mti__hc-pts {
  top: -7px; right: -7px; left: auto; z-index: 6;
  width: 22px; height: 22px; border-radius: 50%;
  background: #E8423E; color: #fff; border: 2px solid #fff;
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
/* Cartes à points (Tête + Queue) : le score est déjà imprimé sur la carte → on masque le badge (doublon). Conservé sur les bonus. */
.mti--v32 .mti__mp-hand-card--rad .mti__hc-pts,
.mti--v32 .mti__mp-hand-card--suf .mti__hc-pts { display: none; }
.mti--v32 .mti__bonus-info-btn {
  position: absolute; bottom: 3px; right: 3px; z-index: 7;
  width: 20px; height: 20px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.55); color: #fff; font-weight: 800; font-size: 12px; cursor: pointer;
}

/* =========================================================
   ACTION BAR
   ========================================================= */
.mtn__actions { display: flex; gap: 10px; align-items: stretch; }
.mti--v32 .mtn__validate {
  position: relative;
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #1c1c1c; color: #fff; border: 0; border-radius: 16px;
  padding: 16px 18px; font-size: 18px; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,.2);
}
.mti--v32 .mtn__validate:disabled { opacity: .4; cursor: default; box-shadow: none; }
.mtn__validate-ic {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 9px;
  background: transparent; color: #fff; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.mtn__validate-txt { display: inline-block; }
/* annule le radius pill hérité du thème/ancien CSS */
.mti--v32 #mti-validate,
.mti--v32 #mti-mp-pass { border-radius: 16px; }
.mti--v32 .mtn__pass {
  width: 92px; flex-shrink: 0;
  background: #F4ECDD; border: 1px solid #EAD9BE; border-radius: 16px;
  color: #E07B39; font-size: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.mti--v32 .mtn__pass:active { background: #EFE3CC; }
.mtn__pass-ic { line-height: 1; }
/* Bouton de fin de partie : libellé visible, fond plus marqué */
.mti--v32 .mtn__pass--endgame {
  width: auto; gap: 8px; padding: 0 16px; font-size: 16px; font-weight: 800;
  background: #FBE2D2; border-color: #E9B79B;
}
.mti--v32 .mtn__pass--endgame .mtn__pass-txt { display: inline; }

/* =========================================================
   "Mes mots formés" : barre + tiroir
   ========================================================= */
.mti--v32 .mtn__fwbar {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: #F4ECDD; border: 1px solid #EAD9BE; border-radius: 16px;
  padding: 14px 16px; cursor: pointer; font-size: 15px; font-weight: 800; color: #3a352f;
}
.mtn__fwbar-ic  { font-size: 18px; }
.mtn__fwbar-txt { flex: 1; text-align: left; }
.mtn__fwbar-cnt {
  background: #F4B942; color: #fff; font-size: 13px; font-weight: 800;
  min-width: 24px; height: 24px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 6px;
}
.mtn__fwbar-arr { color: #b8b2a8; font-size: 22px; line-height: 1; }
.mtn__fwbar--empty { opacity: .55; }

.mtn__scrim {
  position: fixed; inset: 0; background: rgba(20,18,15,.45);
  opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 9000;
}
.mtn__scrim--show { opacity: 1; pointer-events: auto; }

.mtn__drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9001;
  max-width: 480px; margin: 0 auto;
  background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.2);
  padding: 8px 16px max(20px, env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  max-height: 82vh; overflow-y: auto;
}
.mtn__drawer--open { transform: translateY(0); }
.mti--v32 .mtn__drawer-handle {
  display: block !important; width: 48px !important; height: 5px !important;
  min-height: 0 !important; max-height: 5px !important; border-radius: 3px;
  background: #e0dad0 !important; border: 0 !important;
  margin: 4px auto 14px !important; cursor: pointer; padding: 0 !important; box-shadow: none !important;
}
.mti--v32 .mtn__drawer .mti__formed-words-zone { padding: 0; width: auto; }

.mtn__dw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mtn__dw-title { font-size: 20px; font-weight: 800; color: #2b2b2b; }
.mtn__dw-count { background: #F4B942; color: #fff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 14px; }
.mtn__dw-pts   { margin-left: auto; color: #E0612A; font-size: 15px; font-weight: 800; white-space: nowrap; }
.mtn__dw-empty { text-align: center; color: #9a948b; font-size: 14px; padding: 22px 0 30px; line-height: 1.5; }

.mtn__dw-cards {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 2px 2px 14px; margin: 0 -2px; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mtn__dw-cards::-webkit-scrollbar { display: none; }
.mtn__dw-card {
  position: relative; flex: 0 0 auto; width: 150px;
  background: #fff; border: 1px solid #efe9df; border-radius: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,.08); padding: 10px;
}
.mtn__dw-card-pts {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: #2c2c2c; color: #fff; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 10px;
}
.mtn__dw-card-imgs { display: flex; gap: 4px; }
.mtn__dw-thumb { position: relative; flex: 1; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden; background: #e9e4db; display: block; }
.mtn__dw-thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mtn__dw-thumb-img--empty { background: #ded8cf; }
.mtn__dw-thumb-lbl {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'HollyJourney', cursive; font-synthesis: none;
  color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.mtn__dw-card-lbl { display: block; text-align: center; margin-top: 8px; font-size: 12px; font-weight: 800; color: #5a544c; letter-spacing: .02em; }

.mtn__dw-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.mtn__dw-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  background: #F7F2E9; border: 1px solid #efe7d8; border-radius: 12px; padding: 12px;
}
.mtn__dw-chip-lbl { font-size: 14px; font-weight: 800; color: #3a352f; line-height: 1.25; }
.mtn__dw-chip-pts { background: #2c2c2c; color: #fff; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 10px; flex-shrink: 0; }

/* =========================================================
   Solo : timer / bouton lancer
   ========================================================= */
.mti--v32 .mti__solo-timer { margin: 2px 0 0; font-size: 20px; }
.mti--v32 .mti__solo-start-btn {
  display: block; margin: 8px auto 0;
  background: #1c1c1c; color: #fff; border: 0; border-radius: 14px;
  padding: 12px 18px; font-size: 15px; font-weight: 800; cursor: pointer;
}

/* =========================================================
   Mascotte (messages)
   ========================================================= */
.mti--v32 .mti__mascot {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 8000; display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 16px; padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: 90%;
}
.mti--v32 .mti__mascot[hidden] { display: none; }
.mti--v32 .mti__mascot-bubble { font-size: 14px; font-weight: 600; color: #3a352f; }
.mti--v32 .mti__mascot-dog { width: 32px; flex-shrink: 0; }
.mti--v32 .mti__mascot-dog svg, .mti--v32 .mti__mascot-dog img { width: 32px; height: 32px; }

/* =========================================================
   FIX largeur : empêcher la main (nowrap) d'élargir le plateau
   ========================================================= */
.mti--v32 .mtn { width: 100%; max-width: 100%; overflow-x: clip; }
.mti--v32 .mtn,
.mti--v32 .mtn__top,
.mti--v32 .mtn__play,
.mti--v32 .mtn__cards,
.mti--v32 .mtn__actions,
.mti--v32 .mtn__score { min-width: 0; }
.mti--v32 .mtn__play,
.mti--v32 .mtn__cards { width: 100%; }
/* le scoreboard occupe l'espace restant ; overflow visible pour la pastille "À TOI !" */
.mti--v32 .mtn__score { flex: 1 1 0; min-width: 0; overflow: visible; }
/* la main reste en éventail mais ne pousse plus le parent */
.mti--v32 .mti__mp-hand-zone { max-width: 100%; }

/* mobile : .mtn__side est transparent ; bannière au-dessus des cartes, actions après la main */
.mti--v32 .mtn__side { display: contents; }
.mti--v32 .mtn__banner  { order: 1; }
.mti--v32 .mtn__play    { order: 2; }
.mti--v32 .mtn__actions { order: 3; }
.mti--v32 .mtn__fwbar   { order: 4; }

/* Les images de cartes contiennent déjà la syllabe : on masque l'overlay quand il y a une image */
.mti--v32 .mtn__bigcard:has(.mtn__bc-img:not(.mtn__bc-img--empty)) .mtn__bc-label { display: none; }
.mti--v32 .mti__mp-hand-card:has(.mti__hc-img) .mti__hc-label { display: none; }
.mti--v32 .mtn__dw-thumb:has(.mtn__dw-thumb-img:not(.mtn__dw-thumb-img--empty)) .mtn__dw-thumb-lbl { display: none; }

/* éléments réservés au desktop : masqués en mobile */
.mtn__quit, .mtn__pile-cap, .mtn__pile-btn,
.mtn__pass-txt, .mtn__banner-pts-long, .mtn__dw-more { display: none; }

/* =========================================================
   DESKTOP (≥ 980px) — 3 colonnes (d'après la maquette desktop)
   ========================================================= */
@media (min-width: 980px) {
  #mti-app:has(.mti--v32) { max-width: 1280px; padding: 16px 28px; }
  .mti__board.mti--v32 { max-width: none; }

  .mti--v32 .mtn {
    display: grid;
    width: 100%; max-width: 1240px; margin: 0 auto;
    grid-template-columns: 220px minmax(0, 1fr) 340px;
    grid-template-areas:
      "quit   score   menu"
      "pile   cards   side"
      "pile   handh   side"
      "pile   hand    side"
      "pile   formed  side";
    column-gap: 40px; row-gap: 18px;
    align-items: start; padding: 8px 4px 28px;
    overflow-x: visible; max-height: none;
  }
  .mti--v32 .mtn__top, .mti--v32 .mtn__play { display: contents; }

  /* — en-tête — */
  .mti--v32 .mtn__quit {
    grid-area: quit; display: inline-flex; align-items: center; align-self: center;
    background: none; border: 0; color: #6b6660; font-size: 15px; font-weight: 700;
    text-decoration: none; cursor: pointer; padding: 6px 2px;
  }
  .mti--v32 .mtn__quit:hover { color: #2b2b2b; }
  .mti--v32 .mtn__score { grid-area: score; justify-self: center; align-self: center; flex: 0 0 auto; }
  .mti--v32 .mtn__menu  { grid-area: menu; justify-self: end; align-self: center; }

  /* — colonne gauche : pioche — */
  .mti--v32 .mtn__pile { grid-area: pile; align-self: start; width: 100%; gap: 12px; padding-top: 6px; }
  .mti--v32 .mtn__pile-cap {
    display: block; text-align: center; text-transform: uppercase;
    font-size: 13px; font-weight: 800; letter-spacing: .14em; color: #8a847a;
  }
  .mti--v32 .mtn__pile-stack { width: 122px; height: 164px; }
  .mti--v32 .mtn__pile-badge { width: 34px; height: 34px; font-size: 16px; top: -10px; right: -12px; }
  .mti--v32 .mtn__pile-label, .mti--v32 .mtn__pile-hit { display: none; }
  .mti--v32 .mtn__pile-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 4px; padding: 14px 24px; border: 0; border-radius: 40px;
    background: #fff; color: #2b2b2b; font-size: 18px; font-weight: 800; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.10);
  }
  .mti--v32 .mtn__pile-btn:hover { box-shadow: 0 6px 18px rgba(0,0,0,.16); transform: translateY(-1px); }

  /* — colonne centre — */
  .mti--v32 .mtn__cards { grid-area: cards; gap: 16px; }
  .mti--v32 .mtn__cards .mtn__plus { width: 40px; height: 40px; font-size: 22px; }
  .mti--v32 .mtn__hand-head { grid-area: handh; margin-top: 6px; }
  .mti--v32 .mti__mp-hand-zone { grid-area: hand; }
  .mti--v32 .mti__mp-hand-card { width: 104px; height: 138px; margin: 0 -6px; }
  .mti--v32 .mti__mp-hand-card .mti__hc-label { font-size: 20px; }

  /* — mots formés en ligne (plus de tiroir) — */
  .mti--v32 .mtn__fwbar, .mti--v32 .mtn__scrim, .mti--v32 .mtn__drawer-handle { display: none !important; }
  .mti--v32 .mtn__drawer {
    grid-area: formed; position: static; transform: none; margin: 0; padding: 4px 0 0;
    max-width: none; max-height: none; background: none; box-shadow: none;
    border-radius: 0; overflow: visible;
  }
  .mti--v32 .mtn__dw-head { margin-bottom: 10px; }
  .mti--v32 .mtn__dw-title { font-size: 14px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #8a847a; }
  .mti--v32 .mtn__dw-count { background: none; color: #8a847a; padding: 0; font-weight: 800; }
  .mti--v32 .mtn__dw-count::before { content: "\00B7\00A0"; }
  .mti--v32 .mtn__dw-list { display: none; }
  /* Toggle "+N mots" : révèle les mots plus anciens */
  .mti--v32 #mti-formed-words.mtn__dw--open .mtn__dw-list { display: grid; }
  .mti--v32 .mtn__dw-cards { flex-wrap: nowrap; overflow: visible; padding-bottom: 0; }
  .mti--v32 .mtn__dw-card { width: 150px; }
  .mti--v32 .mtn__dw-more {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 0 0 auto; width: 96px; border: 2px dashed #d8d1c4; border-radius: 14px;
    color: #a59e92; font-size: 22px; font-weight: 800;
    cursor: pointer; transition: border-color .15s, color .15s, background .15s;
  }
  .mti--v32 .mtn__dw-more:hover { border-color: #F4B942; color: #E0612A; background: #fff8ec; }
  .mti--v32 #mti-formed-words.mtn__dw--open .mtn__dw-more { border-color: #F4B942; color: #E0612A; background: #fff8ec; }
  .mti--v32 .mtn__dw-more span { font-size: 12px; font-weight: 700; }

  /* — colonne droite : bannière (au-dessus) + actions (juste en-dessous) — */
  .mti--v32 .mtn__side {
    grid-area: side; display: flex; flex-direction: column; gap: 18px; align-self: start;
  }
  .mti--v32 .mtn__banner.has-word {
    flex-direction: column; align-items: center; gap: 8px; text-align: center;
    padding: 24px 20px; border-radius: 22px;
  }
  .mti--v32 .mtn__banner-lbl { font-size: 14px; }
  .mti--v32 .mtn__banner-lbl::after { content: " !"; }
  .mti--v32 .mtn__banner-word { flex: 0 0 auto; font-size: 38px; }
  .mti--v32 .mtn__banner-pts { display: none; }
  .mti--v32 .mtn__banner-pts-long {
    display: inline-block; background: #2c2c2c; color: #fff; font-weight: 800; font-size: 14px;
    padding: 7px 16px; border-radius: 20px;
  }

  /* — colonne droite : carte d'actions — */
  .mti--v32 .mtn__actions {
    flex-direction: column; gap: 12px;
    background: #fff; border-radius: 22px; padding: 18px; box-shadow: 0 4px 20px rgba(0,0,0,.08);
  }
  .mti--v32 .mtn__validate { width: 100%; padding: 18px; font-size: 19px; }
  .mti--v32 .mtn__pass {
    position: relative; width: 100%; justify-content: center;
    font-size: 16px; font-weight: 800; color: #E07B39;
    background: #FBF3E6; border-color: #f0e2c8; padding: 16px 18px; border-radius: 16px;
  }
  .mti--v32 .mtn__pass-ic {
    line-height: 1;
  }
  .mti--v32 .mtn__pass-txt { display: inline; padding-left: 5px; }

  /* — chrono solo — */
  .mti--v32 .mti__solo-timer { grid-area: pile; align-self: end; justify-self: center; }
  .mti--v32 .mti__solo-start-btn { grid-area: pile; align-self: end; justify-self: center; }
}

/* =========================================================
   Petits écrans
   ========================================================= */
@media (max-width: 380px) {
  .mtn { padding: 4px 8px 14px; }
  .mtn__banner-word { font-size: 21px; }
  .mti--v32 .mti__mp-hand-card { width: 74px; height: 100px; }
  .mtn__dw-list { grid-template-columns: 1fr; }
}

/* =========================================================
   Écran de fin SOLO : boutons Rejouer (jaune) / Menu (noir)
   ========================================================= */
.mti__end2--solo .mti__btn-restart {
  background: #F4B942 !important;
  color: #1c1c1c !important;
  box-shadow: 0 4px 16px rgba(244,185,66,.40) !important;
}
.mti__end2--solo .mti__btn-restart:hover {
  box-shadow: 0 6px 22px rgba(244,185,66,.55) !important;
}
.mti__end2--solo .mti__btn--ghost {
  background: #1c1c1c !important;
  color: #fff !important;
  border: none !important;
}
.mti__end2--solo .mti__btn--ghost:hover {
  background: #000 !important;
}

/* =========================================================
   Lobby — "Historique des parties" : carte (maquette BO)
   ========================================================= */
.mti-hist-acc { margin: 16px auto 0; max-width: 520px; }
.mti-histcard {
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 8px 30px rgba(17,17,17,.06);
  text-align: left;
}
.mti-histcard__head {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; background: #111111; color: #fff; border: 0; cursor: pointer;
  padding: 15px 22px; font-family: inherit;
}
.mti-histcard__title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
.mti-histcard__tick { width: 22px; height: 8px; background: #F4B942; border-radius: 2px; flex-shrink: 0; }
.mti-histcard__sort {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,.55); white-space: nowrap;
}
.mti-histcard__chev { flex-shrink: 0; transition: transform .3s ease; }
.mti-histcard__head.is-open .mti-histcard__chev { transform: rotate(180deg); }
.mti-hist-panel { overflow: hidden; max-height: 0; transition: max-height .35s ease; }
.mti-histcard__body { padding: 0; }

/* — Lignes de partie — */
.mti-pgame { display: flex; align-items: flex-start; gap: 16px; padding: 18px 22px; border-top: 1px solid #F0ECE5; }
.mti-histcard__body .mti-pgame:first-child { border-top: 0; }
.mti-pgame__date { flex-shrink: 0; width: 46px; background: #F8F3EE; border-radius: 12px; padding: 7px 0; text-align: center; }
.mti-pgame__d { display: block; font-size: 17px; font-weight: 800; color: #111; line-height: 17px; }
.mti-pgame__mo { display: block; margin-top: 2px; font-size: 10px; font-weight: 600; color: #9A938A; letter-spacing: .5px; text-transform: uppercase; }
.mti-pgame__main { flex: 1; min-width: 0; }
.mti-pgame__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.mti-pgame__name { margin: 0; font-size: 17px; font-weight: 800; color: #111; letter-spacing: -.3px; }
.mti-pgame__meta { display: flex; align-items: center; gap: 14px; }
.mti-pgame__metait { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: #9A938A; }
.mti-pgame__ic { display: block; flex-shrink: 0; }
.mti-pgame__players { display: flex; flex-wrap: wrap; gap: 8px; }

/* — Pastilles joueurs — */
.mti-pchip { display: inline-flex; align-items: center; gap: 9px; background: #fff; border: 1px solid #EFEAE2; border-radius: 999px; padding: 5px 14px 5px 5px; }
.mti-pchip--win { background: #FCF3DD; border-color: #F2E4C0; }
.mti-pchip__av { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: -.3px; }
.mti-pchip--win .mti-pchip__av { color: #111; box-shadow: 0 0 0 3px #FCF3DD; }
.mti-pchip__info { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mti-pchip__name { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: #1A1A1A; white-space: nowrap; }
.mti-pchip__crown { fill: #1A1A1A; flex-shrink: 0; }
.mti-pchip__mots { font-size: 11px; font-weight: 500; color: #9A938A; white-space: nowrap; }
.mti-pchip__pts { margin-left: 2px; flex-shrink: 0; background: rgba(17,17,17,.05); border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 800; color: #1A1A1A; white-space: nowrap; }
.mti-pchip--win .mti-pchip__pts { background: rgba(17,17,17,.07); }

/* — Bouton suppression — */
.mti-pgame__del { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #EAE4DB; background: #fff; color: #B7AFA4; font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s; }
.mti-pgame__del:hover { background: #FBEDEA; color: #D95C35; border-color: #F2D6CE; }
.mti-pgame__empty { padding: 22px; text-align: center; font-size: 13px; color: #9A938A; }

/* =========================================================
   ÉCRAN DE FIN (maquette bo-save) : résultat + sauvegarde
   ========================================================= */
/* le solo a besoin de plus de largeur que le plateau pour la grille 2 colonnes */
#mti-app:has(.mti-end2col) { max-width: 1040px; }
.mti__board:has(.mti-end2col),
.mti__board.mti--v32:has(.mti-end2col) { max-width: none !important; }

.mti-end2col {
  display: grid; grid-template-columns: 1fr; gap: 22px;
  width: 100%; max-width: 980px; margin: 0 auto; align-items: stretch;
}
@media (min-width: 880px) {
  .mti-end2col { grid-template-columns: minmax(0,532px) minmax(0,420px); justify-content: center; }
}

/* — Carte résultat (gauche) — */
.mti-endcard {
  background: #fff; border-radius: 26px; box-shadow: 0 12px 40px rgba(17,17,17,.07);
  padding: 48px 40px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
}
.mti-endcard__trophy { font-size: 60px; line-height: 1; margin-bottom: 16px; }
.mti-endcard__title { margin: 0; font-size: 38px; font-weight: 800; color: #111; letter-spacing: -1.2px; }
.mti-endcard__sub { margin: 10px 0 0; font-size: 15px; color: #6F6A63; }
.mti-endcard__sub strong { color: #111; font-weight: 700; }
.mti-endcard__score { display: flex; flex-direction: column; align-items: center; margin: 30px 0; }
.mti-endcard__numwrap { position: relative; line-height: 1; }
.mti-endcard__numwrap::before {
  content: ''; position: absolute; left: -2px; right: -2px; bottom: 12px; height: 22px;
  background: #F4B942; border-radius: 5px; z-index: 0;
}
.mti-endcard__num {
  position: relative; z-index: 1; display: block;
  font-size: 120px; font-weight: 800; letter-spacing: -6px; color: #111; padding: 0 6px;
}
.mti-endcard__pts { margin-top: 14px; font-size: 12px; font-weight: 800; letter-spacing: 4px; color: #6F6A63; }
.mti-endcard__btns { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.mti-endcard__replay {
  background: #F4B942; color: #111; border: 0; border-radius: 999px;
  padding: 14px 34px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 20px rgba(244,185,66,.4);
}
.mti-endcard__menu {
  background: #111; color: #fff; border: 0; border-radius: 999px;
  padding: 14px 32px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
}

/* — Carte sauvegarde (droite en solo, sous le récap en multi) — */
.mti-savecard {
  background: #fff; border-radius: 26px; overflow: hidden; box-shadow: 0 12px 40px rgba(17,17,17,.07);
  width: 100%; max-width: 420px; margin: 0 auto; text-align: left; align-self: stretch;
}
.mti-savecard__head { display: flex; align-items: center; gap: 14px; background: #111; padding: 20px 24px; }
.mti-savecard__head-ic {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; background: #F4B942;
  display: flex; align-items: center; justify-content: center; color: #111;
}
.mti-savecard__head-ic svg { width: 19px; height: 19px; }
.mti-savecard__head-tx { display: flex; flex-direction: column; min-width: 0; }
.mti-savecard__head-title { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -.3px; }
.mti-savecard__head-sub { font-size: 11.5px; color: rgba(255,255,255,.55); margin-top: 2px; }
.mti-savecard__body { padding: 20px 24px 24px; }
.mti-savecard__label {
  display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: #6F6A63; margin-bottom: 8px;
}
.mti-savecard__row { display: flex; gap: 10px; }
.mti-savecard__name {
  flex: 1; min-width: 0; background: #F8F3EE; border: 0; border-radius: 12px;
  padding: 13px 16px; font-size: 14px; font-weight: 600; color: #1A1A1A; font-family: inherit;
}
.mti-savecard__name:focus { outline: 2px solid #F4B942; outline-offset: 0; }
.mti-savecard__save {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  background: #F4B942; color: #111; border: 0; border-radius: 12px; padding: 0 20px;
  font-size: 14px; font-weight: 800; cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 14px rgba(244,185,66,.4);
}
.mti-savecard__save svg { width: 16px; height: 16px; }
.mti-savecard__save.is-saved { background: #DCFCE7; color: #15803D; box-shadow: none; }
.mti-savecard__msg { font-size: 12px; margin-top: 8px; }
.mti-savecard__msg.is-ok { color: #15803D; }
.mti-savecard__msg.is-err { color: #c0392b; }
.mti-savecard__sep { display: flex; align-items: center; gap: 10px; margin: 22px 0 14px; }
.mti-savecard__seplbl {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: #6F6A63; white-space: nowrap;
}
.mti-savecard__cnt { background: #FCF3DD; color: #111; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.mti-savecard__sepline { flex: 1; height: 1px; background: rgba(17,17,17,.1); }
.mti-savecard__list { display: flex; flex-direction: column; gap: 12px; max-height: 340px; overflow-y: auto; }

/* — Carte d'une partie sauvegardée — */
.mti-sgame { background: #fff; border-radius: 16px; box-shadow: 0 4px 18px rgba(17,17,17,.05); padding: 16px; }
.mti-sgame__top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mti-sgame__date { flex-shrink: 0; width: 46px; background: #F8F3EE; border-radius: 12px; padding: 7px 0; text-align: center; }
.mti-sgame__d { display: block; font-size: 17px; font-weight: 800; color: #111; line-height: 17px; }
.mti-sgame__mo { display: block; margin-top: 2px; font-size: 9px; font-weight: 700; color: #6F6A63; letter-spacing: 1px; text-transform: uppercase; }
.mti-sgame__info { flex: 1; min-width: 0; }
.mti-sgame__name { font-size: 15.5px; font-weight: 800; color: #111; letter-spacing: -.3px; }
.mti-sgame__meta { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.mti-sgame__mi { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; color: #6F6A63; }
.mti-sgame__mi svg { width: 12px; height: 12px; flex-shrink: 0; }
.mti-sgame__del {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #EAE4DB;
  background: #fff; color: #B7AFA4; font-size: 13px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s, border-color .15s;
}
.mti-sgame__del:hover { background: #FBEDEA; color: #D95C35; border-color: #F2D6CE; }
.mti-sgame__players { display: flex; flex-direction: column; gap: 8px; }
.mti-splayer { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #F0ECE5; border-radius: 14px; padding: 8px 10px; }
.mti-splayer--win { background: #FCF3DD; border-color: #F2E4C0; }
.mti-splayer__av {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 800;
}
.mti-splayer__info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.mti-splayer__name { font-size: 13.5px; font-weight: 700; color: #1A1A1A; }
.mti-splayer__sub { font-size: 11px; color: #6F6A63; margin-top: 1px; }
.mti-splayer__pts { flex-shrink: 0; background: #FCF3DD; color: #111; font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.mti-sgame__empty { font-size: 13px; color: #9A938A; text-align: center; padding: 14px 0; }

/* — Responsive (tablette / mobile) — */
@media (max-width: 879px) {
  #mti-app:has(.mti-end2col) { max-width: 560px; }
  .mti-savecard { max-width: 560px; }
}
@media (max-width: 600px) {
  .mti-endcard { padding: 32px 20px; border-radius: 22px; }
  .mti-endcard__trophy { font-size: 50px; }
  .mti-endcard__title { font-size: 29px; }
  .mti-endcard__num { font-size: 84px; letter-spacing: -4px; }
  .mti-endcard__numwrap::before { height: 16px; bottom: 8px; }
  .mti-savecard { border-radius: 22px; }
  .mti-savecard__row { flex-wrap: wrap; }
  .mti-savecard__save { width: 100%; justify-content: center; padding: 13px 20px; }
}

/* En multijoueur : la carte sauvegarde se place sous le récap des scores */
.mti__end2 ~ .mti-savecard { margin-top: 24px; align-self: center; }

/* — Multijoueur : carte sauvegarde en accordéon sous le tableau des scores — */
.mti__end2-right .mti-savecard,
.mti__end2-body .mti-savecard { max-width: none; width: 100%; margin: 16px 0 0; align-self: stretch; }
.mti-savecard--acc .mti-savecard__head--btn {
  width: 100%; border: 0; cursor: pointer; font-family: inherit; text-align: left; background: #111;
}
.mti-savecard__chev {
  margin-left: auto; flex-shrink: 0; display: flex; color: rgba(255,255,255,.7);
  transition: transform .3s ease;
}
.mti-savecard__chev svg { width: 20px; height: 20px; }
.mti-savecard--acc .mti-savecard__head--btn[aria-expanded="true"] .mti-savecard__chev { transform: rotate(180deg); }
.mti-savecard__panel { overflow: hidden; max-height: 0; transition: max-height .35s ease; }
