/*
 * « Participer à un GM » : le panneau du GM recopié à gauche, la bulle de l'appli accolée à droite de chaque ligne.
 * Sur téléphone, le message de guilde se tient en bas de l'écran ; sur PC, à droite.
 */

/* Le fond de la bulle, entre la carte et la page ; en dur par thème (un color-mix ne suit pas toujours le changement). */
:root { --gm-bub: #F8F2E7; --gm-bub-on: #F2E1C2; --gm-gold: #7A5E00; --gm-slot: #FFFDF8; --gm-slot-edge: #CDBB9C; --gm-slot-ink: #B07A2A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) { --gm-bub: #1D1914; --gm-bub-on: #4D3C1F; --gm-gold: #E8C547; --gm-slot: #2A241C; --gm-slot-edge: #5C4F3B; --gm-slot-ink: #C98E36; }
}
:root[data-theme="sombre"] { --gm-bub: #1D1914; --gm-bub-on: #4D3C1F; --gm-gold: #E8C547; --gm-slot: #2A241C; --gm-slot-edge: #5C4F3B; --gm-slot-ink: #C98E36; }
.gm-page { padding-bottom: 40px; }
.gm-page .page-head { padding-top: 40px; }
.gm-page .page-head .sub { margin-top: 10px; font-size: 18px; }
.gm-app { margin-top: 24px; font-feature-settings: "tnum"; }
.gm-app[aria-busy] { min-height: 420px; }
.gm-app [hidden], .gm-dialog [hidden] { display: none !important; }
.gm-noscript { max-width: 640px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }

/* Les petits éléments partagés */
.gm-label { margin: 0; font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--acc); }
.gm-count { margin-left: 8px; font-size: 13.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--mute); }
.gm-note { margin: 10px 2px 0; font-size: 14px; color: var(--mute); }
.gm-note.warn { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--wash); color: var(--ink); }
.gm-textbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--acc);
  font: 700 15px var(--sans);
  cursor: pointer;
}
.gm-textbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.gm-textbtn svg.i { width: 18px; height: 18px; }
.gm-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gm-choices > * { flex: 1 1 auto; }
.gm-text, .gm-select {
  height: 44px;
  min-width: 0;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: 600 16.5px var(--sans);
}
.gm-select { padding-right: 32px; cursor: pointer; }
/* Ce qui se recopie du jeu, ou se tape : une case un peu en relief, soulignée d'un trait d'encre, comme une ligne à
   remplir ; ce que la page calcule (la bulle) n'en a pas. Focus : tout le tour en ambre. */
.gm-text, .gm-select, .cell { background: var(--gm-slot); border: 1px solid var(--gm-slot-edge); border-bottom: 2px solid var(--gm-slot-ink); }
.gm-text::placeholder { color: var(--mute); font-weight: 400; font-style: italic; }
svg.tgt { width: 15px; height: 15px; flex: none; color: var(--acc); }

/* ── Quel GM ? */
.gm-pick { max-width: 640px; }
.gm-search label { display: block; margin: 0 0 6px; font-weight: 600; font-size: 16px; }
.gm-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--outline);
  background: var(--card);
}
.gm-field:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px var(--glow); }
.gm-field svg { color: var(--mute); }
.gm-field input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink); font: 17px var(--sans); outline: none; }
.gm-field input::placeholder { color: var(--mute); }
.gm-none { margin: 10px 4px 0; color: var(--mute); }
.gm-list { margin: 0; padding: 0; list-style: none; border-radius: 16px; border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.gm-list li + li { border-top: 1px solid var(--line); }
.gm-results { margin-top: 8px; box-shadow: var(--shadow); }
.gm-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 16.5px var(--sans);
  text-align: left;
  cursor: pointer;
}
.gm-item svg { color: var(--mute); }
.gm-item:hover, .gm-go:hover { background: color-mix(in srgb, var(--wash) 45%, transparent); }

.gm-recent { margin-top: 22px; }
.gm-recent-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.gm-recent-head .gm-label { color: var(--mute); }
.gm-recent-row { display: flex; align-items: stretch; }
.gm-go {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-height: 64px;
  padding: 9px 4px 9px 16px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gm-go .l1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.gm-go .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16.5px; font-weight: 600; }
.gm-go .own { flex: none; font-size: 14px; color: var(--mute); }
.gm-go .ago { flex: none; margin-left: auto; font-size: 13.5px; color: var(--mute); }
.gm-go .l2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; color: var(--mute); }
.tone-todo { color: var(--acc); font-weight: 700; }
.tone-ok { color: var(--gain); font-weight: 600; }
.tone-bad { color: var(--loss); font-weight: 600; }
.tone-idle { color: var(--mute); }
.gm-forget { flex: none; display: grid; place-items: center; width: 52px; padding: 0; border: 0; background: none; color: var(--mute); cursor: pointer; }
.gm-forget svg.i { width: 20px; height: 20px; }
.gm-pick > .carry { margin-top: 14px; }
.gm-undo-slot:not(:empty) { margin-bottom: 8px; }

.gm-az { margin-top: 22px; }
.gm-az summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.gm-az summary::-webkit-details-marker { display: none; }
.gm-az[open] summary { border-radius: 16px 16px 0 0; border-bottom: 0; }
.gm-az[open] .gm-list { border-radius: 0 0 16px 16px; }

.gm-example {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1.5px solid var(--acc);
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gm-example .t { font-weight: 700; color: var(--acc); }
.gm-example .s { grid-column: 1; font-size: 14.5px; color: var(--mute); }
.gm-example svg { grid-row: 1 / 3; grid-column: 2; color: var(--acc); }
.gm-example-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--wash); font-weight: 600; }
.gm-import { margin-bottom: 18px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--acc); background: var(--wash); }
.gm-import p { margin: 6px 0 0; }

/* ── Le GM ouvert */
.gm-tabs { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.gm-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: 600 15.5px var(--sans);
  white-space: nowrap;
  cursor: pointer;
}
.gm-tab span { font-size: 14px; font-weight: 400; color: var(--mute); }
.gm-tab[aria-current="page"] { border-color: var(--acc); background: var(--wash); cursor: default; }
.gm-tab .star { width: 16px; height: 16px; color: var(--gold); }
.gm-tab svg.f { fill: currentColor; }
.gm-tab.more svg { width: 18px; height: 18px; color: var(--mute); }
.gm-tab.add { width: 44px; padding: 0; justify-content: center; border-style: dashed; background: none; color: var(--acc); }

/* Sur PC, la carte du GM a la largeur des places (150 + 10 + 340) : le message vient juste à côté. */
.gm-main { display: grid; grid-template-columns: minmax(0, 500px) 400px; gap: 40px; align-items: start; }
.gm-left { min-width: 0; }

.gm-card { padding: 10px 16px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); }
.gm-top { display: flex; align-items: center; gap: 12px; }
.gm-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 20px var(--sans);
  text-align: left;
  cursor: pointer;
}
.gm-name span { line-height: 1.2; }
.gm-name svg { color: var(--mute); }
.gm-rate {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 6px 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--wash);
  color: var(--acc);
  font: 700 18px var(--sans);
  cursor: pointer;
}
.gm-rate svg.i { width: 18px; height: 18px; }
.gm-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; padding: 3px; border-radius: 13px; border: 1px solid var(--line); background: var(--bg); }
.gm-seg button { min-height: 44px; border: 0; border-radius: 10px; background: none; color: var(--mute); font: 600 15px var(--sans); cursor: pointer; }
.gm-seg button[aria-pressed="true"] { background: var(--wash); color: var(--ink); }
.gm-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; font-size: 15px; color: var(--mute); }
.gm-line > label { min-width: 58px; }
.gm-line .gm-text { flex: 1 1 160px; }
.gm-line .gm-select { flex: 1 1 150px; }
.gm-line [hidden] { display: none; }
.gm-next { white-space: nowrap; }
.copper { color: var(--copper); font-weight: 600; }
.gold { color: var(--gm-gold); font-weight: 700; }
.gm-tag { margin-left: 6px; padding: 1px 8px; border-radius: 9px; background: var(--wash); color: var(--acc); font-size: 12.5px; font-weight: 700; }
.gm-cost-out { min-height: 44px; padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; white-space: nowrap; text-decoration: underline dotted; text-underline-offset: 4px; cursor: pointer; }

.cell {
  width: 100px;
  height: 44px;
  padding: 0 10px;
  border-radius: 9px;
  color: var(--ink);
  font: 600 17px var(--sans);
  font-feature-settings: "tnum";
  text-align: right;
}
.cell.lv { width: 64px; }
/* Le niveau : − et + de part et d'autre de la case, d'un seul bloc ; on tape encore, rarement. */
.gm-stepper { display: inline-flex; align-items: stretch; }
.gm-step { flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); background: var(--card); color: var(--acc); font: 700 22px/1 var(--sans); cursor: pointer; }
.gm-step:first-child { border-radius: 9px 0 0 9px; border-right: 0; }
.gm-step:last-child { border-radius: 0 9px 9px 0; border-left: 0; }
.gm-step:disabled { color: var(--mute); opacity: .45; cursor: default; }
.gm-stepper .cell.lv { border-radius: 0; text-align: center; }
.cell.big { width: 120px; }
.cell::placeholder { color: var(--mute); font-weight: 400; font-style: italic; }
.cell:focus { outline: none; border: 2px solid var(--acc); background: var(--card); }
.cell.bad, .cell[aria-invalid] { border: 2px solid var(--loss); color: var(--loss); }
.cell:disabled { border-style: dashed; background: none; }

.gm-foldline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mute);
  font: 15px var(--sans);
  font-feature-settings: "tnum";
  text-align: left;
  cursor: pointer;
}
.gm-foldline span:first-child { flex: 1; min-width: 0; }
.gm-card [data-out=full][hidden] + .gm-line { margin-top: 4px; }
.gm-clearline { margin: 6px 0 0; }
.gm-clearline .gm-textbtn { min-height: 44px; color: var(--mute); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.gm-edit { flex: none; color: var(--acc); font-weight: 700; }
.gm-foldline:hover .gm-edit { text-decoration: underline; text-underline-offset: 3px; }
.gm-bar { height: 4px; margin-top: 12px; border-radius: 2px; background: var(--line); overflow: hidden; }
.gm-bar i { display: block; width: 0; height: 100%; border-radius: 2px; background: var(--acc); transition: width .3s var(--ease); }
.gm-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 0; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--wash); font-weight: 600; }
.gm-banner[hidden] { display: none; }

.gm-rates { margin-top: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.gm-rates .gm-line { margin-top: 10px; }
.gm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.gm-chip-wrap { display: inline-flex; align-items: stretch; border-radius: 999px; border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.gm-chip { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--ink); font: 700 15.5px var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.gm-chip span { font-weight: 400; color: var(--mute); font-size: 13.5px; }
.gm-chip[aria-pressed="true"] { background: var(--wash); color: var(--acc); }
.gm-chip-x { display: grid; place-items: center; width: 40px; padding: 0; border: 0; border-left: 1px solid var(--line); background: none; color: var(--mute); cursor: pointer; }
.gm-chip-x svg.i, .gm-chip-add svg.i { width: 16px; height: 16px; }
/* La place libre : en creux, comme dans l'appli. */
.gm-chip-add { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px dashed var(--line); background: none; color: var(--mute); cursor: pointer; }
.gm-problem { margin: 6px 0 0; color: var(--loss); font-size: 14.5px; font-weight: 600; }
.gm-problem[hidden] { display: none; }

/* La ligne d'aide : toujours la même hauteur, pour que rien ne bouge sous le doigt quand elle change. */
.gm-status {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  margin: 8px 0 0;
  padding: 0 4px;
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--mute);
  overflow: hidden;
}
.gm-status span { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gm-status .ghost { flex: none; }
.gm-status.bad { color: var(--loss); font-weight: 600; }
.gm-status.bad svg.i { color: var(--loss); }
.gm-status.idle { color: var(--mute); }

/* Les lignes : la case du jeu, et la bulle accolée à droite. */
.gm-r { display: grid; grid-template-columns: 150px minmax(0, 340px); column-gap: 10px; }
.gm-r[hidden] { display: none; }
.gm-l { display: flex; align-items: center; gap: 8px; min-height: 54px; }
.gm-rhead .lh { align-self: end; display: grid; gap: 4px; padding: 0 0 6px; font-size: 13px; color: var(--mute); }
.gm-rhead .lh-game { padding-left: 42px; }
/* « hors places 38 027 » : le libellé sous les P, le nombre calé sur les nombres des cases ; trop long, il passe dessous. */
.gm-rhead .lh-owner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 6px; padding-right: 11px; font-size: 14px; }
.gm-rhead .lh-owner .l { font-size: 12.5px; white-space: nowrap; }
.gm-rhead .lh-owner .n { margin-left: auto; }
.gm-rhead .lh-owner[hidden] { display: none; }
.gm-rhead .lh-owner .n { color: var(--ink); font-weight: 600; font-feature-settings: "tnum"; }
.pl { display: grid; width: 34px; font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1; color: var(--acc); cursor: pointer; }
.pl .me { margin-top: 2px; font-family: var(--sans); font-size: 11.5px; font-weight: 700; letter-spacing: .5px; color: var(--gain); }
.gm-bcell { display: flex; transition: opacity .2s; }
/* La réponse du serveur tarde : l'ancienne bulle reste lisible, un peu effacée, jusqu'à la nouvelle. */
.gm-slow .gm-bcell, .gm-slow [data-out=owner-fp] { opacity: .5; }
.gm-b {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
  min-height: 54px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-top: 1px solid var(--line);
  border-left: 1.5px solid var(--outline);
  border-right: 1.5px solid var(--outline);
  background: var(--gm-bub);
  color: var(--ink);
  font: 16px var(--sans);
  font-feature-settings: "tnum";
  text-align: right;
  white-space: nowrap;
}
button.gm-b { cursor: pointer; transition: background-color .15s; }
button.gm-b:hover { background: var(--gm-bub-on); }
.gm-b.on, button.gm-b.on:hover { background: var(--wash); }
.gm-b.hd { min-height: 32px; align-items: end; padding-bottom: 6px; border-top: 1.5px solid var(--outline); border-radius: 18px 18px 0 0; font-size: 13px; color: var(--mute); }
/* « proposer » une ligne au-dessus, calé sur les ronds : il ne se lit pas à la suite de « à poser ». */
.gm-b.hd.mine { min-height: 48px; }
.gm-b.hd .ring-head { align-self: start; padding: 7px 6px 0 0; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--acc); }
.gm-b.end { border-bottom: 1.5px solid var(--outline); border-radius: 0 0 18px 18px; }
.gm-b.snipe-row { min-height: 42px; border-top: 0; }
.gm-b.take-row { grid-template-columns: 1fr; min-height: 52px; border-top: 0; padding-right: 10px; }
.gm-b.take-row .ghost { justify-self: end; }
.gm-b > span { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.gm-b .span { grid-column: 1 / 3; }
.gm-b.mine { grid-template-columns: 1fr 1fr 22px; column-gap: 8px; padding-right: 10px; }
.ring { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--outline); }
.ring.none { border: 0; }
.ring.on { border-color: var(--acc); background: var(--acc); }
.gm-b .ring.on svg.i { width: 15px; height: 15px; color: var(--on-acc); stroke-width: 3; }
.gm-b svg.i { width: 18px; height: 18px; color: var(--acc); stroke-width: 2.6; }
.gm-b .rw { font-weight: 600; }
.gm-b .post { font-weight: 700; color: var(--acc); }
.gm-b .zero, .gm-b .q { color: var(--mute); }
.gm-b .taken, .gm-b .secured, .gm-b .gain { color: var(--gain); font-weight: 600; }
.gm-b .secured { white-space: nowrap; }
.gm-b .sniped, .gm-b .loss { color: var(--loss); font-weight: 600; }
/* Prise ou snipée par un joueur repoussé : qui, en petit dessous. */
.gm-b .by { flex-direction: column; align-items: flex-end; gap: 0; line-height: 1.15; }
.gm-b .by > span { display: inline-flex; align-items: center; gap: 4px; }
.gm-b .by small { font-size: 12px; font-weight: 500; color: var(--mute); white-space: nowrap; }
.gm-b .sniped svg.tgt { color: var(--loss); }

/* Dans l'ordre */

.gm-keys { margin: 4px 0 0; font-size: 13.5px; color: var(--mute); }
.gm-keys kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--card); font: 12.5px var(--sans); }

/* Le message */
.gm-side { display: grid; gap: 16px; position: sticky; top: 92px; }
.gm-dock { padding: 14px 16px 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.gm-dock[hidden], .gm-dock [hidden] { display: none; }
.gm-who { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-size: 15px; color: var(--mute); }
.gm-who .gm-text { flex: 1; }
.gm-msg { flex: 1; min-width: 0; margin: 0; padding: 6px 12px; border-radius: 10px; border: 1px dashed var(--outline); background: var(--bg); font-size: 16px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.gm-token { display: inline-flex; align-items: center; min-height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--acc); font: inherit; vertical-align: middle; cursor: pointer; }
.gm-token.empty { border-style: dashed; color: var(--mute); font-weight: 400; font-style: italic; }
.gm-warn { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--wash); font-size: 14px; line-height: 1.4; }
.gm-warn svg.i { width: 18px; height: 18px; color: var(--acc); }
.gm-warn span { flex: 1 1 200px; }
.gm-warn .ghost { margin-left: auto; }
.gm-msgrow { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.gm-msgrow .btn { flex: none; }
.gm-msgrow .btn svg.i { width: 18px; height: 18px; }

.gm-source { margin: 28px 0 0; font-size: 14px; color: var(--mute); }
/* La porte vers l'appli : de quoi la découvrir, et sur PC un QR pour l'ouvrir sur le téléphone. */
.gm-door { display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; max-width: 940px; margin-top: 48px; padding: 24px 28px; border-radius: 24px; border: 1px solid var(--line); background: var(--card); }
.gm-door [hidden] { display: none !important; }
.gm-door-text { max-width: 560px; }
.gm-door-text .kicker { margin-bottom: 8px; }
.gm-door-text h2 { margin: 0; font-family: var(--serif); font-size: 28px; line-height: 1.15; }
.gm-door-text p:not(.kicker) { margin: 10px 0 0; color: var(--mute); }
.gm-door-text .gm-door-meta { font-size: 14px; }
.gm-door .btn { margin-top: 20px; }
.gm-door-qr { flex: none; display: grid; justify-items: center; gap: 10px; margin: 0; }
.gm-door-qr svg { width: 132px; height: 132px; border-radius: 10px; background: #fff; }
.gm-door-qr figcaption { max-width: 150px; font-size: 14px; color: var(--mute); text-align: center; }

.gm-toast-slot { position: fixed; left: 50%; bottom: 24px; z-index: 50; width: min(560px, calc(100% - 32px)); translate: -50% 0; pointer-events: none; }
.gm-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 8px 6px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: rise .25s var(--ease) both;
}
.gm-toast span { flex: 1; }
.gm-toast .gm-textbtn { color: var(--wash); }
.gm-undo-slot .gm-toast { background: var(--wash); color: var(--ink); box-shadow: none; }
.gm-undo-slot .gm-toast .gm-textbtn { color: var(--acc); }

.gm-dialog { width: min(460px, calc(100% - 32px)); padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-lg); }
.gm-dialog::backdrop { background: rgba(23, 20, 16, .5); }
.gm-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gm-dialog h2 { margin: 0; font: 700 21px var(--serif); }
.gm-dialog p { margin: 8px 0 0; }
.gm-dialog .gm-text { width: 100%; margin-top: 12px; font: 13.5px var(--mono); }
.gm-round { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: 50%; background: none; color: var(--mute); cursor: pointer; }
.gm-qr { display: grid; justify-items: center; gap: 6px; margin: 14px 0 0; }
.gm-qr svg { width: 220px; height: 220px; border-radius: 10px; background: #fff; }
.gm-qr figcaption { font-size: 14px; color: var(--mute); }

/* Pour les nouveaux : ce que fait la page, sous l'outil. */
.gm-about { margin-top: 64px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 24px; }
.gm-about h2 { margin: 0 0 6px; font: 700 19px var(--serif); }
.gm-about p { margin: 0; max-width: 68ch; color: var(--mute); font-size: 16px; }
/* Le GM ouvert ne garde que le bloc qui le concerne. */
.gm-page[data-owner="mine"] [data-about="other"], .gm-page[data-owner="other"] [data-about="mine"] { display: none; }

.gm-page.is-open .page-head { padding-top: 22px; }
.gm-page.is-open .page-head .kicker, .gm-page.is-open .page-head .sub { display: none; }
.gm-page.is-open .page-head .h2 { font-size: 28px; }
.gm-page.is-open .gm-app { margin-top: 14px; }

@media (max-width: 1060px) {
  .gm-main { grid-template-columns: minmax(0, 500px) 340px; gap: 28px; }
}

/* Sur téléphone : une colonne, le message en bas de l'écran, caché pendant la frappe (le clavier prend la place). */
@media (max-width: 880px) {
  body.gm-typing .cell, body.gm-typing .gm-select, body.gm-typing .gm-text { scroll-margin-top: 50px; scroll-margin-bottom: 16px; }
  .gm-page .page-head { padding-top: 24px; }
  .gm-page .page-head .h2 { font-size: 28px; }
  .gm-page .page-head .sub { font-size: 16.5px; }
  .gm-app { margin-top: 16px; }
  /* Un GM ouvert : l'en-tête se tasse, l'outil remonte. */
  .gm-page.is-open .page-head { padding-top: 14px; }
  .gm-page.is-open .page-head .kicker, .gm-page.is-open .page-head .sub { display: none; }
  .gm-page.is-open .page-head .h2 { font-size: 22px; }
  .gm-page.is-open .gm-app { margin-top: 10px; }
  .gm-tabs, .gm-keys { display: none; }
  .gm-main { display: block; }
  .gm-side { position: static; margin-top: 20px; }
  .gm-r { grid-template-columns: 128px minmax(0, 1fr); column-gap: 8px; }
  .gm-rhead .lh-game { padding-left: 38px; }
  .gm-name { font-size: 18px; }
  .pl { width: 28px; }
  .cell { width: 92px; }
  .cell.big { width: 112px; }
  .gm-b { padding: 0 10px; font-size: 15.5px; }
  .gm-status { height: 60px; font-size: 14px; }
  .gm-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    border-width: 1px 0 0;
    box-shadow: 0 -14px 30px -22px rgba(0, 0, 0, .5);
  }
  /* La ligne d'aide suit la frappe : collée sous l'en-tête du site quand le clavier pousse la page. */
  body.gm-typing .gm-status { position: sticky; top: 60px; z-index: 5; background: var(--bg); box-shadow: 0 10px 12px -12px rgba(0, 0, 0, .35); }
  body.gm-has-dock .gm-page { padding-bottom: 190px; }
  body.gm-typing .gm-dock { display: none; }
  .gm-toast-slot { bottom: 16px; }
  body.gm-has-dock:not(.gm-typing) .gm-toast-slot { bottom: 180px; }
  .gm-about { grid-auto-flow: row; gap: 18px; margin-top: 40px; }
  .gm-door { margin-top: 36px; padding: 20px 18px; border-radius: 20px; }
  .gm-door-text h2 { font-size: 24px; }
  .gm-door .btn { width: 100%; }
}
