/* Pikazam
   Une seule colonne, aucune carte. L'écran est une caméra thermique (thermal.js) : les paliers suivent
   la rampe infrarouge, de l'indigo au blanc. Une seule famille, Martian Mono, une mono d'instrument
   jouée en largeurs : étroite pour le texte et les chiffres, large pour la marque et les titres. */

:root {
  --bg: #F2F3F5;
  --sheet: #FFFFFF;
  --ink: #0F1013;
  --ink-2: #45484F;
  --muted: #62666F;
  --rule: #DCDFE3;
  --rule-2: #C7CBD1;
  --scrim: rgba(12, 13, 16, .45);
  --glow: .16;

  --glacial: #3A2FC4;
  --froid: #7A27B8;
  --tiede: #B8236E;
  --chaud: #DB3F1A;
  --brulant: #D46A00;
  --bouillant: #B58300;
  --win: #0F1013;
  --heat: var(--rule);
  /* une seule couleur d'accent, tirée de la rampe (brûlant) : texte et traits en --accent (AA sur le fond),
     aplats en --accent-fill avec texte --on-accent */
  --accent: #B84A00;
  --accent-fill: #FF9B21;
  --on-accent: #0F1013;
  --hot-off: grayscale(1) brightness(.85);

  --p1: #13998F; --p2: #4F5FF0; --p3: #D2408F; --p4: #6E9F22; --p5: #C98C10; --p6: #5F6E84;

  --f: "Martian Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07060B; --sheet: #121019; --ink: #ECEDF0; --ink-2: #B3B6BD; --muted: #8A8E99; --rule: #1E2024; --rule-2: #2C2F35; --scrim: rgba(0,0,0,.62); --glow: .22;
    --glacial: #6A62FF; --froid: #A84DEB; --tiede: #E8418F; --chaud: #FF5B33; --brulant: #FF9B21; --bouillant: #FFD54A; --win: #FFF4D6;
    --accent: #FF9B21; --accent-fill: #FF9B21; --on-accent: #07060B; --hot-off: grayscale(1) brightness(2.1);
    --p1: #33C2B6; --p2: #7D8BFF; --p3: #EE6AAE; --p4: #96C64A; --p5: #E7B33A; --p6: #93A1B6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07060B; --sheet: #121019; --ink: #ECEDF0; --ink-2: #B3B6BD; --muted: #8A8E99; --rule: #1E2024; --rule-2: #2C2F35; --scrim: rgba(0,0,0,.62); --glow: .22;
  --glacial: #6A62FF; --froid: #A84DEB; --tiede: #E8418F; --chaud: #FF5B33; --brulant: #FF9B21; --bouillant: #FFD54A; --win: #FFF4D6;
    --accent: #FF9B21; --accent-fill: #FF9B21; --on-accent: #07060B; --hot-off: grayscale(1) brightness(2.1);
  --p1: #33C2B6; --p2: #7D8BFF; --p3: #EE6AAE; --p4: #96C64A; --p5: #E7B33A; --p6: #93A1B6;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--f); font-size: 14px; line-height: 1.55; font-stretch: 75%; font-variation-settings: "wdth" 75; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* l'écran chauffe : halo fixe, teinté par --heat */
.glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--heat); opacity: var(--glow);
  -webkit-mask-image: radial-gradient(140% 75% at 50% -10%, #000 0%, transparent 62%);
  mask-image: radial-gradient(140% 75% at 50% -10%, #000 0%, transparent 62%);
  transition: background-color 1.2s ease, opacity 1.2s ease;
}
.glow.is-pulse { animation: glowPulse 1.4s ease-out; }
@keyframes glowPulse { 0% { opacity: calc(var(--glow) * 2.8); } 100% { opacity: var(--glow); } }

/* le contenu prend la largeur de l'écran, plafonné pour les très grands écrans ; le fond thermique, lui, couvre tout */
.col {
  max-width: 1180px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- haut de page ---------- */
.top { display: flex; align-items: center; gap: 18px; padding-block: 18px 0; }
.mark { font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 21px; letter-spacing: -.01em; text-decoration: none; color: var(--ink); line-height: 1; }
.mark b { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 16px; margin-left: auto; }
.nav button, .tool {
  appearance: none; border: 0; background: none; padding: 6px 0; font-weight: 600; font-size: 15px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.nav button:hover { color: var(--ink); }
.nav button[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.tools { display: flex; gap: 4px; }
.tool { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--rule-2); font-size: 14px; }
.tool:hover { color: var(--ink); border-color: var(--ink); }
.tool svg { width: 16px; height: 16px; }
/* piment éteint : silhouette grise mais nette, contour en pointillés ; allumé : couleur et halo */
.tool--hot { font-size: 15px; line-height: 1; border-style: dashed; transition: border-color .3s, box-shadow .3s; }
.tool--hot .emo { display: block; filter: var(--hot-off); transition: filter .3s; }
.tool--hot[aria-pressed="true"] { border-style: solid; border-color: var(--chaud); box-shadow: 0 0 14px color-mix(in srgb, var(--chaud) 45%, transparent); }
.tool--hot[aria-pressed="true"] .emo { filter: none; }
.fx-emoji { position: fixed; z-index: 45; pointer-events: none; line-height: 1; will-change: transform, opacity; }
.tool--flag svg { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px var(--rule-2); }

/* ---------- liens texte et boutons ---------- */
.link { appearance: none; border: 0; background: none; padding: 0; font-weight: 600; color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.link:hover { text-decoration-color: var(--accent); }
.link--muted { color: var(--muted); text-decoration-color: var(--rule-2); }
.link--muted:hover { color: var(--ink); text-decoration-color: var(--ink); }
.btn {
  appearance: none; height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--accent-fill); color: var(--on-accent); font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: filter .15s;
}
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn--line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule-2); }
.btn--line:not(:disabled):hover { box-shadow: inset 0 0 0 1.5px var(--ink); filter: none; }
/* étiquette : petites capitales espacées, couleur secondaire ; elle annonce, la valeur parle */
.eyebrow, .field label, .label-like, .sheet__k {
  font-stretch: 100%; font-variation-settings: "wdth" 100; font-size: 11px; font-weight: 600; line-height: 1.3;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.btn--block { width: 100%; }
.btn:disabled { opacity: .35; cursor: default; }

/* ---------- vue jeu ---------- */
.modes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 34px; font-size: 15px; }
.modes button { white-space: nowrap; appearance: none; border: 0; background: none; padding: 0; font-weight: 600; color: var(--muted); }
.modes button:hover { color: var(--ink); }
.modes button[aria-pressed="true"] { color: var(--ink); }
/* chiffres clés : n° du jour, joueurs en ligne */
.modes b, .live b { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 1.45em; line-height: 1; letter-spacing: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.modes button:not([aria-pressed="true"]) b { color: inherit; }
.live { margin-left: auto; color: var(--muted); font-size: 13.5px; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center; animation: breathe 2.4s infinite; }
@keyframes breathe { 50% { opacity: .35; } }

.hero { margin-top: 10px; }
.hero__t {
  font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: clamp(96px, 30vw, 176px); white-space: nowrap; line-height: .8; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--heat); transition: color 1.2s; margin-left: -.03em;
}
/* aucun mot : le relevé attend, en contour */
.hero__t.is-empty { color: transparent; -webkit-text-stroke: 1.5px var(--muted); }
.hero__w { margin-top: 14px; font-weight: 700; font-size: 30px; line-height: 1.05; letter-spacing: -.015em; overflow-wrap: anywhere; }
.hero__d { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.hero__d b { font-weight: 700; color: var(--heat); transition: color 1.2s; }

/* coop */
.coop { margin-top: 26px; display: grid; gap: 10px; }
.coop__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.coop__score { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 44px; line-height: .9; font-variant-numeric: tabular-nums; color: var(--accent); }
.coop__score small { white-space: nowrap; font-stretch: 100%; font-variation-settings: "wdth" 100; font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.coop__bar { display: flex; height: 6px; gap: 2px; border-radius: 3px; overflow: hidden; background: var(--rule); }
.coop__bar i { display: block; height: 100%; transition: flex-grow .8s cubic-bezier(.2,.8,.2,1); }
.coop__who { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink-2); }
.coop__who span { display: inline-flex; align-items: baseline; gap: 6px; }
.coop__who i { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.coop__who b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.coop__who .away { opacity: .45; }

/* saisie */
.guess { margin-top: 30px; display: flex; align-items: center; gap: 10px; border-bottom: 2px solid var(--ink); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding-top: 8px; }
.guess input { flex: 1; min-width: 0; height: 58px; border: 0; background: transparent; outline: none; font-size: 26px; font-weight: 600; letter-spacing: -.01em; padding: 0; }
.guess input::placeholder { color: var(--muted); font-weight: 400; }
.guess:focus-within { border-bottom-color: var(--accent); }
.guess button { appearance: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.guess button svg { width: 18px; height: 18px; }
.guess button:disabled { opacity: .3; }
.guess.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.status { min-height: 24px; margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }
.status[data-tone="err"] { color: var(--brulant); }
.status b { color: var(--ink); }

/* liste */
.bar { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; font-size: 14px; color: var(--muted); }
.bar #listCount { white-space: nowrap; }
.bar .sort { display: flex; gap: 12px; }
.bar .sort button { appearance: none; border: 0; background: none; padding: 0; color: var(--muted); font-weight: 600; }
.bar .sort button:hover { color: var(--ink); }
.bar .sort button[aria-pressed="true"] { color: var(--accent); }
.bar .end { margin-left: auto; display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 520px) { .bar .end { width: 100%; margin-left: 0; } }
.rows { list-style: none; margin: 8px 0 0; padding: 0; }
.row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 14px; padding: 13px 0 14px; border-top: 1px solid var(--rule); }
.row__w { font-size: 20px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.row__who { font-size: 13px; font-weight: 600; }
.row__pts { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row__t { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.row__t small { font-stretch: 100%; font-variation-settings: "wdth" 100; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 8px; letter-spacing: 0; }
.row__line { grid-column: 1 / -1; height: 2px; margin-top: 8px; background: var(--rule); position: relative; }
.row__line i { position: absolute; inset: 0 auto 0 0; }
.row.is-last { background: linear-gradient(90deg, color-mix(in srgb, var(--heat) 10%, transparent), transparent 70%); }
.row.is-last::before { content: ""; position: absolute; left: -12px; top: 18px; width: 4px; height: 18px; border-radius: 2px; background: var(--ink); }
.row.is-fresh { animation: fresh 1.8s ease-out; }
@keyframes fresh { 0% { background: color-mix(in srgb, var(--tiede) 22%, transparent); } 100% { background: transparent; } }
.row.is-ghost { color: var(--muted); border-top-style: dashed; }
.row.is-ghost .row__w { font-weight: 500; font-style: italic; }
.caret { display: inline-block; width: 2px; height: .95em; margin-left: 1px; vertical-align: -2px; background: currentColor; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: breathe 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }

.empty { padding: 26px 0 8px; border-top: 1px solid var(--rule); color: var(--ink-2); max-width: 46ch; }
.empty p { margin: 0 0 14px; }
.scale { display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale span:nth-child(3) { text-align: center; } .scale span:nth-child(4) { text-align: center; } .scale span:last-child { text-align: right; }
.scale__bar { grid-column: 1 / -1; height: 6px; border-radius: 1px;
  background: linear-gradient(90deg, #1F1A6E, #5C1F9E 25%, #B0217D 45%, #E8432E 62%, #FF8A12 76%, #FFD23F 90%, #fff); }

.foot { margin-top: 44px; padding-block: 22px calc(40px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); display: grid; gap: 10px; font-size: 14.5px; color: var(--ink-2); }
.foot .streak { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 40px; line-height: .9; color: var(--accent); }
.foot .streak small { font-stretch: 100%; font-variation-settings: "wdth" 100; font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 8px; }
.foot .demo { font-size: 12.5px; color: var(--muted); }

/* ---------- classements ---------- */
.page-t { margin: 36px 0 0; font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.02em; }
.page-d { margin: 10px 0 0; color: var(--ink-2); max-width: 46ch; }
.tabs { display: flex; gap: 18px; margin-top: 24px; border-bottom: 1px solid var(--rule); }
.tabs button { appearance: none; border: 0; background: none; padding: 0 0 10px; margin-bottom: -1px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.board { list-style: none; margin: 0; padding: 0; }
.brow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.brow__r { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--muted); }
.brow:nth-child(1) .brow__r { color: var(--bouillant); }
.brow:nth-child(2) .brow__r { color: var(--brulant); }
.brow:nth-child(3) .brow__r { color: var(--chaud); }
.brow__n { min-width: 0; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow__n .tag { font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 12px; color: var(--muted); margin-left: 6px; letter-spacing: .02em; }
.brow__n small { display: block; font-weight: 400; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brow__v { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; text-align: right; }
.brow__v small { font-stretch: 100%; font-variation-settings: "wdth" 100; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-left: 5px; }
.brow.is-me { position: relative; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent 75%); }
.brow.is-me::before { content: ""; position: absolute; left: -12px; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--accent); }
/* « toi » reste sur la ligne du nom, le détail passe dessous */
.brow.is-me .brow__n { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.brow.is-me .brow__n small { flex-basis: 100%; order: 2; }
.brow.is-me .brow__n::after { content: "toi"; order: 1; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.gap { padding: 6px 0; text-align: center; color: var(--muted); border-bottom: 1px solid var(--rule); letter-spacing: .3em; }
.board-h { margin: 26px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
#boardFast .board-h { margin-top: 34px; }
.boards { display: grid; }
.win__pods { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.win__pods h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.win__pods ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.win__pods li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; align-items: baseline; padding: 2px 6px; border-radius: 6px; }
.win__pods li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win__pods li em { font-style: normal; font-variant-numeric: tabular-nums; opacity: .85; }
.win__pods li.is-me { background: rgba(255,255,255,.2); font-weight: 700; }
#dlgWin.is-lost .win__pods li.is-me { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.board-note { margin-top: 14px; font-size: 13.5px; color: var(--muted); }

/* ---------- clan ---------- */
.clan-tag { margin-top: 36px; font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 900; font-size: clamp(72px, 24vw, 128px); line-height: .82; letter-spacing: -.03em; }
.clan-name { margin-top: 10px; font-weight: 700; font-size: 22px; }
.clan-meta { margin-top: 4px; color: var(--ink-2); }
.clan-stats { margin-top: 26px; display: flex; gap: 34px; flex-wrap: wrap; }
.clan-stats div { display: grid; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.clan-stats b { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 48px; line-height: .9; letter-spacing: -.01em; text-transform: none; color: var(--accent); font-variant-numeric: tabular-nums; }
.clan-actions { margin-top: 26px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.h3 { margin: 38px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--rule); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pitch { margin-top: 26px; display: grid; gap: 14px; }
.pitch p { margin: 0; color: var(--ink-2); }
.form { display: grid; gap: 14px; min-width: 0; }
.form__t { margin: 0; font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 19px; letter-spacing: -.01em; }
.field { display: grid; gap: 6px; min-width: 0; }
.field input { appearance: none; width: 100%; min-width: 0; height: 50px; padding: 0; border: 0; border-bottom: 1.5px solid var(--rule-2); border-radius: 0; background: transparent; outline: none; font-size: 20px; font-weight: 600; }
.field input:focus { border-bottom-color: var(--accent); }
.field input::placeholder { color: var(--muted); font-weight: 400; opacity: .7; }
.field input.code { font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.field input.code::placeholder { text-transform: none; letter-spacing: .02em; }
.form-err { min-height: 1.3em; font-size: 14px; color: var(--brulant); }
.form-err:empty { min-height: 0; }
.form__gap { display: none; }
/* fonder / rejoindre : deux colonnes dès qu'il y a la place, sur des lignes partagées (subgrid) :
   titres, libellés, champs et boutons tombent à la même hauteur des deux côtés */
.forms { container-type: inline-size; margin-top: 28px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
.split .form { padding-top: 18px; border-top: 2px solid var(--ink); }
@container (min-width: 520px) {
  .split { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); gap: 14px 40px; }
  .split .form { grid-row: span 5; grid-template-rows: subgrid; gap: 14px; }
  .split .form__gap { display: block; }
  .split .form-err:empty { min-height: 1.3em; }
  .split .btn { align-self: end; }
}

/* ---------- feuilles (dialogues) ---------- */
dialog {
  width: min(560px, 100vw); max-width: 100vw; max-height: calc(100dvh - 40px); margin: auto auto 0; padding: 0; border: 0;
  border-radius: 20px 20px 0 0; background: var(--sheet); color: var(--ink); overflow: auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 640px) { dialog { margin: auto; border-radius: 20px; } }
dialog::backdrop { background: var(--scrim); }
dialog[open] { animation: up .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet { padding: 22px max(22px, env(safe-area-inset-left, 0px)) 26px; display: grid; gap: 18px; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet__t { margin: 0; font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 24px; letter-spacing: -.02em; }
.sheet p { margin: 0; color: var(--ink-2); }
.swatches { display: flex; gap: 10px; }
.swatch { appearance: none; width: 30px; height: 30px; border-radius: 50%; border: 0; box-shadow: 0 0 0 3px var(--sheet), 0 0 0 4px transparent; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--sheet), 0 0 0 5px var(--ink); }
.seg2 { display: flex; gap: 18px; }
.seg2 button { appearance: none; border: 0; background: none; padding: 0 0 6px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.seg2 button:hover { color: var(--ink); }
.seg2 button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.rules { display: grid; gap: 12px; }
.rules p b { color: var(--ink); }
#dlgRules.is-intro .more { display: none; }
.sheet__k { margin-bottom: 4px; }
#rulesEx .row { padding: 9px 0 10px; }
#rulesEx .row__w { font-size: 17px; }
#rulesEx .row__t { font-size: 23px; }

/* fin de manche : plein écran */
#dlgWin { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; background: #07060B; color: #fff; }
#dlgWin.is-lost { background: var(--ink); color: var(--bg); }
#dlgWin::backdrop { background: #07060B; }
.win:focus { outline: none; }
.win { min-height: 100%; display: flex; flex-direction: column; padding: calc(28px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-left, 0px)) calc(26px + env(safe-area-inset-bottom, 0px)); max-width: 1180px; margin: 0 auto; gap: 22px; }
/* téléphone : une seule colonne, les deux blocs se fondent dans le flux */
.win__main, .win__side { display: contents; }
.win__k { font-weight: 600; opacity: .8; }
.win__w { font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 900; font-size: clamp(54px, 17vw, 112px); line-height: .85; letter-spacing: -.03em; overflow-wrap: anywhere; }
.win__s { font-size: 19px; line-height: 1.4; max-width: 34ch; }
.win__s b { font-weight: 800; }
#dlgWin:not(.is-lost) .win__s b { color: #FF9B21; } /* l'écran de victoire est toujours sombre : accent du thème sombre */
.win__contrib { display: grid; gap: 8px; }
.win__contrib div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; font-size: 15px; }
.win__contrib i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.85); }
#dlgWin.is-lost .win__contrib i { background: var(--bg); }
.win__near { font-size: 15px; opacity: .9; line-height: 1.6; }
.win__near span { white-space: nowrap; }
.win__near small { opacity: .7; }
.win__act { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.win__act .btn { background: #FF9B21; color: #07060B; }
.win__act .btn--line { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
#dlgWin.is-lost .win__act .btn { background: var(--bg); color: var(--ink); }
#dlgWin.is-lost .win__act .btn--line { background: transparent; color: var(--bg); box-shadow: inset 0 0 0 1.5px var(--bg); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 520px) {
  /* sur téléphone, la navigation passe sous la marque et les outils : rien ne déborde */
  .top { gap: 12px; flex-wrap: wrap; row-gap: 12px; }
  .tools { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 20px; }
  .mark { font-size: 18px; }
  .nav button { font-size: 14.5px; }
  .modes { margin-top: 26px; }
  .live { order: 3; width: 100%; margin-left: 0; }
  body.is-playing .modes { margin-top: 18px; }
  body.is-playing .hero__t { font-size: clamp(80px, 23vw, 176px); }
  body.is-playing .hero__w { margin-top: 8px; font-size: 22px; }
  body.is-playing .coop { margin-top: 16px; gap: 8px; }
  body.is-playing .coop__score { font-size: 34px; }
  body.is-playing .guess { margin-top: 18px; }
  .hero__w { font-size: 26px; }
  .split { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- duel ---------- */
.duel { margin-top: 26px; display: grid; gap: 10px; }
.duel__t { font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 22px; letter-spacing: -.01em; }
.duel__t span { font-stretch: 100%; font-variation-settings: "wdth" 100; font-weight: 500; font-size: 14px; color: var(--muted); letter-spacing: 0; }
.duel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.duel__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; font-size: 15px; }
.duel__row b { font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }
.duel__row small { color: var(--muted); font-size: 13px; margin-left: 6px; }
.duel__bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.duel__bar i { display: block; height: 100%; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.duel__row.is-me .duel__name { font-weight: 700; }

/* ---------- reactions ---------- */
.team-coop .row[data-id] { cursor: pointer; }
.row__reacts { display: inline-flex; gap: 4px; }
.row__reacts span { font-size: 12.5px; padding: 1px 6px; border-radius: 999px; background: var(--rule); color: var(--ink); font-variant-numeric: tabular-nums; }
.react-pick { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 8px; }
.react-pick button { appearance: none; border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 999px; width: 40px; height: 34px; font-size: 18px; line-height: 1; }
.react-pick button:hover { border-color: var(--ink); }

/* ---------- courbe et badges ---------- */
.win__curve svg { display: block; width: 100%; height: 96px; overflow: visible; }
.win__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.win__badges span { font-size: 13.5px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.18); }
#dlgWin.is-lost .win__badges span { background: color-mix(in srgb, var(--bg) 18%, transparent); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badges span { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--rule-2); color: var(--ink-2); }
/* ---------- compte (facultatif) ---------- */
.acct { margin-top: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); display: grid; gap: 14px; }
.acct__t { margin: 0; color: var(--ink-2); max-width: 46ch; }
.acct__t b { color: var(--ink); }
.acct__t span { color: var(--muted); overflow-wrap: anywhere; }
.acct__btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.acct__g { min-height: 44px; max-width: 100%; }
.acct__g:empty { display: none; }
.acct__btn {
  appearance: none; height: 44px; padding: 0 20px; border: 0; border-radius: 999px; max-width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; font-size: 15px; white-space: nowrap;
  background: var(--sheet); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2);
}
.acct__btn svg { width: 18px; height: 18px; flex: none; }
/* Apple : noir sur fond clair, blanc sur fond sombre (règles de marque Apple) */
.acct__btn--apple { background: var(--ink); color: var(--bg); box-shadow: none; }
.acct__btn--apple svg { width: 15px; height: 18px; margin-top: -2px; }
.acct__act { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.win__acct { margin-top: 0; padding: 18px 0 0; border-bottom: 0; border-top: 1px solid rgba(255,255,255,.3); gap: 12px; }
.win__acct .acct__t { color: inherit; opacity: .9; font-weight: 600; }
.win__acct .acct__btn { background: #fff; color: #000; box-shadow: none; }
#dlgWin.is-lost .win__acct { border-top-color: color-mix(in srgb, var(--bg) 30%, transparent); }
#dlgWin.is-lost .win__acct .acct__btn { background: var(--bg); color: var(--ink); }
/* ---------- avatars ---------- */
/* photo ronde, sinon l'initiale sur la couleur du joueur */
.av {
  --s: 26px; width: var(--s); height: var(--s); flex: none; border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center; vertical-align: middle; object-fit: cover;
  background: var(--c, var(--p6)); color: var(--bg); font-weight: 800; font-size: calc(var(--s) * .46); line-height: 1;
  font-stretch: 100%; font-variation-settings: "wdth" 100; letter-spacing: 0; text-transform: none; user-select: none;
}
img.av { background: var(--rule); }
.av--s { --s: 20px; }
.av--l { --s: 72px; box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px var(--accent); }
.coop__who .av { display: inline-grid; place-items: center; gap: 0; align-self: center; }
.duel__name .av { margin-top: -3px; }
.brow--av { grid-template-columns: 44px 28px minmax(0, 1fr) auto; }
.brow--av .av { align-self: center; --s: 28px; }
.win__pods li span .av { margin: -3px 6px 0 0; }
.tool--me { border-color: var(--accent); }
.tool--me .av { --s: 30px; }
/* téléphone étroit et connecté : six ronds tiennent encore à côté de la marque */
@media (max-width: 400px) {
  .tools:has(.tool--me:not([hidden])) { gap: 2px; }
  .tools:has(.tool--me:not([hidden])) .tool { width: 29px; height: 29px; }
  .tools:has(.tool--me:not([hidden])) .tool--me .av { --s: 27px; }
  .tools:has(.tool--me:not([hidden])) .tool--flag svg { width: 20px; height: 20px; }
}

/* ---------- profil ---------- */
.prof { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px 18px; align-items: center; }
.prof__av { display: grid; padding: 4.5px; }
.prof__t { margin: 0 0 4px; font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.prof__pts { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); }
.prof__pts b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
/* membres qui comptent pour le total du clan : valeur en accent ; les suivants passent au second plan après un trait */
#clanMembers .brow.is-counted .brow__v { color: var(--accent); }
#clanMembers:has(.is-counted) .brow:not(.is-counted) { opacity: .62; }
#clanMembers .brow.is-counted + .brow:not(.is-counted) { border-top: 1.5px dashed var(--rule-2); }
.clan-counted { margin-top: 10px; }
.prof__photo { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; font-size: 13.5px; color: var(--muted); }
.prof__photo .link:disabled { color: var(--muted); text-decoration-color: var(--rule-2); cursor: default; }
.prof__name { grid-column: 1 / -1; display: flex; gap: 12px; align-items: end; }
.prof__name .field { flex: 1; }
.prof__name .btn { height: 44px; padding: 0 18px; flex: none; }
.prof .form-err { grid-column: 1 / -1; }
.acct__side { display: grid; gap: 14px; align-content: start; }
.prof__acts { display: flex; gap: 10px; justify-content: flex-end; }
.prof__acts .btn { flex: 1; max-width: 220px; }

/* recadrage : glisser pour déplacer, curseur pour zoomer ; le rond montre ce que les autres verront */
.crop-box { display: grid; gap: 14px; justify-items: center; }
.crop { position: relative; width: min(260px, 100%); aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--rule); touch-action: none; cursor: grab; }
.crop:active { cursor: grabbing; }
.crop canvas { display: block; width: 100%; height: 100%; }
.crop__mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px color-mix(in srgb, var(--sheet) 62%, transparent), inset 0 0 0 2px var(--accent-fill); pointer-events: none; }
.crop__zoom { width: min(260px, 100%); }
.field input[type="range"] { appearance: auto; height: 28px; border: 0; accent-color: var(--accent-fill); cursor: pointer; }
.rules__more { font-size: 14px; }
/* pied de page discret : les pages de contenu (règles complètes, archives) */
.site-foot { margin-top: 48px; padding: 18px 0 calc(22px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
.site-foot a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.credit { font-size: 13px; line-height: 1.45; color: var(--muted); }
.credit a { color: inherit; }

/* ---------- effets (js/fx.js) ---------- */
.col { overflow-x: clip; } /* la secousse et le chiffre qui saute ne font jamais défiler la page de côté */
.hero__t { transform-origin: 0 80%; }

/* caméra thermique (thermal.js) : derrière tout, le halo CSS s'efface */
.thermal { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.has-thermal .glow { opacity: 0; }
#dlgWin .thermal { z-index: 0; }
#dlgWin { overflow-x: hidden; }
#dlgWin .win { position: relative; z-index: 1; text-shadow: 0 1px 14px rgba(7,6,11,.75), 0 0 2px rgba(7,6,11,.6); }
/* le chiffre reste lisible quand le fluide brûle derrière lui */
.has-thermal .hero__t, .has-thermal .hero__w, .has-thermal .hero__d { text-shadow: 0 0 22px var(--bg), 0 0 6px var(--bg); }


.fx-flash {
  position: fixed; inset: 0; z-index: 35; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 35%, var(--c), transparent 70%);
  animation: flash .7s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes flash { from { opacity: var(--k); } to { opacity: 0; } }

/* titre néon : lettres qui montent en masque, trait de lumière, sortie floutée */
.fx-stamp {
  position: fixed; left: 50%; top: 46%; z-index: 40; pointer-events: none; white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-4deg);
  font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 900; text-transform: uppercase;
  font-size: clamp(32px, 9.5vw, 92px); letter-spacing: -.03em; line-height: 1; color: #fff;
  animation: stampOut 1.7s cubic-bezier(.7,0,.84,0) forwards;
}
.fx-stamp__l { display: inline-block; overflow: hidden; padding: .15em .08em; margin: -.15em -.08em; }
.fx-stamp .ch {
  display: inline-block; transform: translateY(110%);
  text-shadow: 0 0 6px var(--c), 0 0 16px var(--c), 0 0 38px var(--c), 0 0 80px var(--c);
  -webkit-text-stroke: 1.5px var(--c);
  animation: charUp .7s calc(var(--i) * 28ms) cubic-bezier(.16,1,.3,1) forwards;
}
.fx-stamp__beam {
  position: absolute; left: -20%; right: -20%; top: 50%; height: 3px; border-radius: 3px; background: #fff;
  box-shadow: 0 0 10px var(--c), 0 0 30px var(--c), 0 0 60px var(--c);
  transform: scaleX(0); animation: beam .9s .05s cubic-bezier(.16,1,.3,1) forwards; z-index: -1;
}
@keyframes charUp { to { transform: none; } }
@keyframes beam { 0% { transform: scaleX(0); opacity: 1; } 60% { opacity: .9; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes stampOut { 0%, 72% { opacity: 1; filter: none; } 100% { opacity: 0; filter: blur(14px); transform: translate(-50%, -70%) rotate(-4deg) scale(1.25); } }

.fx-float {
  position: fixed; z-index: 40; pointer-events: none; white-space: nowrap; color: #fff;
  font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 34px; line-height: 1;
  text-shadow: 0 0 4px var(--c), 0 0 14px var(--c), 0 0 30px var(--c); -webkit-text-stroke: 1px var(--c);
  animation: rise 1.3s cubic-bezier(.16,1,.3,1) forwards;
}
@keyframes rise {
  0% { transform: translateY(14px) scale(.5); opacity: 0; filter: blur(6px); }
  18% { transform: translateY(0) scale(1.12); opacity: 1; filter: none; }
  100% { transform: translateY(-64px) scale(1); opacity: 0; filter: blur(4px); }
}

/* nouvelle ligne : elle glisse, sa barre se remplit avec une tête lumineuse ; un record la balaie de lumière */
.row.is-new { animation: slideIn .6s var(--nd, 0ms) cubic-bezier(.16,1,.3,1); }
.row.is-new .row__line i { animation: fill .9s calc(var(--nd, 0ms) + 80ms) cubic-bezier(.16,1,.3,1) both; transform-origin: 0 50%; box-shadow: 0 0 10px currentColor; }
.row.is-new .row__w { overflow: hidden; }
.row.is-new .row__w > span { display: inline-block; animation: maskUp .6s var(--nd, 0ms) cubic-bezier(.16,1,.3,1) both; }
@keyframes slideIn { from { transform: translateX(-18px); opacity: 0; filter: blur(4px); } }
@keyframes fill { from { transform: scaleX(0); } }
@keyframes maskUp { from { transform: translateY(105%); } }
.row.is-sweep::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--c) 40%, transparent) 45%, color-mix(in srgb, #fff 60%, var(--c)) 50%, color-mix(in srgb, var(--c) 40%, transparent) 55%, transparent 80%);
  background-size: 250% 100%; mix-blend-mode: plus-lighter;
  animation: sweep .9s .1s cubic-bezier(.16,1,.3,1) both;
}
@keyframes sweep { from { background-position: 120% 0; opacity: 1; } to { background-position: -40% 0; opacity: 0; } }

/* victoire : grain de capteur, mot qui se décode, le reste arrive ensuite */
#dlgWin::after {
  content: ""; position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.win__w .ch { display: inline-block; min-width: .3em; }
#dlgWin:not(.is-lost) .win__w { text-shadow: 0 0 30px rgba(255,255,255,.35); }
.win__w .ch.is-lock { animation: lock .5s cubic-bezier(.16,1,.3,1); }
@keyframes lock { 0% { transform: translateY(-18%) scale(1.25); text-shadow: 0 0 10px #fff, 0 0 40px #fff, 0 0 90px #fff; } 100% { transform: none; } }
#dlgWin.is-lost .win__w .ch { animation: drop .6s calc(var(--i) * 45ms + 120ms) cubic-bezier(.2,1.6,.4,1) both; }
@keyframes drop { from { transform: translateY(-45%) scale(.3); opacity: 0; } }
#dlgWin :is(.win__main > *, .win__side > *, .win__act):not(.win__k):not(.win__w) { animation: winIn .9s cubic-bezier(.16,1,.3,1) both; }
#dlgWin .win__main > :nth-child(3) { animation-delay: .05s; } #dlgWin .win__main > :nth-child(4) { animation-delay: .12s; }
#dlgWin .win__main > :nth-child(5) { animation-delay: .19s; } #dlgWin .win__main > :nth-child(6) { animation-delay: .26s; }
#dlgWin .win__side > :nth-child(1) { animation-delay: .33s; } #dlgWin .win__side > :nth-child(2) { animation-delay: .4s; }
#dlgWin .win__side > :nth-child(3) { animation-delay: .44s; } #dlgWin .win__act { animation-delay: .47s; }
#dlgWin.is-reveal :is(.win__main > *, .win__side > *, .win__act):not(.win__k):not(.win__w) { animation: none; opacity: 0; }
@keyframes winIn { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } }
#btnSound[aria-pressed="true"] .mute, #btnSound[aria-pressed="false"] .wave, #btnSound[data-amb="false"] .wave--amb { display: none; }

/* ---------- mises en page larges ---------- */
/* Jouer, sur téléphone et tablette : une colonne, la liste puis le pied de page */
#viewPlay { display: flex; flex-direction: column; }
.play__side, .play__list { display: contents; }
#viewPlay .foot { order: 1; }

@media (min-width: 1000px) {
  .col { padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: max(40px, env(safe-area-inset-right, 0px)); }

  /* Jouer : le relevé et la saisie à gauche, collés à l'écran ; les mots à droite */
  #viewPlay { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 72px; align-items: start; }
  .play__side, .play__list { display: block; min-width: 0; }
  .play__side { container-type: inline-size; padding-bottom: 40px; }
  .play__list { padding-top: 34px; }
  #viewPlay .foot { order: 0; margin-top: 34px; padding-bottom: 0; }
  .hero__t { font-size: min(168px, 26cqi); }
  .guess { position: relative; background: transparent; }
  .live { width: 100%; margin-left: 0; }
  .bar { margin-top: 0; }
  .empty { max-width: none; }

  /* Classement : les deux podiums côte à côte, une liste seule reste lisible */
  .boards { grid-template-columns: minmax(0, 760px); }
  .boards:has(#boardFast:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
  #boardFast .board-h { margin-top: 26px; }
  .page-d { max-width: 60ch; }

  /* Clan : présentation à gauche, formulaires ou membres à droite */
  #acct { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; column-gap: 72px; }
  #acct .prof { max-width: 560px; }
  #acct .acct__t { max-width: 60ch; }
  #clanNone:not([hidden]), #clanSome:not([hidden]) { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 0 72px; align-items: start; }
  #clanNone .forms { margin-top: 36px; }
  .clan__members .h3 { margin-top: 36px; }

  /* Fin de manche : le mot, la phrase et la courbe à gauche ; podiums et voisins à droite */
  .win { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); grid-template-rows: 1fr auto; gap: 34px 72px; padding-inline: max(40px, env(safe-area-inset-left, 0px)); }
  .win__main, .win__side { display: flex; flex-direction: column; gap: 22px; min-width: 0; align-self: center; }
  .win__act { grid-column: 1 / -1; max-width: 560px; width: 100%; justify-self: end; margin-top: 0; }
  .win__pods { gap: 28px; }
  .win__pods ol { font-size: 13.5px; }
  .win__s { font-size: 21px; }
  .win__curve svg { height: 132px; }
}
/* sur un écran assez haut, la colonne de gauche reste en place pendant qu'on parcourt les mots */
@media (min-width: 1000px) and (min-height: 760px) {
  .play__side { position: sticky; top: 0; }
}

/* ---------- chargement (js/boot.js) ---------- */
/* toujours sombre, comme une caméra thermique qu'on allume ; --c et --p suivent la chaleur */
.boot {
  --c: #1F1A6E; --g: #1F1A6E; --p: 0;
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; overflow: hidden;
  background: #07060B; color: #ECEDF0; padding: 24px 16px;
}
.boot::before {
  content: ""; position: absolute; left: 50%; bottom: -30vh; width: 140vmax; height: 90vh; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--g), transparent); opacity: calc(.12 + var(--p) * .3); pointer-events: none;
}
.boot::after { /* grain du capteur */
  content: ""; position: absolute; inset: 0; opacity: .1; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html:has(.boot:not([hidden]):not(.is-out)) { overflow: hidden; } /* la page derrière ne défile pas */
.boot__in { position: relative; z-index: 1; display: grid; justify-items: center; gap: 14px; width: min(460px, 100%); text-align: center; }
.boot__mark {
  font-stretch: 125%; font-variation-settings: "wdth" 125; font-weight: 800; font-size: clamp(40px, 13vw, 76px); line-height: 1; letter-spacing: -.01em;
  white-space: nowrap; color: #1F1A6E;
}
.boot__mark span { display: inline-block; transition: text-shadow .3s; }
.boot__mark span.is-hot { text-shadow: 0 0 18px rgba(255, 210, 63, .55), 0 0 2px #fff; animation: bootFlicker 1.6s calc(var(--i) * 90ms) ease-in-out infinite; }
@keyframes bootFlicker { 50% { text-shadow: 0 0 26px rgba(255, 138, 18, .7), 0 0 2px #fff; } }
.boot__t {
  margin-top: 6px; font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: clamp(56px, 19vw, 120px); line-height: .9;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--c); white-space: nowrap;
  text-shadow: 0 0 calc(var(--p) * 34px) color-mix(in srgb, var(--c) 55%, transparent);
}
.boot__bar { position: relative; width: 100%; height: 3px; border-radius: 3px; background: #1E2024; }
.boot__bar i {
  position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(90deg, #1F1A6E, #5C1F9E 25%, #B0217D 45%, #E8432E 62%, #FF8A12 76%, #FFD23F 90%, #fff);
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0 round 3px);
}
.boot__bar::after { /* tête lumineuse */
  content: ""; position: absolute; top: 50%; left: calc(var(--p) * 100%); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px 3px var(--c);
}
.boot__k { font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: #8A8E99; min-height: 1.3em; }
.boot__slow { display: none; margin-top: 18px; gap: 14px; justify-items: center; font-size: 14.5px; color: #B3B6BD; }
.boot__slow p { margin: 0; max-width: 34ch; }
.boot__slow b { color: #ECEDF0; }
.boot__slow .btn { background: #FF9B21; color: #07060B; }
.boot.is-slow .boot__slow { display: grid; animation: winIn .6s cubic-bezier(.16,1,.3,1) both; }
/* sortie : flash blanc qui révèle le jeu */
.boot.is-out { pointer-events: none; animation: bootOut .52s cubic-bezier(.4,0,.2,1) forwards; }
.boot.is-out .boot__in { animation: bootZoom .52s cubic-bezier(.7,0,.84,0) forwards; }
@keyframes bootOut { 0% { background: #07060B; } 22% { background: #fff; opacity: 1; } 100% { background: #fff; opacity: 0; } }
@keyframes bootZoom { to { transform: scale(1.18); opacity: 0; filter: blur(8px); } }
/* avant que le script décide : rien pendant un instant, la version fixe seulement si rien ne vient */
.boot:not(.boot--gl):not(.boot--static) .boot__in { animation: bootLate 0s .9s both; }
@keyframes bootLate { from { visibility: hidden; } to { visibility: visible; } }
/* version fixe (sans WebGL2 ou moins d'animations) : la rampe posée sur le logo et « Connexion… » */
.boot--static .boot__t, .boot--static .boot__bar { display: none; }
.boot--static .boot__mark span:nth-child(1) { color: #5C1F9E; } .boot--static .boot__mark span:nth-child(2) { color: #8A2090; }
.boot--static .boot__mark span:nth-child(3) { color: #B0217D; } .boot--static .boot__mark span:nth-child(4) { color: #E8432E; }
.boot--static .boot__mark span:nth-child(5) { color: #FF8A12; } .boot--static .boot__mark span:nth-child(6) { color: #FFD23F; } .boot--static .boot__mark span:nth-child(7) { color: #fff; }
.boot--static .boot__k { letter-spacing: .12em; }
@media (prefers-reduced-motion: reduce) { .boot.is-out { animation: none; } }
/* version WebGL2 : le canvas peint fond, mot et explosion ; le relevé reste en HTML sous le mot */
.boot__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.boot--gl { background: transparent; }
.boot--gl::before, .boot--gl .boot__mark, .boot--gl .boot__bar { display: none; }
.boot--gl::after { transition: opacity .3s; }
.boot--gl .boot__in {
  position: absolute; left: 0; right: 0; top: calc(50% + var(--below, 90px)); margin: 0 auto; width: min(460px, 100% - 32px); gap: 8px;
  animation: winIn .5s cubic-bezier(.16,1,.3,1) both;
}
.boot--gl .boot__t { margin: 0; font-size: clamp(30px, 8.5vw, 50px); text-shadow: 0 0 22px color-mix(in srgb, var(--c) 45%, transparent); }
.boot--gl.is-out { animation: none; }
.boot--gl.is-out::after { opacity: 0; }
.boot--gl.is-out .boot__in { animation: bootZoom .3s cubic-bezier(.7,0,.84,0) forwards; }

/* ---------- dopamine : micro-interactions, doublons, combo, coéquipiers ---------- */
/* au toucher, chaque bouton s'enfonce un peu ; au survol, il chauffe */
:is(.btn, .tool, .guess button, .swatch, .react-pick button, .acct__btn) {
  transition: transform .16s cubic-bezier(.2,.8,.2,1), filter .15s, box-shadow .2s, border-color .2s, color .2s;
}
:is(.btn, .tool, .guess button, .swatch, .react-pick button, .acct__btn):not(:disabled):active { transform: scale(.92); }
:is(.nav, .tabs, .seg2, .sort, .modes) button:not(:disabled):active, button.link:not(:disabled):active { transform: scale(.95); }
:is(.nav, .tabs, .seg2, .sort, .modes) button, button.link { transition: transform .16s cubic-bezier(.2,.8,.2,1), color .2s, text-decoration-color .2s, border-color .2s; }
button.link { display: inline-block; }
.btn:not(:disabled):not(.btn--line):hover { box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--accent-fill) 80%, transparent); }
.guess button:not(:disabled):hover { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-fill) 22%, transparent); }
.team-coop .row[data-id]:hover { background: color-mix(in srgb, var(--rule) 45%, transparent); }
/* focus visible partout, y compris sur l'écran de fin toujours sombre */
#dlgWin :focus-visible { outline-color: #fff; }
#dlgWin.is-lost :focus-visible { outline-color: var(--bg); }
/* cibles tactiles : au moins 44 px, sans changer le dessin (zone invisible centrée sur le bouton) */
:is(.tool, .nav button, .modes button, .sort button, .tabs button, .seg2 button, button.link, .swatch, .react-pick button, .site-foot a, .rules__more a, .credit a) { position: relative; }
:is(.tool, .nav button, .modes button, .sort button, .tabs button, .seg2 button, button.link, .swatch, .react-pick button, .site-foot a, .rules__more a, .credit a)::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}

/* onde au point touché, étincelles de frappe, explosion de la victoire (js/fx.js) */
.fx-ripple {
  position: fixed; z-index: 70; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; pointer-events: none;
  border: 2px solid var(--c, var(--accent-fill)); animation: ripple .5s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes ripple { from { transform: scale(.4); opacity: .85; } to { transform: scale(5); opacity: 0; } }
.fx-spark { position: fixed; z-index: 46; width: 5px; height: 5px; border-radius: 50%; pointer-events: none; background: #fff; box-shadow: 0 0 6px 2px var(--c), 0 0 14px 3px var(--c); }
.fx-burst { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
/* le nom du palier pulse deux fois avant de s'effacer */
.fx-stamp__l { animation: stampPulse .42s .5s ease-in-out 2; }
@keyframes stampPulse { 50% { transform: scale(1.09); } }

/* mot déjà proposé : bulle sous le champ, la ligne flashe et tremble */
.row { scroll-margin-top: 112px; scroll-margin-bottom: 24px; }
.dup-tip {
  position: absolute; left: 0; top: calc(100% + 10px); z-index: 7; max-width: 100%;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 9px 15px; border-radius: 12px;
  background: var(--sheet); color: var(--ink); font-size: 14.5px; line-height: 1.35;
  box-shadow: 0 0 0 1.5px var(--c, var(--rule-2)), 0 12px 30px -12px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.96); transform-origin: 24px 0; pointer-events: none;
  transition: opacity .16s, transform .3s cubic-bezier(.2,1.5,.4,1), visibility 0s .3s;
}
.dup-tip::before { content: ""; position: absolute; left: 20px; top: -6px; width: 10px; height: 10px; background: inherit; box-shadow: -1.5px -1.5px 0 0 var(--c, var(--rule-2)); transform: rotate(45deg); }
.dup-tip.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .16s, transform .3s cubic-bezier(.2,1.5,.4,1); }
.dup-tip b { font-weight: 800; }
.dup-tip .num { color: var(--c); font-weight: 700; font-variant-numeric: tabular-nums; }
.dup-tip span:last-child:not(.num) { color: var(--ink-2); }
.row.is-dup { animation: dupFlash 1s var(--dd, 0ms) cubic-bezier(.2,.8,.2,1); }
.row.is-dup > :is(.row__w, .row__t) { animation: dupShake .5s var(--dd, 0ms); }
@keyframes dupFlash {
  0%, 12% { background: color-mix(in srgb, var(--c) 34%, transparent); box-shadow: inset 3px 0 0 var(--c), 0 0 0 1.5px var(--c); }
  100% { background: transparent; box-shadow: inset 3px 0 0 transparent, 0 0 0 1.5px transparent; }
}
@keyframes dupShake { 15% { transform: translateX(-7px); } 35% { transform: translateX(6px); } 55% { transform: translateX(-4px); } 75% { transform: translateX(2px); } }

/* combo : trois records d'affilée et plus */
.hero { position: relative; }
.hero__combo {
  position: absolute; right: 0; top: 2px; padding: 4px 13px 6px; border-radius: 999px;
  font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums;
  color: #07060B; background: linear-gradient(100deg, #E8432E, #FF8A12 55%, #FFD23F);
  box-shadow: 0 0 22px -2px color-mix(in srgb, #FF8A12 70%, transparent);
  transform: rotate(-6deg); animation: comboPulse 1.6s ease-in-out infinite;
}
.hero__combo.is-bump { animation: comboBump .7s cubic-bezier(.2,1.6,.4,1), comboPulse 1.6s .7s ease-in-out infinite; }
@keyframes comboPulse { 50% { transform: rotate(-6deg) scale(1.06); box-shadow: 0 0 34px 2px color-mix(in srgb, #FF8A12 70%, transparent); } }
@keyframes comboBump { 0% { transform: rotate(-6deg) scale(.4); opacity: 0; } 60% { transform: rotate(-3deg) scale(1.25); opacity: 1; } 100% { transform: rotate(-6deg); } }
@media (min-width: 1000px) { .hero__combo { font-size: 42px; } }

/* salon : un coéquipier chauffe, sa carte arrive en haut de l'écran */
.mates {
  position: fixed; z-index: 45; top: calc(12px + env(safe-area-inset-top, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  width: min(340px, calc(100vw - 24px)); display: grid; gap: 8px; justify-items: end; pointer-events: none;
}
.mate {
  display: flex; align-items: center; gap: 12px; max-width: 100%; padding: 10px 16px 10px 10px; border-radius: 16px;
  background: var(--sheet); color: var(--ink);
  box-shadow: 0 0 0 1.5px var(--c), 0 14px 34px -14px var(--c), 0 4px 14px rgba(0,0,0,.18);
  animation: mateIn .5s cubic-bezier(.2,1.3,.4,1) both;
}
.mate.is-out { animation: mateOut .4s ease-in forwards; }
.mate .av { --s: 40px; box-shadow: 0 0 0 2px var(--sheet), 0 0 0 4px var(--c); animation: matePing 1.2s .2s ease-out 2; }
.mate__t { display: grid; min-width: 0; font-size: 14px; line-height: 1.3; color: var(--ink-2); }
.mate__t b { color: var(--ink); }
.mate__w { font-weight: 700; font-size: 17px; color: var(--ink); overflow-wrap: anywhere; }
.mate__w em { font-style: normal; color: var(--c); font-stretch: 62%; font-variation-settings: "wdth" 62; font-weight: 800; font-size: 19px; margin-left: 4px; white-space: nowrap; }
@keyframes mateIn { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes mateOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes matePing { 50% { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 10px color-mix(in srgb, var(--c) 30%, transparent); } }
@media (max-width: 520px) { .mates { left: 12px; right: 12px; width: auto; justify-items: center; } }

/* ---------- liste : tri à trois choix et filtre ---------- */
.bar .sort { gap: 14px; }
.find { display: flex; align-items: center; gap: 6px; flex: 1 1 150px; max-width: 240px; min-width: 0; height: 34px; padding: 0 10px; border-radius: 999px; background: color-mix(in srgb, var(--rule) 70%, transparent); color: var(--muted); }
.find[hidden] { display: none; }
.find svg { width: 15px; height: 15px; flex: none; }
.find input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font: inherit; font-size: 14.5px; color: var(--ink); }
.find input::-webkit-search-cancel-button { cursor: pointer; }
.find:focus-within { box-shadow: 0 0 0 2px var(--accent); color: var(--ink); }
@media (max-width: 520px) { .find { order: 5; max-width: none; flex-basis: 100%; height: 40px; } }
.row--none { display: block; padding: 18px 0; color: var(--muted); font-size: 15px; }

/* ---------- compteurs qui battent avec la chaleur (accueil) ---------- */
.live b, .pulse-n { display: inline-block; animation: heatBeat 2.8s ease-in-out infinite; }
@keyframes heatBeat { 0%, 100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 14px color-mix(in srgb, var(--accent-fill) 55%, transparent); transform: scale(1.04); } }
.pulse-n { color: var(--accent); font-weight: 800; }

/* ---------- ligne : définition « ? » et température qui rejoue son son ---------- */
.row__def {
  appearance: none; border: 1.5px solid var(--rule-2); background: none; color: var(--muted); align-self: center;
  width: 20px; height: 20px; border-radius: 50%; padding: 0; font: 700 12px/1 inherit; display: inline-grid; place-items: center;
  position: relative; opacity: .75; transition: opacity .15s, color .15s, border-color .15s, transform .16s;
}
.row__def::after { content: ""; position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%); }
.row__def:hover, .row__def:focus-visible { opacity: 1; color: var(--ink); border-color: var(--ink); }
.row__def:active { transform: scale(.88); }
@media (hover: hover) { .row:not(:hover):not(:focus-within) .row__def { opacity: 0; } }
button.row__t { appearance: none; border: 0; background: none; padding: 0; margin: 0; font-family: inherit; cursor: pointer; justify-self: end; border-radius: 8px; transition: transform .16s cubic-bezier(.2,.8,.2,1); }
button.row__t:hover .row__n { text-shadow: 0 0 12px currentColor; }
button.row__t:active { transform: scale(.94); }
#rows .row[data-id] { -webkit-touch-callout: none; }

/* ---------- réactions : pastilles touchables, les miennes surlignées ---------- */
.row__reacts { flex-wrap: wrap; }
.rx { font-size: 13px; line-height: 1; padding: 3px 7px; border-radius: 999px; background: var(--rule); color: var(--ink); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 3px; }
.rx small { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
button.rx { appearance: none; border: 1.5px solid transparent; font-family: inherit; cursor: pointer; position: relative; transition: transform .16s, background .2s, border-color .2s; }
button.rx::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 36px); height: 36px; transform: translate(-50%, -50%); }
button.rx:hover { border-color: var(--rule-2); }
button.rx:active { transform: scale(.88); }
.rx.is-mine { background: color-mix(in srgb, var(--accent-fill) 22%, transparent); border-color: var(--accent); }
.rx.is-mine small { color: var(--accent); }
.rx.is-pop { animation: rxPop .45s var(--rd, 0ms) cubic-bezier(.2,1.6,.4,1) both; }
.rx.is-drop { animation: rxDrop .35s var(--rd, 0ms) ease-out both; }
@keyframes rxPop { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: none; } }
@keyframes rxDrop { 0% { transform: scale(1.1); } 100% { transform: none; } }
.react-pick { flex-wrap: wrap; }
.react-pick button.is-mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent-fill) 18%, var(--sheet)); }
.react-pick .react-more { font-size: 20px; font-weight: 700; color: var(--ink-2); }

/* ---------- sélecteur d'émojis (js/emoji.js) ---------- */
.emo-pop {
  position: fixed; z-index: 80; width: 340px; max-height: min(430px, calc(100dvh - 24px)); display: flex; flex-direction: column;
  background: var(--sheet); color: var(--ink); border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--rule-2), 0 22px 50px -18px rgba(0,0,0,.55);
}
.emo-pop.is-in { animation: emoIn .24s cubic-bezier(.2,1.3,.4,1); }
@keyframes emoIn { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.emo-pop.is-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: min(62dvh, 460px); border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
.emo-pop.is-sheet.is-in { animation: up .28s cubic-bezier(.2,.9,.3,1); }
.emo-pop__top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px; }
.emo-pop__q { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 12px; padding: 0 12px; background: var(--rule); color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.emo-pop__q:focus { box-shadow: 0 0 0 2px var(--accent); }
.emo-pop__x { appearance: none; border: 0; background: none; color: var(--muted); width: 44px; height: 44px; border-radius: 50%; font-size: 24px; line-height: 1; flex: none; }
.emo-pop__x:hover { color: var(--ink); }
.emo-pop__cats { display: flex; gap: 2px; padding: 0 8px 4px; border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.emo-pop__cats button { appearance: none; border: 0; background: none; width: 40px; height: 40px; flex: none; border-radius: 10px; font-size: 19px; line-height: 1; }
.emo-pop__cats button:hover { background: var(--rule); }
.emo-pop__grid { flex: 1; overflow-y: auto; padding: 4px 10px 8px; overscroll-behavior: contain; }
.emo-pop__grid h4 { margin: 10px 2px 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); scroll-margin-top: 4px; }
.emo-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.emo-b { appearance: none; border: 0; background: none; height: 44px; border-radius: 10px; font-size: 24px; line-height: 1; transition: transform .14s, background .14s; }
.emo-b:hover, .emo-b:focus-visible { background: var(--rule); transform: scale(1.15); }
.emo-b:active { transform: scale(.9); }
.emo-none { margin: 14px 4px; color: var(--muted); font-size: 14px; }
.emo-pop__free { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px 12px; border-top: 1px solid var(--rule); }
.emo-pop__free input { flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 12px; padding: 0 12px; background: var(--rule); color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.emo-pop__free input:focus { box-shadow: 0 0 0 2px var(--accent); }
.emo-pop__free.is-ok input { box-shadow: 0 0 0 2px var(--chaud, var(--accent)); }
.emo-pop__free button { appearance: none; border: 0; height: 40px; min-width: 52px; padding: 0 14px; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent); font: inherit; font-weight: 700; }
.emo-pop__err { flex-basis: 100%; font-size: 13px; color: var(--brulant); }
.emo-pop__err:empty { display: none; }
.emo-pop__free.shake, .chat__form.shake { animation: shake .35s; }

/* ---------- définitions ---------- */
.def { display: grid; gap: 14px; }
.def__e ol { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 6px; color: var(--ink); line-height: 1.45; }
.def__pos { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.def__wait, .def__none { color: var(--ink-2); }
.def__src { font-size: 13px; color: var(--muted) !important; }
.def__src a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#dlgDef { width: min(520px, 100vw); }
.win__near .near { appearance: none; border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); position: relative; }
.win__near .near::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 40px; transform: translateY(-50%); }
.win__near .near:hover { text-decoration-style: solid; }

/* ---------- chat du salon ---------- */
.chat { display: flex; flex-direction: column; position: relative; background: var(--sheet); border-radius: 18px; box-shadow: 0 0 0 1px var(--rule); overflow: hidden; }
.chat[hidden] { display: none; }
.chat__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 8px 16px; border-bottom: 1px solid var(--rule); }
.chat__t { font-weight: 800; font-size: 15px; }
.chat__t small { font-weight: 500; color: var(--muted); font-size: 13px; }
.chat__list { list-style: none; margin: 0; padding: 10px 12px 6px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 4px; }
.chat__empty { margin: 0; padding: 0 16px 10px; color: var(--muted); font-size: 14px; }
.chat__empty[hidden] { display: none; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.msg:not(.is-cont) { margin-top: 6px; }
.msg__av { width: 24px; flex: none; display: grid; place-items: end center; }
.msg__av .av { --s: 24px; }
.msg__b { min-width: 0; padding: 7px 11px 6px; border-radius: 16px 16px 16px 6px; background: var(--rule); display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.msg.is-cont .msg__b { border-radius: 6px 16px 16px 6px; }
.msg__n { flex-basis: 100%; font-size: 12.5px; font-weight: 700; color: var(--c); }
.msg__t { font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; color: var(--ink); }
.msg time { margin-left: auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.msg.is-me { align-self: flex-end; }
.msg.is-me .msg__b { background: var(--accent-fill); border-radius: 16px 16px 6px 16px; }
.msg.is-me .msg__t { color: var(--on-accent); }
.msg.is-me time { color: color-mix(in srgb, var(--on-accent) 70%, transparent); }
.msg.is-emo .msg__t { font-size: 30px; line-height: 1.1; }
.msg.is-new { animation: msgIn .34s cubic-bezier(.2,1.3,.4,1); }
.msg.is-new:not(.is-me) .msg__b { box-shadow: 0 0 0 1.5px var(--c); transition: box-shadow 1.6s .4s; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.94); } }
.chat__new { position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%); appearance: none; border: 0; border-radius: 999px; padding: 8px 14px; min-height: 36px; background: var(--ink); color: var(--bg); font: inherit; font-size: 13.5px; font-weight: 700; box-shadow: 0 8px 22px -8px rgba(0,0,0,.5); animation: msgIn .3s; }
.chat__new[hidden] { display: none; }
.chat__form { display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 6px; border-top: 1px solid var(--rule); }
.chat__emo { appearance: none; border: 0; background: none; width: 44px; height: 44px; flex: none; border-radius: 50%; font-size: 21px; line-height: 1; }
.chat__emo:hover { background: var(--rule); }
.chat__form input { flex: 1; min-width: 0; height: 42px; border: 0; border-radius: 999px; padding: 0 14px; background: var(--rule); color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.chat__form input:focus { box-shadow: 0 0 0 2px var(--accent); }
.chat__form button[type=submit] { appearance: none; width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; }
.chat__form button[type=submit] svg { width: 17px; height: 17px; }
.chat__err { padding: 0 16px 8px; font-size: 13px; color: var(--brulant); }
.chat__err:empty { display: none; }
.chat-fab { display: none; }

/* téléphone et tablette : tiroir en bas d'écran, ouvert par la bulle flottante */
@media (max-width: 999px) {
  .chat { position: fixed; z-index: 48; left: 0; right: 0; bottom: 0; height: min(72dvh, 560px); border-radius: 20px 20px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -18px 50px -20px rgba(0,0,0,.5), 0 0 0 1px var(--rule-2); transform: translateY(105%); visibility: hidden; transition: transform .32s cubic-bezier(.2,.9,.3,1), visibility 0s .32s; }
  body.chat-open .chat { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.2,.9,.3,1); }
  .chat-fab {
    position: fixed; z-index: 47; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--accent-fill); color: var(--on-accent);
    box-shadow: 0 10px 26px -8px color-mix(in srgb, var(--accent-fill) 80%, #000);
  }
  .chat-fab[hidden], body.chat-open .chat-fab { display: none; }
  .chat-fab svg { width: 26px; height: 26px; }
  .chat-fab.is-ping { animation: fabPing .7s cubic-bezier(.2,1.6,.4,1); }
  @keyframes fabPing { 40% { transform: scale(1.16) rotate(-8deg); } }
  .chat-fab__n { position: absolute; top: -3px; right: -3px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brulant); color: #fff; font-size: 12.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2.5px var(--bg); }
  .chat-fab__n[hidden] { display: none; }
  body.has-chat #viewPlay { padding-bottom: 80px; }
}
/* grand écran : panneau au-dessus de la liste, à côté du champ de mot */
@media (min-width: 1000px) {
  .chat { height: clamp(220px, 34vh, 340px); margin-bottom: 26px; }
  .chat__x { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .live b, .pulse-n, .rx.is-pop, .rx.is-drop, .msg.is-new, .chat-fab.is-ping, .emo-pop.is-in { animation: none; }
  .chat { transition: none !important; }
}

/* ligne : toucher rejoue le son ; petit bouton dédié aux réactions en salon coop */
#rows .row[data-id] { cursor: pointer; }
.row__rx { appearance: none; border: 0; background: none; color: var(--muted); width: 26px; height: 26px; padding: 0; border-radius: 50%; display: inline-grid; place-items: center; align-self: center; position: relative; transition: color .15s, transform .16s, background .15s; }
.row__rx::after { content: ""; position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; transform: translate(-50%, -50%); }
.row__rx svg { width: 19px; height: 19px; }
.row__rx:hover, .row__rx[aria-expanded="true"] { color: var(--accent); background: var(--rule); }
.row__rx:active { transform: scale(.88); }
.row.is-replay { animation: replayFlash .5s ease-out; }
@keyframes replayFlash { 0% { background: color-mix(in srgb, var(--c) 22%, transparent); } 100% { background: transparent; } }

/* audit : le sélecteur garde ses catégories visibles ; le compteur du salon passe à la ligne sur téléphone */
.emo-pop__top, .emo-pop__cats, .emo-pop__free { flex: none; }
@media (max-width: 520px) { .live { white-space: normal; flex-wrap: wrap; row-gap: 2px; } }

/* notifications du salon (js/push.js) */
.notif { margin-top: 14px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.notif[hidden], .notif [hidden] { display: none; }
.notif__ask { margin: 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--accent-fill) 12%, transparent); color: var(--ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.notif__sw label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.notif input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent-fill); margin: 0; flex: none; }
.notif input[role=switch] { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--rule-2); position: relative; transition: background .2s; }
.notif input[role=switch]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .22s cubic-bezier(.2,1.4,.4,1); }
.notif input[role=switch]:checked { background: var(--accent-fill); }
.notif input[role=switch]:checked::before { transform: translateX(16px); }
.notif input[role=switch]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.notif__subs { display: flex; flex-wrap: wrap; gap: 0 18px; padding-left: 48px; }
.notif__subs label { min-height: 40px; }
.notif__guide { margin: 0; }
.notif__guide b { color: var(--ink); }
.notif__msg { margin: 0; font-size: 13px; color: var(--muted); }
.notif__msg:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .notif input[role=switch]::before { transition: none; } }

/* ============ confirmation maison ============ */
#dlgAsk { width: min(440px, 100vw); }
.ask { gap: 12px; }
.ask p { line-height: 1.45; }
.ask__acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap-reverse; margin-top: 8px; }
.ask__acts .btn { flex: 1 1 160px; }
.btn--danger { background: var(--chaud); color: #fff; }
.btn--danger:not(:disabled):hover { box-shadow: 0 8px 24px -8px color-mix(in srgb, var(--chaud) 80%, transparent) !important; }
#askStay:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
#dlgAsk[open] .btn--danger { animation: ask-warm 1.6s ease-in-out infinite alternate; }
@keyframes ask-warm { to { box-shadow: 0 0 18px color-mix(in srgb, var(--chaud) 55%, transparent); } }
@media (prefers-reduced-motion: reduce) { #dlgAsk[open] .btn--danger { animation: none; } }
.ask__acts .btn { white-space: nowrap; }

/* ============ frappe en direct des coéquipiers, au-dessus du champ ============ */
.guess { flex-wrap: wrap; }
.typers { flex: 0 0 100%; display: grid; gap: 6px; padding: 2px 0 6px; }
.typers[hidden] { display: none; }
.typer {
  display: flex; align-items: center; gap: 8px; justify-self: start; max-width: 100%; min-width: 0;
  padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--sheet); color: var(--ink);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 70%, transparent);
  font-size: 15px; line-height: 1.2; animation: typerIn .22s cubic-bezier(.2,1.3,.4,1) both;
}
.typer.is-out { animation: typerOut .22s ease-in forwards; }
.typer .av--t { --s: 24px; flex: none; }
.typer__n { flex: none; font-size: 12px; font-weight: 700; color: var(--c); max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.typer__w { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.typer__w > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.typer__w .dots { display: none; color: var(--c); }
.typer.is-scoring .caret { display: none; }
.typer.is-scoring .dots { display: inline-flex; }
.typer.is-scoring { box-shadow: 0 0 0 1.5px var(--c), 0 0 16px -4px var(--c); }
@keyframes typerIn { from { opacity: 0; transform: translateY(6px) scale(.92); } }
@keyframes typerOut { to { opacity: 0; transform: scale(.9); } }
@media (prefers-reduced-motion: reduce) { .typer, .typer.is-out { animation: none; } .typer .caret { animation: none; } }
@media (max-width: 999px) { body:has(#guessIn:focus) .chat-fab { opacity: 0; pointer-events: none; transform: scale(.8); } }
.chat-fab { transition: opacity .2s, transform .2s; }
/* fumée fixe (moins d'animations, ou sans WebGL2) : un voile très faible teinté par la chaleur */
.smoke-still { position: fixed; inset: 0; z-index: -1; pointer-events: none; --lvl: 0; --sc: hsl(calc(250 - var(--lvl) * 225) 70% 45%);
  background: radial-gradient(60% 35% at 22% 100%, var(--sc), transparent 70%), radial-gradient(50% 30% at 78% 96%, var(--sc), transparent 70%), radial-gradient(40% 25% at 50% 30%, var(--sc), transparent 75%);
  opacity: calc(.07 + var(--lvl) * .1); }

/* combo d'équipe (coop) : multiplicateur et avatar de celui qui l'a prolongé */
.hero__combo.is-team { display: inline-flex; align-items: center; gap: 6px; padding-left: 5px; }
.hero__combo .av--c { --s: 30px; box-shadow: 0 0 0 2px #07060B; }
.hero__combo.is-lost { animation: comboLost .6s ease-in forwards; }
@keyframes comboLost { to { transform: rotate(4deg) translateY(10px) scale(.7); opacity: 0; filter: grayscale(1); } }
@media (prefers-reduced-motion: reduce) { .hero__combo, .hero__combo.is-bump, .hero__combo.is-lost { animation: none; } }

/* pastilles de réaction : une ligne compacte, émoji et chiffre côte à côte, même hauteur avec ou sans
   chiffre ; le bloc ne passe jamais à la ligne et ne pousse pas la température */
.row__reacts { display: inline-flex; flex-wrap: nowrap; gap: 4px; flex: none; align-self: center; max-width: 100%; }
.rx, button.rx {
  box-sizing: content-box; height: 1.4em; padding: 2px 7px; font-size: 13px; line-height: 1.4em;
  display: inline-flex; flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; vertical-align: middle;
}
button.rx { border-width: 1.5px; }
span.rx { border: 1.5px solid transparent; }
.rx small { display: inline; font-family: var(--f); font-size: .8em; line-height: 1; font-weight: 700; margin: 0; }
.rx.is-mine { border-color: var(--accent); }
.rx--more { color: var(--ink-2); font-family: var(--f); font-size: 11.5px; font-weight: 700; background: transparent; border-color: var(--rule-2) !important; }

/* ligne de mot : le mot (et « ? ») d'un côté, les métadonnées (joueur, points, réactions) d'un bloc qui
   ne se coupe jamais ; sur mobile, ce bloc passe sous le mot et la température sur toute la largeur */
.row .row__w.row__w--g > .row__word { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; }
.row .row__w.row__w--g > .row__meta { display: inline-flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
.row .row__w.row__w--g > .row__meta:empty { display: none; }
@media (max-width: 560px) {
  .row .row__w.row__w--g { display: contents; }
  .row .row__w.row__w--g > .row__word { grid-column: 1; grid-row: 1; }
  .row:has(> .row__w--g) > .row__t { grid-column: 2; grid-row: 1; }
  .row .row__w.row__w--g > .row__meta { grid-column: 1 / -1; grid-row: 2; gap: 8px; margin-top: 4px; font-size: 20px; }
}
