/* =========================================================
   iDjems — codenames.css
   Codenames, par-dessus jeux.css (boutons, champs, modales, toasts).
   Ambiance « table de jeu » : fond orange chaud, panneaux d'équipe rouge et
   bleu avec portrait d'espion et grand score, cartes crème à étiquette
   blanche, clé du maître-espion en couleurs pleines, historique.
   Mobile d'abord : les deux panneaux côte à côte au-dessus du plateau ;
   à partir de 980 px : rouge à gauche, plateau au centre, bleu + historique à droite.
   Grilles en minmax(0, 1fr) : un mot long ne doit jamais élargir la page.
   ========================================================= */

.cn {
  --rouge-c: #e0463b; --rouge-f: #9e231d; --rouge-cl: #ff9a8c;
  --bleu-c: #3b7fdc;  --bleu-f: #1d4f9c;  --bleu-cl: #9cc8ff;
  --creme: #f1e2c0; --creme-f: #dcc497; --creme-ombre: #a98b58;
  --neutre-c: #d9c49a; --neutre-f: #b59d6d;
  --nuit: rgba(38, 14, 4, 0.72);
}

/* ── Fond : orange chaud + motif discret ─────────────────── */
body.cn { background: #b4501c; }
body.cn::before {
  background:
    radial-gradient(110% 70% at 50% -10%, #f6a35a 0%, transparent 60%),
    radial-gradient(90% 60% at 50% 120%, #6e2a0d 0%, transparent 65%),
    linear-gradient(180deg, #e17a35, #c45a20 45%, #9a3d14);
}
body.cn::after {
  opacity: 0.12;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px 22px);
}
body.cn .entete { background: rgba(60, 20, 5, 0.42); border-bottom-color: rgba(255, 255, 255, 0.12); }
body.cn .bloc { background: var(--nuit); border-color: rgba(255, 255, 255, 0.14); }
body.cn .kicker { color: #ffd9a8; }
body.cn .sous, body.cn .aide { color: rgba(255, 244, 230, 0.8); }
.t-bleu { color: var(--bleu-cl); }
.t-rouge2 { color: var(--rouge-cl); }

/* boutons et puce accordés au fond orange (le violet du hub jurerait) */
body.cn .btn-principal { color: #3b2200; background: linear-gradient(180deg, #ffd766, #f3a91c); box-shadow: 0 4px 0 #b9740a, 0 10px 24px rgba(90, 40, 0, 0.35); }
body.cn .btn-principal:hover:not(:disabled) { box-shadow: 0 4px 0 #b9740a, 0 12px 28px rgba(90, 40, 0, 0.45); filter: brightness(1.04); }
body.cn .btn.charge::after { border-color: rgba(59, 34, 0, 0.3); border-top-color: #3b2200; }
body.cn .puce-code { border-color: rgba(255, 255, 255, 0.5); background: rgba(0, 0, 0, 0.22); }
body.cn .puce-code svg { color: #ffd9a8; }

/* ── Portrait d'espion (SVG maison) ──────────────────────── */
.espion { display: block; width: 100%; height: 100%; }
.espion .manteau { fill: #2b2b33; }
.espion .ruban, .espion .cravate { fill: #888; }
.rouge .espion .ruban, .rouge .espion .cravate, .c-R .espion .ruban, .c-R .espion .cravate { fill: #ff5d4f; }
.bleu .espion .ruban, .bleu .espion .cravate, .c-B .espion .ruban, .c-B .espion .cravate { fill: #5aa2ff; }
.espion.passant .manteau { fill: #6f5b3d; }
.espion.passant .ruban, .espion.passant .cravate { fill: #c9a86a; }

/* ── Accueil ─────────────────────────────────────────────── */
.cn-hero { text-align: center; padding: 10px 0 2px; }
.cn-hero .titre { text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.cn-hero .mini-plateau { display: grid; grid-template-columns: repeat(5, 24px); gap: 4px; justify-content: center; margin: 4px auto 14px; transform: rotate(-4deg); }
.cn-hero .mini-plateau i { width: 24px; height: 17px; border-radius: 4px; background: var(--creme); box-shadow: 0 2px 0 var(--creme-ombre); animation: clin 4s ease-in-out infinite; }
.cn-hero .mini-plateau i.r { background: var(--rouge-c); box-shadow: 0 2px 0 var(--rouge-f); }
.cn-hero .mini-plateau i.b { background: var(--bleu-c); box-shadow: 0 2px 0 var(--bleu-f); }
.cn-hero .mini-plateau i.a { background: #1a1a1e; box-shadow: 0 2px 0 #000; }
@keyframes clin { 50% { filter: brightness(1.18); } }

/* ── Salon : équipes ─────────────────────────────────────── */
.cn-equipes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cn-equipe {
  --c: var(--rouge-c); --f: var(--rouge-f);
  border-radius: 18px; padding: 12px 10px; min-width: 0;
  background: linear-gradient(180deg, var(--c), var(--f));
  border: 2px solid rgba(255, 255, 255, 0.22); box-shadow: 0 10px 26px rgba(60, 15, 0, 0.35);
}
.cn-equipe.bleu { --c: var(--bleu-c); --f: var(--bleu-f); }
.cn-equipe h3 { font-family: var(--titre); font-size: 1.05rem; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.cn-equipe h3 span { color: #fff !important; }
.cn-equipe h3 small { font-weight: 700; color: rgba(255, 255, 255, 0.8); font-size: 0.85rem; }
.cn-membres { display: flex; flex-direction: column; gap: 6px; }
.cn-membre {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 8px 4px 4px; border-radius: 12px; width: 100%; text-align: left;
  background: rgba(0, 0, 0, 0.22); border: 1px solid transparent; font-size: 0.92rem; color: #fff;
}
.cn-membre.moi { border-color: rgba(255, 255, 255, 0.55); }
.cn-membre .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-membre .badge-espion { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); }
.cn-membre .hors { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); flex: none; }
.cn-membre.vide { justify-content: center; color: rgba(255, 255, 255, 0.7); font-size: 0.82rem; background: transparent; border: 1px dashed rgba(255, 255, 255, 0.4); }
.cn-choix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.cn-choix .btn { min-height: 48px; font-size: 0.95rem; }
.btn-rouge { color: #fff; background: linear-gradient(135deg, #f26a5e, #c22b22); box-shadow: 0 8px 22px rgba(120, 20, 10, 0.4); }
.btn-bleu { color: #fff; background: linear-gradient(135deg, #5f9cf0, #2560c2); box-shadow: 0 8px 22px rgba(20, 50, 120, 0.4); }
.cn-scores { display: flex; justify-content: center; align-items: center; gap: 14px; font-family: var(--titre); font-weight: 700; font-size: 1.15rem; }
.cn-scores .r { color: var(--rouge-cl); } .cn-scores .b { color: var(--bleu-cl); }
.cn-probleme { color: #ffe08a; font-size: 0.9rem; text-align: center; margin-top: 8px; }

/* ── Partie : disposition ────────────────────────────────── */
.cn-table {
  display: grid; gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "rouge bleu" "centre centre" "log log";
}
.cn-pan.rouge { grid-area: rouge; } .cn-pan.bleu { grid-area: bleu; }
.cn-centre { grid-area: centre; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cn-log { grid-area: log; }
@media (min-width: 980px) {
  .app:has(.cn-table) { max-width: 1320px; }
  .cn-table { grid-template-columns: 240px minmax(0, 1fr) 240px; grid-template-areas: "rouge centre bleu" "rouge centre log"; grid-template-rows: auto 1fr; align-items: start; gap: 16px; }
  .cn-plateau { --larg: 760px; }
}

/* ── Panneaux d'équipe ───────────────────────────────────── */
.cn-pan {
  --c: var(--rouge-c); --f: var(--rouge-f);
  position: relative; min-width: 0; border-radius: 18px; padding: 10px 10px 12px; color: #fff;
  background: linear-gradient(180deg, var(--c), var(--f));
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 26px rgba(60, 15, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: box-shadow .3s;
}
.cn-pan.bleu { --c: var(--bleu-c); --f: var(--bleu-f); }
.cn-pan.actif { box-shadow: 0 0 0 3px #ffe08a, 0 0 28px rgba(255, 224, 138, 0.55), 0 10px 26px rgba(60, 15, 0, 0.38); }
.pan-haut { display: flex; align-items: center; gap: 8px; }
.cn-pan.bleu .pan-haut { flex-direction: row-reverse; }
.pan-haut .espion { width: 54px; height: 54px; flex: none; border-radius: 14px; background: rgba(0, 0, 0, 0.2); padding: 3px; }
.pan-chiffre {
  flex: 1; text-align: center; font-family: var(--titre); font-weight: 700; font-size: 2.6rem; line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); font-variant-numeric: tabular-nums;
}
.pan-sec { margin-top: 8px; min-width: 0; }
.pan-lbl { display: block; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.pan-noms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.pan-nom { font-size: 0.8rem; font-weight: 600; padding: 2px 7px; border-radius: 7px; background: rgba(0, 0, 0, 0.22); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pan-nom.moi { background: #fff; color: var(--f); }
.pan-nom.hors { opacity: .55; }
.pan-vide { opacity: .6; font-size: 0.8rem; }
.pan-etat { margin-top: 8px; font-size: 0.74rem; font-weight: 700; text-align: center; padding: 4px 6px; border-radius: 8px; background: rgba(255, 224, 138, 0.95); color: #4a2a00; }
.pan-etat.gagne { background: #fff; color: var(--f); }
@media (min-width: 980px) {
  .pan-haut .espion { width: 84px; height: 84px; }
  .pan-chiffre { font-size: 3.6rem; }
  .pan-sec { margin-top: 12px; }
  .pan-nom { font-size: 0.9rem; }
}

/* ── Bandeau : indice / attente ──────────────────────────── */
.cn-bandeau {
  --c: var(--rouge-c);
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 14px 10px;
  border-radius: 16px; background: var(--nuit); border: 1px solid rgba(255, 255, 255, 0.14); text-align: center;
}
.cn-bandeau.bleu { --c: var(--bleu-c); }
.cn-bandeau.attente { min-height: 54px; justify-content: center; }
.cn-indice { display: flex; align-items: stretch; gap: 6px; max-width: 100%; }
.cn-indice .mot {
  font-family: var(--titre); font-weight: 700; font-size: 1.45rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: #1d1a16; background: #fff; padding: 4px 14px; border-radius: 9px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); overflow-wrap: anywhere; min-width: 0;
}
.cn-indice .nb {
  font-family: var(--titre); font-weight: 700; font-size: 1.45rem; min-width: 42px; display: grid; place-items: center; border-radius: 9px;
  background: var(--c); color: #fff; padding: 0 8px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}
.cn-sous { font-size: 0.86rem; color: rgba(255, 244, 230, 0.85); }
.cn-sous.grand { font-size: 0.98rem; }
.cn-sous b { color: #fff; }
.cn-role { position: absolute; top: -9px; right: 10px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--rouge-c); border: 1px solid rgba(255, 255, 255, 0.45); }
.cn-role.bleu { background: var(--bleu-c); }

/* ── Plateau ─────────────────────────────────────────────── */
.cn-plateau {
  --larg: min(100vw, 520px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(4px, 1.2vw, 10px);
  perspective: 900px;
}
.cn-carte {
  position: relative; aspect-ratio: 1.42; border-radius: clamp(6px, 1.6vw, 11px); padding: clamp(3px, 0.9vw, 7px);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; min-width: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--creme), var(--creme-f));
  box-shadow: 0 3px 0 var(--creme-ombre), 0 8px 16px rgba(60, 20, 0, 0.35);
  transition: transform .16s, box-shadow .2s, filter .2s;
  transform-style: preserve-3d;
}
/* décor du haut de carte (médaillon gravé) */
.cn-carte::before {
  content: ''; position: absolute; left: 12%; right: 12%; top: 9%; height: 34%; border-radius: 50% 50% 8px 8px;
  border: 1.5px solid rgba(120, 85, 35, 0.28);
  background: repeating-linear-gradient(45deg, rgba(120, 85, 35, 0.09) 0 2px, transparent 2px 6px);
}
.etiquette-mot {
  position: relative; display: block; background: #fff; border-radius: clamp(4px, 1vw, 7px);
  padding: clamp(1px, 0.5vw, 5px) 2px; text-align: center; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}
.cn-carte .mot {
  display: block; font-family: var(--titre); font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.3; color: #1d1a16;
  font-size: min(clamp(9px, 3vw, 18px), calc((var(--larg) - 90px) / 5 / (var(--len, 6) * 0.7)));
  overflow: hidden; white-space: nowrap;
}
button.cn-carte:not(:disabled):active { transform: scale(.95); }
.cn-carte:disabled { cursor: default; }
.cn-carte.jouable { cursor: pointer; }
.cn-carte.jouable:hover { transform: translateY(-2px); filter: brightness(1.04); }

/* clé du maître-espion : la carte prend la couleur, l'étiquette reste blanche */
.cn-carte.cle::before { border-color: rgba(255, 255, 255, 0.35); background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 2px, transparent 2px 6px); }
.cn-carte.cle.c-R { background: linear-gradient(180deg, var(--rouge-c), var(--rouge-f)); box-shadow: 0 3px 0 #6d1712, 0 8px 16px rgba(80, 10, 0, 0.4); }
.cn-carte.cle.c-B { background: linear-gradient(180deg, var(--bleu-c), var(--bleu-f)); box-shadow: 0 3px 0 #123569, 0 8px 16px rgba(10, 30, 80, 0.4); }
.cn-carte.cle.c-N { background: linear-gradient(180deg, var(--neutre-c), var(--neutre-f)); box-shadow: 0 3px 0 #85704a, 0 8px 16px rgba(60, 20, 0, 0.3); }
.cn-carte.cle.c-N::before { border-color: rgba(90, 65, 25, 0.3); background: repeating-linear-gradient(45deg, rgba(90, 65, 25, 0.12) 0 2px, transparent 2px 6px); }
.cn-carte.cle.c-A { background: linear-gradient(180deg, #34343b, #0f0f12); box-shadow: 0 3px 0 #000, inset 0 0 0 2px #ff4d4d, 0 8px 16px rgba(0, 0, 0, 0.5); }
.cn-carte.cle.c-A::after { content: '☠'; position: absolute; top: 10%; left: 0; right: 0; text-align: center; font-size: clamp(12px, 3.6vw, 24px); color: #ff6b6b; }

/* cartes retournées : couleur pleine + agent ; le mot reste lisible en petit */
.cn-carte.revele::before { display: none; }
.cn-carte.revele.c-R { background: linear-gradient(180deg, #e9554a, #a7261f); box-shadow: 0 3px 0 #6d1712, inset 0 0 0 2px rgba(255, 255, 255, 0.25); }
.cn-carte.revele.c-B { background: linear-gradient(180deg, #4b8de6, #1f529f); box-shadow: 0 3px 0 #123569, inset 0 0 0 2px rgba(255, 255, 255, 0.25); }
.cn-carte.revele.c-N { background: linear-gradient(180deg, #e7d4a8, #c2a979); box-shadow: 0 3px 0 #85704a, inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.cn-carte.revele.c-A { background: radial-gradient(circle at 50% 35%, #3c3c44, #050506); box-shadow: 0 3px 0 #000, inset 0 0 0 2px #ff4d4d; }
.cn-carte .figure { position: absolute; left: 0; right: 0; top: 4%; height: 70%; display: flex; justify-content: center; pointer-events: none; }
.cn-carte .figure .espion { width: auto; height: 100%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.cn-carte .figure.crane { align-items: center; font-size: clamp(18px, 6vw, 40px); color: #ff5b5b; text-shadow: 0 0 12px rgba(255, 60, 60, 0.6); }
.cn-carte.revele .etiquette-mot { background: rgba(255, 255, 255, 0.82); padding: 1px 2px; }
.cn-carte.revele .mot { font-size: min(clamp(7px, 2.2vw, 12px), calc((var(--larg) - 90px) / 5 / (var(--len, 6) * 0.72))); color: rgba(29, 26, 22, 0.75); }
/* fin de partie : les cartes non trouvées montrent leur couleur, un peu en retrait */
.cn-carte.fin:not(.revele) { filter: saturate(.75) brightness(.9); }
.cn-carte.retourne { animation: retourne .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes retourne { 0% { transform: rotateY(90deg) scale(.9); } 60% { transform: rotateY(-8deg) scale(1.04); } 100% { transform: none; } }

/* propositions des agents (avatars) et ma carte choisie */
.cn-carte .pointes { position: absolute; left: 3px; top: 3px; display: flex; gap: 1px; pointer-events: none; z-index: 1; }
.cn-carte .pointes span { font-size: clamp(10px, 2.6vw, 16px); line-height: 1; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.5)); }
.cn-carte.pointee { box-shadow: 0 0 0 3px #ffd34d, 0 3px 0 var(--creme-ombre), 0 8px 16px rgba(60, 20, 0, 0.35); }
.cn-carte.choisie { transform: translateY(-3px) scale(1.04); box-shadow: 0 0 0 3px #fff, 0 0 22px 5px rgba(255, 211, 77, 0.75); z-index: 2; }

/* ── Actions sous le plateau ─────────────────────────────── */
.cn-actions { display: flex; flex-direction: column; gap: 10px; }
.cn-confirme { display: flex; gap: 8px; align-items: stretch; padding: 10px; border-radius: 16px; background: var(--nuit); border: 1px solid rgba(255, 211, 77, 0.6); animation: monte .25s ease both; }
.cn-confirme .btn { flex: 1; }
.cn-confirme .btn-mini { flex: none; }
.cn-fin-tour { background: var(--nuit); border-color: rgba(255, 255, 255, 0.3); }
.cn-form-indice { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--nuit); border: 1px solid rgba(255, 255, 255, 0.16); }
.cn-form-indice .lbl { color: #ffd9a8; }
.cn-form-indice .champ { text-transform: uppercase; font-family: var(--titre); font-weight: 700; letter-spacing: 0.06em; background: #fff; color: #1d1a16; border-color: transparent; }
.cn-form-indice .champ::placeholder { color: rgba(29, 26, 22, 0.35); }
.cn-nombres { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cn-nombres button {
  min-height: 46px; border-radius: 12px; font-family: var(--titre); font-weight: 700; font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.22); color: #fff; transition: background .15s, transform .12s;
}
.cn-nombres button[aria-pressed="true"] { background: #fff; color: #1d1a16; transform: scale(1.05); }

/* ── Fin de partie ───────────────────────────────────────── */
.cn-fin {
  --c: var(--rouge-c);
  text-align: center; padding: 18px 16px; border-radius: 20px; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--c) 55%, transparent), var(--nuit) 70%);
  border: 2px solid color-mix(in srgb, var(--c) 70%, #fff); animation: monte .4s ease both;
}
.cn-fin.bleu { --c: var(--bleu-c); }
.cn-fin .gros { font-size: 2.6rem; line-height: 1; }
.cn-fin h2 { font-family: var(--titre); font-size: 1.5rem; margin-top: 8px; color: #fff; }
.cn-fin p { color: rgba(255, 244, 230, 0.85); margin-top: 4px; }
.cn-fin .actions-2 { margin-top: 14px; }

/* ── Historique ──────────────────────────────────────────── */
.cn-log { border-radius: 18px; padding: 12px; background: var(--nuit); border: 1px solid rgba(255, 255, 255, 0.14); min-width: 0; }
.log-titre { font-family: var(--titre); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: #ffd9a8; margin-bottom: 8px; }
.log-corps { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 980px) { .log-corps { max-height: 52vh; } }
.log-ligne { font-size: 0.84rem; line-height: 1.3; padding: 5px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); border-left: 3px solid var(--rouge-c); color: rgba(255, 244, 230, 0.85); }
.log-ligne.bleu { border-left-color: var(--bleu-c); }
.log-ligne.log-tap { margin-left: 10px; }
.log-qui { font-weight: 700; color: #fff; }
.log-indice { font-family: var(--titre); text-transform: uppercase; letter-spacing: 0.04em; color: #fff; }
.log-carte { font-family: var(--titre); text-transform: uppercase; font-size: 0.76rem; padding: 1px 6px; border-radius: 5px; color: #fff; }
.log-carte.c-R { background: var(--rouge-c); } .log-carte.c-B { background: var(--bleu-c); }
.log-carte.c-N { background: var(--neutre-c); color: #3b2f1c; } .log-carte.c-A { background: #000; color: #ff6b6b; }
.log-vide { font-size: 0.85rem; color: rgba(255, 244, 230, 0.6); }

/* =========================================================
   Téléphone (< 980 px) : tout le jeu tient à l'écran
   - barre compacte (chiffres + portraits) au lieu des grands panneaux,
     les équipes s'ouvrent en bas d'écran (modale) ;
   - plateau sur toute la largeur, cartes plus hautes pour le pouce,
     texte calé sur la largeur de l'écran, mots longs sur deux lignes ;
   - actions collées en bas, historique réduit aux deux dernières lignes.
   ========================================================= */
.cn-barre { display: none; }
@media (max-width: 979.98px) {
  .cn-pan { display: none; }
  .cn-table { grid-template-columns: minmax(0, 1fr); grid-template-areas: "centre" "log"; gap: 8px; }
  .ecran:has(.cn-table) { padding-top: 10px; gap: 8px; }
  .cn-centre { gap: 8px; }

  .cn-barre {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; width: 100%;
    padding: 6px; border-radius: 16px; background: var(--nuit); border: 1px solid rgba(255, 255, 255, 0.14); color: #fff; text-align: center;
  }
  .bq {
    --c: var(--rouge-c); --f: var(--rouge-f);
    display: flex; align-items: center; gap: 4px; padding: 3px 10px 3px 3px; border-radius: 12px; min-height: 48px;
    background: linear-gradient(180deg, var(--c), var(--f)); border: 2px solid rgba(255, 255, 255, 0.2);
  }
  .bq.bleu { --c: var(--bleu-c); --f: var(--bleu-f); flex-direction: row-reverse; padding: 3px 3px 3px 10px; }
  .bq.actif { box-shadow: 0 0 0 2px #ffe08a, 0 0 14px rgba(255, 224, 138, 0.6); }
  .bq .espion { width: 38px; height: 38px; border-radius: 9px; background: rgba(0, 0, 0, 0.2); padding: 2px; }
  .bq b { font-family: var(--titre); font-size: 1.7rem; line-height: 1; min-width: 1.2em; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
  .bq-milieu { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  .bq-milieu b { font-family: var(--titre); font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bq-milieu.rouge b { color: var(--rouge-cl); } .bq-milieu.bleu b { color: var(--bleu-cl); }
  .bq-milieu small { font-size: 0.72rem; color: rgba(255, 244, 230, 0.7); }

  /* bandeau : une ligne */
  .cn-bandeau { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 4px 10px; padding: 9px 10px 8px; }
  .cn-bandeau.attente { min-height: 0; }
  .cn-indice .mot { font-size: 1.15rem; padding: 3px 10px; }
  .cn-indice .nb { font-size: 1.15rem; min-width: 34px; }
  .cn-sous { font-size: 0.8rem; }
  .cn-sous.grand { font-size: 0.9rem; }

  /* plateau : pleine largeur (gouttière de 8 px), cartes plus hautes */
  .cn-plateau { --larg: 100vw; margin: 0 -8px; gap: 5px; }
  .cn-carte { aspect-ratio: 1.22; border-radius: 9px; padding: 4px; }
  .cn-carte::before { top: 8%; height: 30%; }
  .cn-carte .mot { letter-spacing: 0; font-size: min(15px, calc((100vw - 20px) / 5 - 14px) / var(--len, 6) * 1.6); }
  .cn-carte .mot.long { white-space: normal; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; line-height: 1.12; font-size: min(12.5px, calc((100vw - 20px) / 5 - 14px) / 5.4 * 1.6); }
  .cn-carte.revele .mot, .cn-carte.revele .mot.long { font-size: 8.5px; white-space: nowrap; }
  .cn-carte .figure { height: 66%; }

  /* actions à portée de pouce */
  .cn-actions:has(.cn-confirme, .cn-fin-tour) {
    position: sticky; bottom: 0; z-index: 5; margin: 0 -8px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(110, 42, 12, 0.92) 30%);
  }
  .cn-confirme { padding: 8px; }
  .cn-form-indice { padding: 12px; gap: 8px; }
  .cn-nombres button { min-height: 44px; }

  /* historique : les deux dernières lignes */
  .cn-log { padding: 10px 12px; }
  .cn-log .log-corps { max-height: none; }
  .cn-log:not(.modale-log) .log-ligne:nth-child(n+3) { display: none; }
}
.log-titre { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.log-tout { font-family: var(--texte); font-size: 0.8rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: #fff; padding: 6px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); min-height: 32px; }
@media (min-width: 980px) { .log-tout { display: none; } }
.modale-log { background: none; border: 0; padding: 12px 0 0; }
.modale-log .log-corps { max-height: 60vh; }

/* Point vert : joueur en ligne (vu il y a moins de 40 s) */
.cn-membre .av { position: relative; }
.pt-en-ligne {
  position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid #1a1410; box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}
.pt-en-ligne.pt-nom { position: static; display: inline-block; width: 7px; height: 7px; border-width: 0; margin-right: 5px; vertical-align: 1px; }
