/* ════════════════════════════════════════════════════════════
   GABARIT JEU DE CARTES — identité neutre et re-thémable.
   Tout passe par les variables de :root : changez ces valeurs (ou surchargez-les dans games/<id>/ui.js → `css`)
   pour donner une autre allure à un jeu. Les couleurs des familles de cartes appartiennent au jeu (ui.js).
   Polices : piles système (aucune ressource externe, fonctionne hors ligne).
   ════════════════════════════════════════════════════════════ */
:root {
  /* surfaces */
  --page: #0f1218;
  --surface: #181d27;
  --surface-2: #222b3d;
  --surface-3: #2c3750;
  --line: rgba(238, 241, 246, 0.12);
  --line-2: rgba(238, 241, 246, 0.22);
  /* texte */
  --text: #eef1f6;
  --text-2: #cfd6e2;
  --muted: #a4aec0;
  --paper-ink: #1f2430; /* texte sur fond clair (billet, bandeaux, notifications) */
  --paper-label: #586178;
  /* accent (actions, sélection, tour de jeu) */
  --accent: #ff7a45;
  --accent-2: #ffa276;
  --accent-dk: #b5461b;
  --info: #6fd6d6;
  --ok: #62d28e;
  --bad: #f05454;
  --bad-ink: #ff9a9a; /* rouge lisible sur fond sombre (≥ 7:1) */
  --bad-paper: #b3362b; /* rouge lisible sur fond clair (≥ 5:1) */
  --focus: #ffffff; /* anneau de focus clavier */
  /* table de jeu */
  --felt-1: #1d5a46;
  --felt-2: #154536;
  --felt-3: #0e3226;
  --rim: #14171f;
  /* typographie */
  --f-display: 'Trebuchet MS', 'Segoe UI', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --fw-display: 800;
  --f-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --f-label: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --r: 12px;
  --cw: 84px; /* largeur de base d'une carte (pli) */
  --ch: calc(var(--cw) * 1.48);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 700px) and (min-height: 700px) { :root { --cw: 96px; } }
@media (min-width: 1100px) and (min-height: 800px) { :root { --cw: 124px; } }
@media (max-height: 700px) and (orientation: portrait) { :root { --cw: 72px; } }
@media (max-height: 520px) and (orientation: landscape) { :root { --cw: 56px; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--page);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body::before { /* halo discret */
  content: '';
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, rgba(255, 122, 69, 0.10), transparent 60%), radial-gradient(90% 60% at 50% 110%, rgba(46, 140, 108, 0.12), transparent 60%);
}
svg.ic { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.ticket :focus-visible, .toast :focus-visible { outline-color: var(--paper-ink); }
.card:focus-visible { outline-offset: 4px; border-radius: calc(var(--cw) * 0.12); }
.skip-link { position: absolute; left: 8px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--paper-ink); font-family: var(--f-label); font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 8px; }
.sr-only { position: fixed; top: 0; left: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd {
  font-family: var(--f-label); font-size: 0.72em; font-weight: 700;
  padding: 0.05em 0.45em; border-radius: 5px; border: 1px solid var(--line-2);
  border-bottom-width: 3px; background: rgba(255, 255, 255, 0.04); color: var(--text-2);
}
@media (hover: none) {
  .kbd-only { display: none !important; }
}
/* ───────── Boutons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0.6em 1.3em; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: var(--surface-2);
  font-family: var(--f-label); font-weight: 700; font-size: 1rem; letter-spacing: 0.04em;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s;
  touch-action: manipulation;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-accent {
  background: linear-gradient(180deg, var(--accent-2), var(--accent) 55%, var(--accent-dk));
  color: #2a1304; border-color: #ffd0b5;
  box-shadow: 0 2px 0 #6b4f1c, 0 8px 22px rgba(255, 122, 69, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-icon { min-height: 44px; width: 44px; padding: 0; border-radius: 50%; }
.btn-sm { min-height: 44px; padding: 0.3em 0.9em; font-size: 0.9rem; }
.btn .ic { width: 1.25em; height: 1.25em; }
/* ───────── Accueil ───────── */
.home { min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px calc(28px + var(--safe-b)); }
.home-inner { width: min(500px, 100%); }
.brand { text-align: center; margin-bottom: 26px; }
svg.brand-crest { width: 92px; height: 92px; color: var(--accent); margin: 0 auto 6px; display: block; filter: drop-shadow(0 6px 16px rgba(255, 122, 69, 0.35)); }
.brand h1 {
  font-family: var(--f-display); font-weight: var(--fw-display); margin: 0;
  font-size: clamp(3rem, 14vw, 4.6rem); line-height: 0.9; letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--accent-2), var(--accent) 60%, #a37a33);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub {
  font-family: var(--f-label); letter-spacing: 0.32em; font-size: 0.85rem; color: var(--info);
  display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 6px;
}
.brand .sub::before, .brand .sub::after { content: ''; height: 1px; width: 38px; background: currentColor; opacity: 0.5; }
.panel {
  background: linear-gradient(180deg, rgba(34, 43, 61, 0.9), rgba(24, 29, 39, 0.95));
  border: 1px solid var(--line-2); border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.panel + .panel { margin-top: 14px; }
.panel h2 { font-family: var(--f-label); font-size: 0.95rem; letter-spacing: 0.18em; color: var(--accent); margin: 0 0 14px; font-weight: 800; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-family: var(--f-label); font-size: 0.85rem; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; min-height: 50px; padding: 0 16px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.28); border: 1.5px solid var(--line-2); color: var(--text);
  font: 600 1.1rem var(--f-body);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 122, 69, 0.18); }
.input::placeholder { color: #7f8a9d; opacity: 1; }
.input.code { text-transform: uppercase; letter-spacing: 0.4em; font-family: var(--f-label); font-weight: 800; text-align: center; font-size: 1.4rem; }
.emblems { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 520px) {
  .home .emblems { grid-template-columns: repeat(8, 1fr); gap: 6px; }
}
.emblem-opt {
  min-height: 48px; aspect-ratio: 1.15; border-radius: 12px; transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease); border: 1.5px solid var(--line); background: rgba(0, 0, 0, 0.2);
  display: grid; place-items: center; color: var(--text-2); padding: 0;
}
.emblem-opt .ic { width: 58%; height: 58%; stroke-width: 3.2; }
.emblem-opt:active { transform: scale(0.94); }
@media (hover: hover) {
  .emblem-opt:hover { border-color: var(--accent-dk); color: var(--accent-2); }
}
.emblem-opt[aria-checked='true'] { border-color: var(--accent); color: var(--accent-2); background: rgba(255, 122, 69, 0.12); }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; }
.or { text-align: center; font-family: var(--f-label); color: var(--muted); letter-spacing: 0.2em; font-size: 0.8rem; margin: 14px 0; }
.foot-note { text-align: center; color: var(--muted); font-size: 0.9rem; margin-top: 18px; font-style: italic; }
@media (max-height: 520px) and (orientation: landscape) {
  /* accueil en deux colonnes : emblème à gauche, formulaire à droite */.home { padding-top: 12px; padding-bottom: 12px; }
  .home-inner { width: min(900px, 100%); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 4px 28px; align-items: center; }
  .brand { margin: 0; }svg.brand-crest { width: 64px; height: 64px; }
  .brand h1 { font-size: 3.2rem; }
  .foot-note { grid-column: 1; margin: 0; text-align: center; }
  .home .panel { grid-column: 2; grid-row: 1 / span 2; padding: 16px 18px; }
  .home .emblems { grid-template-columns: repeat(8, 1fr); gap: 5px; }
  .home .emblem-opt { min-height: 40px; }
  .home .panel .or { margin: 8px 0; }
  .field { margin-bottom: 10px; }
}
/* ───────── Salon d'attente ───────── */
.lobby { min-height: 100dvh; padding: 18px 16px calc(110px + var(--safe-b)); max-width: 980px; margin: 0 auto; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.wordmark { font-family: var(--f-display); font-size: 1.7rem; color: var(--accent); line-height: 1; letter-spacing: 0.02em; display: flex; align-items: center; gap: 8px; }
.wordmark .ic { width: 1.1em; height: 1.1em; }
.ticket {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  background: var(--text); color: var(--paper-ink); border-radius: 16px; padding: 18px 20px;
  box-shadow: var(--shadow);
  background-image: radial-gradient(circle at 0 50%, var(--page) 10px, transparent 11px), radial-gradient(circle at 100% 50%, var(--page) 10px, transparent 11px);
}
.ticket .lbl { font-family: var(--f-label); font-size: 0.8rem; letter-spacing: 0.2em; color: var(--paper-label); }
.ticket .code-big { font-family: var(--f-display); font-size: clamp(2.6rem, 12vw, 3.6rem); letter-spacing: 0.12em; line-height: 1; color: var(--bad-paper); }
.ticket .actions { display: flex; gap: 8px; }
.ticket .btn { background: var(--paper-ink); color: var(--text); border-color: transparent; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 14px; }
@media (min-width: 820px) {
  .lobby-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}
.crew { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.crew li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line);
  animation: rise 0.35s var(--ease) both;
}
.crew .who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
.crew .nm { font-weight: 700; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.crew .tag { font-family: var(--f-label); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.crew .tag.me { color: var(--info); }
.crew .tag.off { color: var(--muted); font-style: italic; }
.crew .btn-icon { width: 44px; min-height: 44px; flex: none; }
.crew .empty { color: var(--muted); border-style: dashed; justify-content: center; font-style: italic; min-height: 52px; }
.seat-no { font-family: var(--f-display); color: var(--muted); width: 1.2em; text-align: center; font-size: 1.2rem; }
.avatar {
  --c: var(--accent);
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, color-mix(in oklab, var(--c) 55%, white 10%), color-mix(in oklab, var(--c) 70%, black 45%));
  border: 2px solid color-mix(in oklab, var(--c) 60%, white 30%); color: #fff8f0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.avatar .ic { width: 62%; height: 62%; stroke-width: 4; }
.opt-group { display: grid; gap: 8px; margin-bottom: 16px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
@media (min-width: 560px) and (max-width: 819px), (min-width: 1000px) {
  .seg { grid-template-columns: repeat(4, 1fr); }
}
.seg button, .toggle {
  border: 1.5px solid var(--line-2); background: rgba(0, 0, 0, 0.2); border-radius: 12px;
  padding: 10px 6px; text-align: center; min-height: 54px;
}
.seg button b, .toggle b { display: block; font-family: var(--f-label); font-weight: 800; letter-spacing: 0.04em; }
.seg button small, .toggle small { color: var(--muted); font-size: 0.78rem; }
.seg button[aria-pressed='true'], .toggle[aria-pressed='true'] { border-color: var(--accent); background: rgba(255, 122, 69, 0.13); color: var(--accent-2); }
.seg button:disabled, .toggle:disabled { cursor: default; }
.toggles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.toggle { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.toggle .ic { width: 28px; height: 28px; }
.start-bar {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(15, 18, 24, 0.95) 30%);
  display: flex; justify-content: center; gap: 10px; z-index: 5;
}
.start-bar .btn-accent { min-width: min(360px, 100%); min-height: 56px; font-size: 1.1rem; }
.cheat { font-size: 0.95rem; color: var(--text-2); }
.cheat ol { margin: 0; padding-left: 1.2em; }
.cheat li { margin: 0.3em 0; }
.cheat .mini-cards { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; vertical-align: middle; margin: 4px 0; }
.emote-bubble {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--text); color: var(--paper-ink); padding: 6px 12px; border-radius: 12px;
  font-weight: 700; font-size: 0.9rem; white-space: nowrap; box-shadow: var(--shadow);
  animation: pop 2.6s var(--ease) forwards; pointer-events: none;
}
.emote-bubble::before { content: ''; position: absolute; top: -6px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--text); }
/* Table */
.table-wrap { grid-area: table; position: relative; display: grid; place-items: center; padding: 8px 10px; min-height: 0; min-width: 0; }
.table {
  position: relative; container-type: size; width: min(100%, 980px); height: 100%; max-height: 640px; min-height: 0;
  border-radius: 34px; /* table rectangulaire aux coins arrondis, partout (jamais d'ovale) */
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(46, 140, 108, 0.35), transparent 70%),
    radial-gradient(ellipse at center, #1d5a46 0%, #154536 55%, #0e3226 100%);
  box-shadow:
    inset 0 0 0 6px #14171f, inset 0 0 0 8px var(--accent-dk), inset 0 0 0 9px var(--accent), inset 0 0 0 11px #14171f,
    inset 0 20px 60px rgba(0, 0, 0, 0.55), 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden;
}
.table.art { background-size: cover; background-position: center; }
.table::before { /* rose des vents en filigrane */
  content: ''; position: absolute; width: 58%; aspect-ratio: 1; max-height: 90%; opacity: 0.08;
  background: repeating-radial-gradient(circle at center, rgba(255,255,255,0.9) 0 2px, transparent 2px 46px); border-radius: 50%;
}
/* Le pli : une rangée de places FIXES (cartes qui se chevauchent à partir de 5 joueurs) ; les places à venir sont dessinées en pointillé */
.trick {
  --W: calc(100cqw - 22px); --bud: calc(100cqh - 20px);
  --tcw: min(calc(var(--cw) * 1.3), calc((var(--bud) - var(--lab, 30px)) / 1.48), calc(var(--W) / (1 + 0.5 * (var(--n, 2) - 1))));
  --step: min(calc(var(--tcw) + 10px), calc((var(--W) - var(--tcw)) / (var(--n, 2) - 1)));
  position: relative; display: flex; justify-content: flex-start; align-items: flex-end; z-index: 1;
  width: calc((var(--n, 2) - 1) * var(--step) + var(--tcw)); max-width: 100%;
}
.game[data-phase='play'] .trick, .game[data-phase='pause'] .trick { --bud: calc(100cqh - 100px); margin-bottom: 64px; }
/* place TOUJOURS réservée au bandeau du pli : rien ne se redimensionne quand il apparaît */
.trick .card { --cw: max(var(--tcw), 24px); }
.trick .slot { position: relative; z-index: calc(var(--k, 0) + 1); display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; flex: none; width: var(--step); }
.trick .slot:last-child { width: var(--tcw); }
.trick .slot .who {
  font-family: var(--f-label); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1.05; text-align: center; width: 100%;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; color: var(--text);
}
.trick .slot .who i { display: block; height: 3px; border-radius: 2px; background: var(--c); margin: 0 auto 2px; width: 70%; }
.trick .slot.win .card { box-shadow: 0 0 0 3px var(--accent-2), 0 0 30px rgba(255, 162, 118, 0.6); transform: translateY(-6px) scale(1.05); z-index: 2; }
.trick .slot.win .who { color: var(--accent-2); }
.trick .slot.lose .card { filter: saturate(0.6) brightness(0.75); }
.table-msg { text-align: center; color: var(--text-2); font-style: italic; z-index: 1; padding: 0 22px; max-width: 100%; text-wrap: balance; }
.table-msg .big { font-family: var(--f-display); font-style: normal; font-size: clamp(1.6rem, 7cqw, 2.4rem); color: var(--accent-2); display: block; line-height: 1.1; margin-bottom: 4px; }
.table-msg .who-turn { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line-2); font-style: normal; font-weight: 700; color: var(--text); }
.table-msg .who-turn .avatar { width: 26px; height: 26px; }
.lead-chip {
  position: absolute; top: 1px; left: 50%; transform: translateX(-50%); z-index: 6; white-space: nowrap;
  font-family: var(--f-label); font-size: 0.78rem; letter-spacing: 0.1em; font-weight: 800; color: #fff8f0;
  display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px;
  background: color-mix(in oklab, var(--sc) 62%, #0f1218); border: 1.5px solid color-mix(in oklab, var(--sc) 55%, #eef1f6);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.lead-chip .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, var(--sc) 70%, #eef1f6 20%); color: #fff; }
.lead-chip .dot .ic { width: 14px; height: 14px; stroke-width: 4.5; }
.result-banner {
  position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); z-index: 3; width: max-content;
  background: var(--text); color: var(--paper-ink); border-radius: 12px; padding: 7px 16px; text-align: center;
  box-shadow: var(--shadow); animation: rise-c 0.4s var(--ease) both; max-width: 86%;
}
.result-banner b { font-family: var(--f-display); font-weight: var(--fw-display); font-size: 1.3rem; line-height: 1.1; color: var(--bad-paper); }
.result-banner small { display: block; font-size: 0.85rem; line-height: 1.2; }
@media (max-width: 520px) {
  .result-banner { padding: 5px 12px; }
  .result-banner b { font-size: 1.1rem; }
  .result-banner small { font-size: 0.78rem; }
}
@container (max-height: 175px) {
  .table-msg { font-size: 0.8rem; line-height: 1.2; padding: 0 12%; }
  .table-msg .big { font-size: 1.3rem; }
}
@container (max-height: 120px) {
  .table-msg > :not(.big) { display: none; }
  .table-msg .big { margin: 0; }
}
/* ───────── Cartes « à index » ─────────
   Couleur franche par famille, gros chiffre + pictogramme dans le coin gauche (reste lisible quand les cartes se
   recouvrent : en éventail, en pli, en fiche), grand pictogramme en filigrane dans le reste de la carte.
   Les images de assets/cards/manifest.json s'affichent toujours pleine carte. */
.card {
  --sc: var(--s-black); --bg: #2a7447; --page: #f6efd6;
  position: relative; flex: none; width: var(--cw); height: calc(var(--cw) * var(--ratio, 1.48)); padding: 0;
  border-radius: calc(var(--cw) * 0.12); border: none;
  background: var(--c-bg); color: var(--page);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), 0 7px 14px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s var(--ease), filter 0.2s, box-shadow 0.2s;
  display: block; overflow: hidden; text-align: left; font-family: var(--f-display);
}
.card::after { /* filet intérieur */
  content: ''; position: absolute; inset: calc(var(--cw) * 0.035); border-radius: calc(var(--cw) * 0.09); border: max(1.5px, calc(var(--cw) * 0.02)) solid currentColor; opacity: 0.45; pointer-events: none;
}
.card .c-corner { position: absolute; top: 4%; left: calc(var(--cw) * 0.1); display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--cw) * 0.03); z-index: 2; line-height: 1; }
.card .c-corner .c-v { position: static; font-size: calc(var(--cw) * 0.5); line-height: 0.82; letter-spacing: -0.02em; }
.card .c-s { position: static; width: calc(var(--cw) * 0.28); height: calc(var(--cw) * 0.28); flex: none; }
.card .c-s .ic { width: 100%; height: 100%; stroke-width: 4.5; }
.card .c-v.br { display: none; }
.card .c-art { position: absolute; inset: auto calc(var(--cw) * 0.06) calc(var(--cw) * 0.07) calc(var(--cw) * 0.36); aspect-ratio: 1; display: grid; place-items: center; }
.card .c-art .ic { width: 100%; height: 100%; stroke-width: 2.6; }
.card.has-art .c-art { inset: 0; aspect-ratio: auto; }
.card.has-art .c-art .ic { display: none; }
.card .c-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .c-name { display: none; }
.card .c-key {
  position: absolute; top: 4px; right: 4px; z-index: 3; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 5px; display: grid; place-items: center;
  font-family: var(--f-label); font-weight: 800; font-size: 11px; line-height: 1; color: #f6ecd2; background: rgba(24, 16, 8, 0.78);
}
@media (hover: none) {
  .card .c-key { display: none; }
}
.card.mini .c-s { display: none; }
/* Numéros : une couleur pleine par famille (l'encre est choisie pour le contraste, ≥ 4,5:1) */
/* Spéciales : le pictogramme sert d'index, le nom dessous, un grand filigrane derrière */
.card:not(.k-num) .c-corner .c-v { width: calc(var(--cw) * 0.5); height: calc(var(--cw) * 0.5); line-height: 1; }
.card:not(.k-num) .c-corner .c-v .ic { width: 100%; height: 100%; stroke-width: 3.4; }
.card:not(.k-num) .c-name {
  display: block; position: absolute; z-index: 2; top: calc(var(--cw) * 0.66); left: calc(var(--cw) * 0.1); width: calc(var(--cw) * 0.84);
  font-family: var(--f-label); font-weight: 800; font-size: max(11px, calc(var(--cw) * 0.16)); letter-spacing: 0.02em; line-height: 1.02; text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; white-space: normal;
}
.card:not(.k-num) .c-art { opacity: 0.2; inset: auto calc(var(--cw) * -0.08) calc(var(--cw) * -0.04) auto; width: 80%; }
.card.has-art:not(.k-num) .c-art { opacity: 1; inset: 0; width: auto; }
/* Mini : pastille de carte (fiche, aide, antisèche) — l'index seul, centré */
.card.mini { --cw: 34px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); cursor: default; }
.card.mini .c-name, .card.mini .c-art { display: none; }
.card.mini .c-corner { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.card.mini .c-corner .c-v { font-size: calc(var(--cw) * 0.7); }
.card.mini:not(.k-num) .c-corner .c-v { display: block; width: calc(var(--cw) * 0.7); height: calc(var(--cw) * 0.7); }
.card.mini::after { display: none; }
.card.enter { animation: toss 0.38s var(--ease) both; }
.card.back { --c-bg: #14171f; background: repeating-linear-gradient(45deg, #14171f 0 6px, #1d2230 6px 12px); color: var(--accent); }
/* ───────── Feuilles & modales ───────── */
/* Panneau latéral (ordinateur) : la carte en grand lisible, le journal replié */
.side { grid-area: side; display: none; border-left: 2px solid var(--line-2); background: rgba(0, 0, 0, 0.22); min-height: 0; flex-direction: column; }
@media (min-width: 1100px) and (min-height: 521px) {
  .side { display: flex; }
}
.side h3 { font-family: var(--f-label); letter-spacing: 0.16em; color: var(--accent); font-size: 1rem; margin: 16px 18px 8px; }
.jr { flex: none; border-top: 2px solid var(--line-2); }
.jr summary { cursor: pointer; padding: 14px 18px; font-family: var(--f-label); font-weight: 800; letter-spacing: 0.14em; color: var(--accent); font-size: 1rem; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
.jr summary::-webkit-details-marker { display: none; }
.jr summary::after { content: '+'; font-size: 1.6rem; line-height: 1; }
.jr[open] summary::after { content: '−'; }
.journal { list-style: none; margin: 0; padding: 0 18px 12px; overflow-y: auto; max-height: 28vh; display: flex; flex-direction: column; gap: 6px; font-size: 1rem; }
.journal li { padding: 6px 10px; border-left: 3px solid var(--line-2); color: var(--text-2); animation: rise 0.3s var(--ease) both; }
.journal li.j-trick { border-color: var(--info); }
.journal li.j-bid { border-color: var(--accent); }
.journal li.j-round { border-color: var(--bad); color: var(--text); font-weight: 600; }
.journal time { font-family: var(--f-label); font-size: 0.85rem; color: var(--muted); margin-right: 6px; }
.side .emotes { padding: 4px 18px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.overlay {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center;
  background: rgba(5, 7, 10, 0.72); animation: fade 0.2s ease both;
}
@media (min-width: 700px) {
  .overlay { place-items: center; }
}
.sheet {
  width: min(720px, 100%); max-height: 90dvh; display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2);
  border-radius: 20px 20px 0 0; padding: 18px 18px 0; box-shadow: var(--shadow);
  animation: slide-up 0.32s var(--ease) both;
}
@media (min-width: 700px) {
  .sheet { border-radius: 20px; max-height: 88dvh; }
}
.sheet-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sheet-head h2 { margin: 0; font-family: var(--f-display); font-weight: var(--fw-display); font-size: 2rem; color: var(--accent-2); line-height: 1; }
.sheet .btn-icon { border-color: var(--line); background: transparent; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 16px; position: relative; }
.sheet-body:focus-visible, .scroll-x:focus-visible { outline-offset: -3px; }
.sheet-foot { flex: none; padding: 12px 0 calc(14px + var(--safe-b)); border-top: 1px solid var(--line-2); background: var(--surface); }
.sheet-foot .ready-row .btn { min-height: 48px; }
.scroll-x { overflow-x: auto; border-radius: 10px; }
table.scores { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.95rem; }
table.scores th, table.scores td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; min-width: 68px; }
table.scores thead th { font-family: var(--f-label); font-weight: 800; letter-spacing: 0.03em; color: var(--text-2); vertical-align: bottom; padding-top: 4px; }
table.scores thead th .avatar { width: 28px; height: 28px; margin: 0 auto 3px; }
table.scores .hn { display: block; max-width: 74px; overflow: hidden; text-overflow: ellipsis; font-size: 0.78rem; margin: 0 auto; }
table.scores tbody th, table.scores thead td:first-child, table.scores .total th { font-family: var(--f-label); color: var(--muted); text-align: left; position: sticky; left: 0; background: var(--surface-2); min-width: 56px; z-index: 1; }
table.scores tbody th small { opacity: 0.8; }
table.scores td .d { display: block; font-size: 0.78rem; font-family: var(--f-label); }
table.scores .pos { color: var(--ok); }
table.scores .neg { color: var(--bad-ink); }
table.scores .total th, table.scores .total td { font-family: var(--f-display); font-size: 1.35rem; color: var(--accent-2); background: var(--surface); border-bottom: 2px solid var(--accent-dk); padding: 4px 8px; }
table.scores .total th { font-size: 0.95rem; font-family: var(--f-label); letter-spacing: 0.1em; text-transform: uppercase; }
table.scores .total td.best { color: #2a1304; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
table.scores .none { color: var(--muted); font-style: italic; padding: 18px; white-space: normal; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.results li {
  display: grid; grid-template-columns: 1.4em auto minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line);
  animation: rise 0.4s var(--ease) both; animation-delay: calc(var(--i) * 60ms);
}
.results li:first-child { border-color: var(--accent-dk); background: rgba(255, 122, 69, 0.1); }
.results .rank { font-family: var(--f-display); font-size: 1.5rem; color: var(--muted); text-align: center; }
.results li:first-child .rank { color: var(--accent-2); }
.results .who { display: grid; min-width: 0; }
.results .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .nm em { font-weight: 400; color: var(--info); font-size: 0.85em; }
.results .det { font-size: 0.85rem; color: var(--muted); }
.results .delta { font-family: var(--f-display); font-size: 1.6rem; text-align: right; line-height: 1; }
.results .delta small { display: block; font-family: var(--f-label); font-size: 0.78rem; color: var(--text-2); }
.results .made { color: var(--ok); }
.results .miss { color: var(--bad-ink); }
.results .half { color: var(--accent-2); }
.ready-row { display: flex; gap: 8px 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.sheet-foot .ready-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.sheet-foot .ready-row > .btn-accent { grid-column: 1 / -1; }
.sheet-foot .ready-row > .hint { grid-column: 1 / -1; }
.ready-row .hint { width: 100%; text-align: center; color: var(--muted); font-size: 0.88rem; }
/* Fin de partie : le couronnement */
.sheet.end .sheet-body { padding-top: 0; }
.sheet.end::before { /* rayons de projecteur derrière le vainqueur */
  content: ''; position: absolute; left: 50%; top: 40px; width: 560px; height: 560px; margin-left: -280px; pointer-events: none; opacity: 0.55;
  background: repeating-conic-gradient(from 0deg, rgba(255, 162, 118, 0.16) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 68%); mask: radial-gradient(circle, #000 0, transparent 68%);
  animation: spin 60s linear infinite;
}
.sheet.end { position: relative; }
.sheet.end > * { position: relative; }
.champion { text-align: center; padding: 4px 0 2px; }
.champion .crown-big { display: block; width: 58px; height: 58px; margin: 0 auto -10px; color: var(--accent-2); position: relative; z-index: 1; filter: drop-shadow(0 4px 12px rgba(255, 162, 118, 0.5)); animation: crown-drop 0.9s var(--ease) 0.35s both; }
.champion .avatar { width: 84px; height: 84px; margin: 0 auto; border-width: 3px; box-shadow: 0 0 0 4px rgba(255, 162, 118, 0.35), 0 10px 30px rgba(0, 0, 0, 0.5); animation: slam 0.6s var(--ease) 0.15s both; }
.champ-name { margin: 10px 0 0; font-family: var(--f-display); font-size: clamp(2rem, 9vw, 2.9rem); line-height: 1; color: var(--accent-2); overflow-wrap: anywhere; text-wrap: balance; }
.champ-line { margin: 6px auto 0; color: var(--text-2); max-width: 30em; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin: 14px 0 12px; }
.podium .step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1 1 0; min-width: 0; max-width: 170px; animation: rise 0.6s var(--ease) both; }
.podium .step .avatar { width: 46px; height: 46px; }
.podium .block {
  width: 100%; border-radius: 10px 10px 0 0; display: grid; place-items: center; margin-top: 2px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-dk)); color: #2a1304; font-family: var(--f-display); font-size: 2rem;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35);
}
.podium .p1 .block { height: 96px; }
.podium .p2 .block { height: 70px; background: linear-gradient(180deg, #e6ecee, #8fa0a6); }
.podium .p3 .block { height: 52px; background: linear-gradient(180deg, #e0a56a, #8a5527); }
.podium .p1 { order: 2; }
.podium .p2 { order: 1; }
.podium .p3 { order: 3; }
.podium .nm { font-weight: 800; text-align: center; font-size: 0.92rem; line-height: 1.1; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.podium .pts { font-family: var(--f-label); color: var(--accent-2); font-weight: 800; font-size: 0.88rem; }
.rest { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.rest li { display: grid; grid-template-columns: 1.6em auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); }
.rest .rank { font-family: var(--f-display); color: var(--muted); font-size: 1.2rem; text-align: center; }
.rest .avatar { width: 30px; height: 30px; }
.rest .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest b { font-family: var(--f-display); font-weight: var(--fw-display); font-size: 1.3rem; color: var(--text-2); }
.confetti-box { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.confetti { position: absolute; top: -14px; left: var(--x); width: 8px; height: 14px; background: var(--c); border-radius: 2px; opacity: 0; animation: confetti var(--t) ease-in var(--d) 1 both; animation-delay: calc(var(--d) + var(--el, 0ms)); }
.confetti.coin { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(42, 19, 4, 0.35); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice button {
  border: 2px solid var(--line-2); border-radius: 16px; background: rgba(0, 0, 0, 0.25); padding: 16px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 150px;
}
.choice button:hover, .choice button:focus-visible { border-color: var(--accent); }
.choice button b { font-family: var(--f-display); font-weight: var(--fw-display); font-size: 1.6rem; color: var(--accent-2); }
.choice button small { color: var(--muted); }
.choice .ic { width: 48px; height: 48px; }
.emote-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.emote-grid .btn { justify-content: flex-start; border-radius: 12px; text-align: left; line-height: 1.15; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; font-size: 0.95rem; }
.help-grid dt { text-align: right; }
.help-grid dd { margin: 0; color: var(--text-2); }
.rules-h { font-family: var(--f-label); color: var(--accent); letter-spacing: 0.15em; font-size: 0.85rem; margin: 18px 0 8px; }
.reveal {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(circle, rgba(15, 18, 24, 0.75), rgba(15, 18, 24, 0.92));
  animation: fade 0.25s ease both, fade 0.4s ease 1.9s reverse forwards;
}
.reveal .inner { text-align: center; max-width: 100%; }
.reveal h2 { font-family: var(--f-display); font-weight: var(--fw-display); font-size: clamp(3rem, 14vw, 5.5rem); color: var(--accent-2); margin: 0; animation: slam 0.5s var(--ease) both; line-height: 1; }
.reveal .bids-reveal { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 18px; padding: 0 16px; }
.reveal .bids-reveal div { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 74px; animation: flip 0.5s var(--ease) both; animation-delay: calc(0.35s + var(--i) * 90ms); }
.reveal .bids-reveal b { font-family: var(--f-display); font-size: 2.6rem; font-weight: var(--fw-display); line-height: 1; }
.reveal .bids-reveal span { font-family: var(--f-label); font-size: 0.85rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-height: 520px) and (orientation: landscape) {
  .reveal .bids-reveal { gap: 8px; margin-top: 8px; }
  .reveal h2 { font-size: 3rem; }
  .reveal .bids-reveal b { font-size: 1.8rem; }
  .reveal .bids-reveal div { width: 64px; }
  .sheet { max-height: 96dvh; width: min(860px, 100%); border-radius: 16px; padding-top: 10px; }
  .overlay { place-items: center; }
  .sheet-head { margin-bottom: 6px; }
  .sheet-head h2 { font-size: 1.6rem; }
  .results { grid-template-columns: 1fr 1fr; gap: 6px; }
  .results li { padding: 5px 10px; }
  .podium { margin: 6px 0; }
  .champion .avatar { width: 56px; height: 56px; }
  .champion .crown-big { width: 40px; height: 40px; }
  .sheet-foot { padding: 8px 0 8px; }
  .sheet-foot .ready-row .btn { min-height: 44px; }
  .sheet-foot .hint { display: none; }
  .sheet-foot .ready-row { display: flex; flex-wrap: nowrap; }
  .sheet-foot .ready-row > .btn-accent { flex: 1 1 auto; }
}
#toasts { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--text); color: var(--paper-ink); padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; animation: rise 0.3s var(--ease) both; text-align: center; }
.toast.err { background: #f9d7d7; border-left: 5px solid var(--bad); }
.conn {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); background: #8a2a2a; color: #fff; text-align: center;
  font-family: var(--f-label); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #ffd9d3; animation: blink 1.2s infinite both; flex: none; }
body.offline #toasts { top: 52px; }
/* ───────── Animations ───────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise-c { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255, 162, 118, 0.6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(255, 162, 118, 0); } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes crown-drop { from { transform: translateY(-50px) rotate(-14deg); opacity: 0; } 60% { transform: translateY(4px) rotate(3deg); } }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 100% { opacity: 0; transform: translate(var(--sw), 105dvh) rotate(var(--rot)); } }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }
@keyframes deal { from { opacity: 0; transform: translateY(-120px) rotate(-12deg) scale(0.7); } }
@keyframes toss { from { opacity: 0; transform: translateY(60px) rotate(8deg) scale(0.8); } }
@keyframes pop { 0% { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(0.8); } 10%, 85% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } 100% { opacity: 0; transform: translateX(-50%) translateY(-6px); } }
@keyframes slam { from { transform: scale(2.2) rotate(-6deg); opacity: 0; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 122, 69, 0.0), 0 0 30px rgba(255, 122, 69, 0.45); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    /* les animations « forwards » qui finissent invisibles doivent rester lisibles quand elles sont figées */.reveal { animation: none; }
  .emote-bubble { animation: none; opacity: 1; transform: translateX(-50%); }
  .status .dots i { opacity: 0.7; }
  .confetti { display: none; }
}
/* ───────── Règles avancées : pouvoirs des pirates, Rascal, boulet de canon ───────── */
.ic.inl { width: 1em; height: 1em; vertical-align: -0.15em; }
.sheet-head h2 .ic { width: 0.8em; height: 0.8em; vertical-align: -0.08em; margin-right: 4px; }
.choice.c3 { grid-template-columns: repeat(3, 1fr); }
.choice.c3 button { min-height: 130px; position: relative; }
.choice.c3 button b { font-size: 2.6rem; line-height: 1; }
.choice.c3 button:disabled { opacity: 0.35; cursor: not-allowed; }
.choice.players { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice.players button { min-height: 104px; position: relative; }
.choice.players button b { font-size: 1.15rem; font-family: var(--f-label); font-weight: 800; letter-spacing: 0.03em; color: var(--text); }
.choice button kbd { position: absolute; top: 8px; right: 10px; }
.card.sm { --cw: 66px; cursor: default; }
@media (min-width: 700px) {
  .card.sm { --cw: 76px; }
}
table.scores td s { opacity: 0.55; }
.game[data-phase='play'] .table-wrap, .game[data-phase='pause'] .table-wrap { padding-top: 24px; }
/* place réservée à la pastille « Couleur », qu'elle soit là ou non */
.lead-chip { top: 2px; }
@media (max-height: 520px) and (orientation: landscape) {
  .game[data-phase='play'] .table-wrap, .game[data-phase='pause'] .table-wrap { padding-top: 16px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .table::before { width: 46%; }
}
/* ───────── Arrivants « à quai », menu de la table ───────── */
.quai {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 7px 12px; border-radius: 12px; border: 1px dashed var(--accent); background: rgba(255, 122, 69, 0.1);
  font-size: 0.92rem; color: var(--text); max-width: 640px; animation: rise 0.3s var(--ease) both;
}
.quai > .ic { width: 22px; height: 22px; color: var(--accent-2); }
.quai.self { border-style: solid; text-align: left; justify-content: flex-start; flex-wrap: nowrap; }
.quai.self span { flex: 1; }
.btn-icon.has-badge { border-color: var(--accent); color: var(--accent-2); }
.btn-icon { position: relative; }
.btn-icon .badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--bad); color: #fff; font: 800 11px/18px var(--f-label); text-align: center;
}
.menu-list { display: grid; gap: 8px; }
.menu-item { justify-content: flex-start; text-align: left; border-radius: 14px; min-height: 56px; padding: 10px 14px; }
.menu-item span { display: flex; flex-direction: column; }
.menu-item small { font-family: var(--f-body); font-weight: 400; letter-spacing: 0; font-size: 0.82rem; color: var(--muted); }
.menu-item.btn-accent small { color: #4a2410; }
.menu-emote { display: none; }
/* l'interpellation n'apparaît dans le menu que là où son bouton quitte la barre (paysage) */
.confirm { border: 1.5px solid var(--bad); border-radius: 14px; padding: 12px 14px; background: rgba(240, 84, 84, 0.12); }
.confirm p { margin: 0 0 10px; }
.btn-danger { background: var(--bad); border-color: #e87878; color: #fff; }
.quai-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.quai-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.quai-list li > span:not(.avatar) { flex: 1; display: flex; flex-direction: column; }
.quai-list small { color: var(--muted); font-size: 0.8rem; }
.recent-list { display: grid; gap: 8px; }
.recent {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-decoration: none; color: var(--text);
  padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: rgba(0, 0, 0, 0.2); min-height: 48px;
}
.recent:hover, .recent:focus-visible { border-color: var(--accent); }
.recent b { font-family: var(--f-label); letter-spacing: 0.2em; color: var(--accent-2); }
.recent span { font-size: 0.88rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .ic { color: var(--accent); }
.start-bar { flex-wrap: wrap; }
.away-note { order: -1; flex-basis: 100%; margin: 0; text-align: center; font-size: 0.85rem; color: var(--text-2); }
.away-note::before { content: ""; }
.start-bar .away-note { background: none; }
.start-bar:has(.away-note) { padding-top: 26px; background: linear-gradient(180deg, transparent, rgba(15, 18, 24, 0.97) 22%); }
/* ───────── Compréhension des règles : fiche de carte, carte en tête, objectif, « qui bat qui » ───────── */
.card-info { width: 100%; max-width: 640px; min-height: 0; }
.card-info:empty { display: none; }
.ci {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  padding: 6px 8px 6px 6px; border-radius: 12px; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line-2);
  animation: fade 0.15s ease both;
}
.ci .card.mini { --cw: 30px; }
.ci-txt { min-width: 0; }
.ci-txt p { margin: 0; font-size: 0.86rem; line-height: 1.3; color: var(--text-2); }
.ci-role b { color: var(--text); }
.ci-by { margin-left: 6px; font-family: var(--f-label); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.04em; }
.ci-fc { font-weight: 700; margin-top: 2px !important; }
.fc-win { color: var(--ok) !important; }
.fc-lose { color: #f0b49f !important; }
.fc-bad { color: #ff9a9a !important; }
.fc-neutral { color: var(--info) !important; }
.ci-more {
  flex: none; min-width: 36px; height: 36px; border-radius: 18px; border: 1.5px solid var(--line-2); background: transparent;
  color: var(--accent-2); font: 800 0.9rem var(--f-label); padding: 0 10px;
}
.ci-more:hover { border-color: var(--accent); }
.ci-hint { margin: 0; text-align: center; font-size: 0.85rem; color: var(--muted); display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.ci-hint .ci-more { height: 30px; font-size: 0.8rem; }
@media (max-height: 760px) and (orientation: portrait) {
  .ci-txt p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.8rem; }
  .ci-fc { -webkit-line-clamp: 1 !important; }
  .ci-hint { display: none; }
}
@media (hover: none) {
  .card-info .ci-hint { display: none; }
}
.lead-hint { font-weight: 500; letter-spacing: 0.02em; opacity: 0.85; }
@media (max-width: 560px) { .lead-hint { display: none; } }
.trick .slot { position: relative; }
.trick .slot.lead .card { box-shadow: 0 0 0 2px var(--accent), 0 0 18px rgba(255, 162, 118, 0.45); }
.lead-tag {
  position: absolute; top: 3px; left: 50%; transform: translateX(-50%); z-index: 3; white-space: nowrap;
  font: 800 0.62rem/1 var(--f-label); letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--accent); color: #2a1304; padding: 3px 6px; border-radius: 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}
.trick .slot.inspect .card { outline: 2px dashed var(--info); outline-offset: 3px; }
.trick [data-tidx] { cursor: help; }
/* Panneau latéral (grand écran) */
.side-card { padding: 0 18px 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.side-card h3 { margin-left: 0 !important; }
#side-info { font-size: 1.1rem; color: var(--text-2); line-height: 1.35; }
.si-empty { margin: 0 0 12px; color: var(--muted); }
.si-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.si-head .card.sm { --cw: 76px; }
.si-head b { display: block; font-family: var(--f-display); font-weight: var(--fw-display); font-size: 1.9rem; color: var(--accent-2); line-height: 1.05; }
.si-head small { display: block; color: var(--muted); font-size: 1rem; }
.si-tag { display: inline-block; font: 800 0.85rem var(--f-label); letter-spacing: 0.1em; text-transform: uppercase; border: 1.5px solid var(--line-2); border-radius: 6px; padding: 1px 8px; margin-top: 4px; }
.si-role { margin: 8px 0; color: var(--text); }
.si-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.si-cols h4 { margin: 4px 0; font: 800 0.9rem var(--f-label); letter-spacing: 0.12em; color: var(--info); text-transform: uppercase; }
.si-cols ul { margin: 0; padding-left: 1.1em; }
.si-cols li { margin: 3px 0; }
.si-bonus { margin: 10px 0 0; display: flex; gap: 8px; align-items: center; color: var(--accent-2); }
.si-bonus .ic { width: 22px; height: 22px; }
.si-note { margin: 8px 0 0; font-size: 1rem; color: var(--muted); }
/* Feuille « Règles & aide » */
.rules-h small { font-family: var(--f-body); letter-spacing: 0; color: var(--muted); font-weight: 400; margin-left: 6px; }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: lad; }
.lad {
  display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 122, 69, calc(0.04 + var(--k, 0) * 0.04)), rgba(0, 0, 0, 0.2));
  border: 1px solid var(--line);
}
.lad:nth-child(1) { --k: 0; }
.lad:nth-child(2) { --k: 1; }
.lad:nth-child(3) { --k: 2; }
.lad:nth-child(4) { --k: 3; }
.lad:nth-child(5) { --k: 4; }
.lad:nth-child(6) { --k: 5; }
.lad.top { border-color: var(--accent); }
.lad-cards { display: flex; gap: 4px; justify-content: flex-end; }
.lad b { display: block; color: var(--text); }
.lad small { color: var(--text-2); font-size: 0.86rem; }
.specials { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 640px) {
  .specials { grid-template-columns: 1fr 1fr; }
}
.sp { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); }
.sp > .ic { width: 30px; height: 30px; color: var(--accent-2); }
.sp b { color: var(--text); }
.sp p { margin: 2px 0 0; font-size: 0.88rem; color: var(--text-2); }
.sp .sp-bonus { color: var(--accent-2); }
.points { margin: 0; padding-left: 1.1em; color: var(--text-2); font-size: 0.92rem; }
.points li { margin: 4px 0; }
/* ───────── Pirates IA ───────── */
.tag.ia { background: rgba(111, 214, 214, 0.16); color: var(--info); border-color: var(--info); }
.ia-mark { font: 800 0.6rem var(--f-label); font-style: normal; letter-spacing: 0.08em; color: var(--info); border: 1px solid currentColor; border-radius: 4px; padding: 0 3px; margin-left: 4px; vertical-align: 1px; }
.crew-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.solo-hint { font-family: var(--f-body); font-weight: 400; letter-spacing: 0; opacity: 0.75; }
@media (max-width: 380px) {
  .solo-hint { display: none; }
}
/* ───────── Emplacements fixes du dock : un message qui apparaît ne décale jamais le reste ───────── */
.no-anim { animation: none !important; }
.ci-txt p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ci.has-fc .ci-role, .ci .ci-fc { -webkit-line-clamp: 1 !important; }
/* Alertes (arrivants à quai) : posées sur la table, hors du flux */
.table-alerts { position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%); z-index: 7; pointer-events: none; width: max-content; max-width: 94%; }
.table-alerts > * { pointer-events: auto; }
.table-alerts .quai { background: rgba(15, 18, 24, 0.94); padding: 4px 6px 4px 10px; font-size: 0.85rem; flex-wrap: nowrap; }
.table-alerts .quai .btn { min-height: 34px; }
/* ════════════════════════════════════════════════════════════
   PISTE « ARCADE MOBILE / GESTES »
   Téléphone d'abord : main en éventail, glisser pour jouer, jetons de pari géants,
   annonces plein écran, pastilles de joueurs, barre de progression du pari.
   Les animations qui tournent en continu restent calées sur --ph (horloge commune) : un nouveau rendu ne les relance jamais.
   ════════════════════════════════════════════════════════════ */
/* ───────── Boutons : pastilles épaisses qu'on enfonce ───────── */
.btn { border-width: 2px; border-color: #4a5873; background: #222b3d; box-shadow: 0 4px 0 #05070a; }
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #05070a; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:active { transform: scale(0.97); box-shadow: none; }
.btn-accent, .btn-go {
  background: linear-gradient(180deg, #ffc7a8, var(--accent) 70%); color: #2a1304; border-color: #ffe0cf; text-shadow: none;
  box-shadow: 0 5px 0 #8a3410, 0 12px 22px rgba(0, 0, 0, 0.35);
}
.btn-accent:active, .btn-go:active { transform: translateY(4px); box-shadow: 0 1px 0 #8a3410; }
.btn[disabled], .btn-go[disabled] { opacity: 0.5; box-shadow: 0 4px 0 #05070a; }
.btn-accent[disabled], .btn-go[disabled] { background: #2c3548; color: #98a2b5; border-color: #444e66; opacity: 1; box-shadow: 0 4px 0 #05070a; }
.btn-icon { min-height: 42px; width: 42px; }
.btn-danger { box-shadow: 0 4px 0 #6b1d1d; }
.btn-go { min-height: 54px; min-width: 116px; padding: 0 20px; border-radius: 18px; font-family: var(--f-display); font-weight: var(--fw-display); font-size: 1.75rem; letter-spacing: 0.03em; line-height: 1; white-space: nowrap; }
.touch-only { display: none; }
@media (hover: none) {
  .touch-only { display: inline; }
}
/* ───────── Écran de jeu : haut (barre + équipage) / table / dock / main plein écran ───────── */
.game {
  --hand-h: clamp(150px, 27dvh, 250px);
  height: 100dvh; display: grid; overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  grid-template-areas: 'top' 'rail' 'table' 'dock' 'hand';
}
@media (min-width: 700px) and (min-height: 521px) {
  .game { --hand-h: clamp(190px, 29dvh, 320px); }
}
@media (min-width: 1100px) and (min-height: 521px) {
  .game { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'top top' 'rail side' 'table side' 'dock side' 'hand side'; }
  .dock .card-info { display: none; } /* la fiche de la carte vit dans le panneau latéral */
}
@media (min-width: 1100px) and (min-height: 700px) {
  .game { --hand-h: clamp(250px, 33dvh, 340px); }
}
.topbar {
  grid-area: top; display: flex; align-items: center; gap: 8px; padding: 6px 10px 2px;
  padding-top: max(6px, env(safe-area-inset-top));
}
.topbar .wordmark { font-size: 1.5rem; }
.round-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0; line-height: 1.05; font-family: var(--f-label); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.7rem; color: var(--muted); }
.round-info > span { white-space: nowrap; }
.round-info b { font-family: var(--f-display); font-weight: var(--fw-display); font-size: 1.45rem; letter-spacing: 0; color: var(--accent-2); vertical-align: -2px; }
.round-info .ri-p b { color: var(--text); }
.top-actions { display: flex; gap: 6px; }
.top-actions .btn-icon { border-color: var(--line-2); background: rgba(0, 0, 0, 0.25); }
@media (min-width: 521px) {
  .round-info { flex-direction: row; align-items: center; justify-content: center; gap: 18px; }
}
@media (max-width: 440px) and (orientation: portrait) {
  .top-extra { display: none; }
  .topbar .wordmark { display: none; }
}
@media (max-width: 359px) {
  .top-actions { gap: 4px; }
  .btn-icon { width: 40px; min-height: 40px; }
}
/* Équipage : une rangée de pastilles — avatar, pastille « plis/pari » collée dessus, nom, score */
.rail {
  list-style: none; margin: 0 auto; padding: 4px 8px 6px; grid-area: rail; position: relative; z-index: 4;
  display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 820px;
}
.pl {
  position: relative; container-type: inline-size; min-width: 0; border-radius: 18px; padding: 6px 2px 5px;
  border: 2px solid transparent; background: rgba(13, 28, 34, 0.55);
  transition: background 0.25s, border-color 0.25s;
}
.pl-in { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.pl-av { position: relative; display: block; margin-bottom: 12px; }
.pl-av .avatar { width: clamp(30px, 76cqw, 54px); height: clamp(30px, 76cqw, 54px); border-width: 2.5px; transition: box-shadow 0.25s; }
.pl-bid {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); z-index: 2; min-width: 2.7em; height: 1.55em; padding: 0 0.5em; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; white-space: nowrap; font: 800 clamp(0.66rem, 20cqw, 0.86rem)/1 var(--f-label); letter-spacing: 0.02em;
  background: #0a0d12; border: 2px solid rgba(238, 241, 246, 0.55); color: var(--text);
}
.pl-bid i { font-style: normal; opacity: 0.55; margin: 0 1px; }
.pl-bid.done { border-color: var(--ok); color: var(--ok); }
.pl-bid.over { border-color: var(--bad); color: var(--bad-ink); }
.pl-bid.wait { color: var(--muted); border-style: dashed; }
.pl-bid.adj { color: var(--info); border-color: var(--info); }
.pl-nm { max-width: 100%; margin-top: 3px; font-weight: 800; font-size: clamp(0.62rem, 17cqw, 0.84rem); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-score { font: 800 clamp(0.62rem, 15cqw, 0.78rem)/1.1 var(--f-label); color: var(--accent-2); letter-spacing: 0.03em; }
.pl-score.neg { color: var(--bad-ink); }
.pl .host-mark { position: absolute; top: -5px; left: -5px; width: 18px; height: 18px; z-index: 3; color: var(--accent-2); background: #0a0d12; border-radius: 50%; padding: 2px; }
.pl.me { background: rgba(36, 67, 77, 0.7); }
.pl.me .pl-nm { color: var(--info); }
.pl.turn { background: rgba(255, 162, 118, 0.16); border-color: var(--accent-2); transform: translateY(-1px); }
.pl.turn .pl-nm { color: var(--accent-2); }
.pl.turn .avatar { box-shadow: 0 0 0 3px var(--accent-2), 0 0 16px rgba(255, 162, 118, 0.65); animation: ring 1.2s ease-in-out infinite; animation-delay: var(--ph, 0ms); }
.pl.turn::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 12px; height: 12px; margin-left: -6px; background: var(--accent-2); transform: rotate(45deg); border-radius: 3px; z-index: 1; }
.pl.off { opacity: 0.55; border-style: dashed; border-color: var(--line-2); }
.emote-bubble { z-index: 20; }
@keyframes ring { 50% { box-shadow: 0 0 0 5px rgba(255, 162, 118, 0.55), 0 0 26px rgba(255, 162, 118, 0.8); } }
/* Table : un peu plus vive */
.table-wrap { grid-area: table; position: relative; display: grid; place-items: center; padding: 6px 10px 4px; min-height: 0; min-width: 0; }
.game[data-phase='play'] .table-wrap, .game[data-phase='pause'] .table-wrap { padding-top: 34px; }
.lead-chip { top: 3px; font-size: 0.85rem; padding: 3px 14px 3px 4px; border-width: 2px; }
.lead-chip .dot { width: 24px; height: 24px; }
.lead-chip .dot .ic { width: 16px; height: 16px; }
.result-banner { border: 3px solid var(--paper-ink); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45), var(--shadow); border-radius: 16px; }
.result-banner { padding: 4px 16px 5px; bottom: 5%; }
.result-banner b { font-size: 1.4rem; }
.result-banner small { font-size: 0.8rem; }
.table-msg .big { font-size: clamp(2rem, 9cqw, 3rem); }
.table.bidtable::before { opacity: 0.05; }
.table { transition: box-shadow 0.2s, outline-color 0.2s; outline: 3px dashed transparent; outline-offset: -16px; }
.game.dragging .table { outline-color: rgba(255, 162, 118, 0.55); }
.game.armed .table { outline-color: var(--accent-2); outline-style: solid; box-shadow: inset 0 0 0 6px #14171f, inset 0 0 0 9px var(--accent-2), inset 0 0 70px rgba(255, 162, 118, 0.4), 0 20px 50px rgba(0, 0, 0, 0.5); }
.game.armed.bad .table { outline-color: var(--bad); box-shadow: inset 0 0 0 6px #14171f, inset 0 0 0 9px var(--bad), inset 0 0 70px rgba(240, 84, 84, 0.4), 0 20px 50px rgba(0, 0, 0, 0.5); }
.drop-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 8; pointer-events: none; opacity: 0; white-space: nowrap;
  font-family: var(--f-display); font-size: 1.6rem; line-height: 1; padding: 6px 18px 4px; border-radius: 999px;
  background: #0a0d12; color: var(--accent-2); border: 2.5px solid var(--accent-2); transition: opacity 0.12s;
}
.game.dragging .drop-hint { opacity: 1; }
.drop-hint .dh-near, .drop-hint .dh-bad { display: none; }
.game.armed .drop-hint { background: var(--accent-2); color: #2a1304; }
.game.armed .dh-far { display: none; }
.game.armed .dh-near { display: inline; }
.game.armed.bad .drop-hint { background: var(--bad); color: #fff; border-color: #ffc0c0; }
.game.armed.bad .dh-near { display: none; }
.game.armed.bad .dh-bad { display: inline; }
/* ───────── Pari : jeton géant + jetons de raccourci ───────── */
.bidpad { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; padding: 6px 10px; gap: 2px; position: relative; z-index: 1; min-height: 0; }
.bp-head { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; line-height: 1; text-align: center; }
.bp-head b { font-family: var(--f-display); font-weight: var(--fw-display); font-size: clamp(1.5rem, 8cqh, 2.2rem); color: var(--accent-2); }
.bp-head span { font: 700 0.82rem var(--f-label); letter-spacing: 0.06em; color: var(--text-2); }
.bp-stage { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 5cqw, 26px); touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.bp-stage.grab { cursor: grabbing; }
.bp-step {
  width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; touch-action: manipulation;
  font: var(--fw-display) 2.2rem/1 var(--f-display); color: var(--text); background: #222b3d; border: 2.5px solid #4a5873; box-shadow: 0 4px 0 #05070a; padding: 0 0 4px;
}
.bp-step:active { transform: translateY(3px); box-shadow: 0 1px 0 #05070a; }
.coin {
  --d: clamp(74px, 31cqh, 130px); position: relative; width: var(--d); height: var(--d); border-radius: 50%; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: radial-gradient(circle at 34% 26%, #ffd9c4, #ff7a45 50%, #b5461b 100%); border: 3px solid #ffe0cf;
  box-shadow: 0 7px 0 #7a2f0e, 0 16px 28px rgba(0, 0, 0, 0.5), inset 0 -8px 14px rgba(120, 50, 0, 0.35);
  color: #2a1304; transition: filter 0.2s;
}
.coin::before { content: ''; position: absolute; inset: 6px; border-radius: 50%; border: 5px dashed rgba(122, 47, 14, 0.5); transform: rotate(var(--rot, 0deg)); transition: transform 0.45s var(--ease); }
.coin-n { font-family: var(--f-display); font-size: calc(var(--d) * 0.58); line-height: 0.9; position: relative; }
.coin small { position: relative; font: 800 0.68rem var(--f-label); letter-spacing: 0.14em; text-transform: uppercase; color: #5c2208; margin-top: -1px; }
.coin.empty { filter: saturate(0.35) brightness(0.8); }
.bp-chips { --chip: clamp(38px, min(calc((100cqw - 28px - (var(--cols, 6) - 1) * 8px) / var(--cols, 6)), 15cqh), 58px); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: calc(var(--cols, 6) * (var(--chip) + 8px)); }
.chip-bid {
  position: relative; width: var(--chip); height: var(--chip); border-radius: 50%; display: grid; place-items: center; padding: 0 0 2px; touch-action: manipulation;
  background: radial-gradient(circle at 34% 28%, #4d5f80, #1b2231 70%); border: 3px solid rgba(238, 241, 246, 0.55); box-shadow: 0 4px 0 #05070a; color: var(--text);
  font: var(--fw-display) calc(var(--chip) * 0.5)/1 var(--f-display); transition: transform 0.15s var(--ease), background 0.2s;
}
.chip-bid::before { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px dashed rgba(238, 241, 246, 0.35); }
.chip-bid:active { transform: translateY(3px); box-shadow: 0 1px 0 #05070a; }
.chip-bid[aria-pressed='true'] { background: radial-gradient(circle at 34% 28%, #ffd9c4, #ff7a45 60%, #b5461b); color: #2a1304; border-color: #ffe0cf; transform: translateY(-3px) scale(1.12); box-shadow: 0 7px 0 #7a2f0e, 0 10px 18px rgba(0, 0, 0, 0.4); z-index: 1; }
.chip-bid[aria-pressed='true']::before { border-color: rgba(122, 47, 14, 0.5); }
@container (max-height: 330px) {
  .bp-head span { display: none; }
}
@container (max-height: 250px) {
  .bp-head { display: none; }
  .bp-step { width: 44px; height: 44px; font-size: 1.9rem; }
}
/* ───────── Dock : consigne + action, barre de pari, fiche de carte — trois emplacements de hauteur fixe ───────── */
.dock { grid-area: dock; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 10px 2px; min-width: 0; }
.dk-main { height: 56px; flex: none; width: 100%; max-width: 640px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.dk-main .status { flex: 1; min-width: 0; min-height: 0; text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 2px; line-height: 1; font-size: 0.95rem; color: var(--text-2); }
.status strong { font-family: var(--f-display); font-weight: var(--fw-display); font-size: 1.85rem; letter-spacing: 0.01em; color: var(--accent-2); line-height: 0.95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status strong.calm { font-size: 1.4rem; color: var(--text); }
.status strong.inl { font-size: 1.3rem; vertical-align: -1px; }
.status .hint { display: block; font: 600 0.78rem/1.15 var(--f-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status .hint-bad { color: #ff9a9a; font-weight: 800; }
.status .dots i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin-left: 3px; animation: blink 1.2s infinite both; animation-delay: var(--ph, 0ms); }
.status .dots i:nth-child(2) { animation-delay: calc(var(--ph, 0ms) + 0.2s); }
.status .dots i:nth-child(3) { animation-delay: calc(var(--ph, 0ms) + 0.4s); }
.dk-main .dock-actions { flex: none; display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.dk-main.mine .btn-go:not([disabled]) { animation: go 1.2s ease-in-out infinite; animation-delay: var(--ph, 0ms); }
@keyframes go { 50% { box-shadow: 0 5px 0 #8a3410, 0 0 0 6px rgba(255, 162, 118, 0.35), 0 12px 26px rgba(255, 162, 118, 0.4); } }
/* Barre de progression du pari */
.meter { height: 34px; flex: none; width: 100%; max-width: 640px; display: flex; align-items: center; gap: 10px; }
.meter.ghost { visibility: hidden; }
.mt-bid {
  width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; padding-bottom: 2px;
  font: var(--fw-display) 1.35rem/1 var(--f-display); color: #2a1304; background: radial-gradient(circle at 34% 26%, #ffd9c4, #ff7a45 60%, #b5461b); border: 2.5px solid #ffe0cf; box-shadow: 0 3px 0 #7a2f0e;
}
.mt-bar { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: 4px; height: 20px; }
.mt-bar .seg { display: block; border-radius: 7px; background: rgba(0, 0, 0, 0.4); border: 2px solid rgba(238, 241, 246, 0.3); transition: background 0.3s, box-shadow 0.3s; }
.mt-bar .seg.on, .mt-bar .seg.draft { background: linear-gradient(180deg, #ffb591, var(--accent)); border-color: #ffe0cf; box-shadow: 0 0 10px rgba(255, 162, 118, 0.5); }
.mt-bar .seg.draft { opacity: 0.75; box-shadow: none; }
.mt-bar .seg.over { background: var(--bad); border-color: #ffc0c0; box-shadow: 0 0 10px rgba(240, 84, 84, 0.55); }
.mt-bar .seg.zero { grid-column: 1 / -1; }
.mt-bar .seg.zero.on { background: rgba(98, 210, 142, 0.35); border-color: var(--ok); box-shadow: none; }
.mt-bar .seg.pop { animation: segpop 0.55s var(--ease) both; }
.mt-num { flex: none; min-width: 3.4rem; text-align: right; font-family: var(--f-display); line-height: 1; white-space: nowrap; }
.mt-num b { font-weight: 400; font-size: 1.7rem; color: var(--text); }
.mt-num small { font: 400 1.2rem var(--f-label); color: var(--muted); margin-left: 2px; }
.meter.ok .mt-num b { color: var(--ok); }
.meter.ok .mt-bar .seg.on { border-color: #d6ffe4; box-shadow: 0 0 12px rgba(98, 210, 142, 0.65); }
.meter.over .mt-num b { color: var(--bad-ink); }
@keyframes segpop { 0% { transform: scale(0.4, 1.8); } 55% { transform: scale(1.25, 0.8); } 100% { transform: none; } }
/* Fiche de carte : emplacement fixe */
.dock .card-info { width: 100%; max-width: 640px; height: 48px; flex: none; overflow: hidden; display: flex; align-items: stretch; }
.dock .card-info:empty { display: flex; }
.dock .card-info > * { width: 100%; }
.dock .card-info .ci-hint { height: 100%; }
.ci { border-radius: 14px; border-width: 1.5px; }
.ci .card.mini { --cw: 30px; }
@media (max-height: 760px) and (orientation: portrait) {
  .dock .card-info { height: 44px; }
  .dk-main { height: 50px; }
  .btn-go { min-height: 48px; }
}
@media (max-height: 700px) and (orientation: portrait) {
  .meter { height: 30px; }
  .mt-bid { width: 30px; height: 30px; font-size: 1.2rem; }
  .mt-bar { height: 16px; }
}
@media (hover: none) {
  .card-info .ci-hint { display: flex; }
}
/* ───────── Main en éventail : toute la largeur, cartes grandes ───────── */
.hand-wrap {
  grid-area: hand; position: relative; z-index: 10; height: calc(var(--hand-h) + var(--safe-b)); padding: 0 0 var(--safe-b); min-width: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.4)); touch-action: none;
}
.hand-wrap.myturn { background: radial-gradient(70% 100% at 50% 0%, rgba(255, 162, 118, 0.2), transparent 75%), linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.4)); }
.hand-wrap.myturn::before { content: ''; position: absolute; left: 8%; right: 8%; top: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--accent-2), transparent); }
.hand { --hcw: 84px; position: absolute; inset: 0 0 var(--safe-b) 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.hand .card {
  --cw: var(--hcw); position: absolute; left: 50%; bottom: calc(var(--drop, 12px) + 4px); margin-left: calc(var(--cw) / -2);
  transform-origin: 50% 100%; touch-action: none; -webkit-touch-callout: none;
  transform: translate(var(--x, 0px), calc(var(--y, 0px) - var(--lift, 0px))) rotate(var(--r, 0deg)) scale(var(--s, 1));
  transition: transform 0.2s var(--ease), filter 0.2s, box-shadow 0.2s;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
/* Index « à index » dans la bande visible : gros chiffre au-dessus du pictogramme de couleur, centré dans le pas de l'éventail */
.hand .card .c-corner { top: 3.5%; left: 0; width: var(--stp, 40px); align-items: center; gap: calc(var(--vs, 22px) * 0.1); }
.hand .card .c-corner .c-v { font-size: var(--vs, 22px); letter-spacing: -0.03em; }
.hand .card .c-corner .c-s { width: calc(var(--vs, 22px) * 0.62); height: calc(var(--vs, 22px) * 0.62); }
.hand .card:not(.k-num) .c-corner .c-v { width: var(--vs, 22px); height: var(--vs, 22px); }
.hand .card .c-key { top: auto; bottom: 5px; right: auto; left: 5px; }
.hand .card.sel { --lift: calc(var(--cw) * var(--liftk, 0.26)); --s: var(--sels, 1.07); z-index: 20; box-shadow: 0 0 0 4px var(--accent-2), 0 18px 30px rgba(0, 0, 0, 0.6); }
@media (hover: hover) {
  .hand.myturn .card.legal:not(.sel):hover { --lift: calc(var(--cw) * 0.16); z-index: 15; }
}
.hand .card.illegal { filter: grayscale(0.6) brightness(0.66); }
.hand .card.legal:not(.sel) { box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(255, 162, 118, 0.45); }
.hand .card.lifting {
  transition: none; z-index: 40; --s: 1.1; pointer-events: none;
  transform: translate(calc(var(--x, 0px) + var(--dx, 0px)), calc(var(--y, 0px) - var(--lift, 0px) + var(--dy, 0px))) rotate(0deg) scale(var(--s));
  box-shadow: 0 0 0 4px var(--accent-2), 0 26px 40px rgba(0, 0, 0, 0.6);
}
.game.armed .hand .card.lifting { box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--accent-2), 0 0 44px rgba(255, 162, 118, 0.8), 0 26px 40px rgba(0, 0, 0, 0.6); filter: brightness(1.08); }
.game.armed.bad .hand .card.lifting { box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--bad), 0 26px 40px rgba(0, 0, 0, 0.6); filter: grayscale(0.4); }
.hand .card.launch { opacity: 0; transition: opacity 0.1s; }
.hand.deal .card { animation: deal 0.5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.hand-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-style: italic; }
@keyframes deal { from { opacity: 0; transform: translate(0, -260px) rotate(-14deg) scale(0.6); } }
/* ───────── Paysage téléphone (≈ 844×390) — disposition « Grand format » :
   à gauche manche + équipage (et la fiche de carte dessous), à droite table, dock (action + barre du pari) et main ───────── */
@media (max-height: 520px) and (orientation: landscape) {
  .game {
      --hand-h: clamp(116px, 35dvh, 150px); position: relative;
      grid-template-columns: 212px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
      grid-template-areas: 'top table' 'rail table' 'rail dock' 'rail hand';
    }
  .side, .top-extra, .top-emote, .topbar .wordmark { display: none !important; }
  .menu-emote { display: flex; }
  .topbar { padding: 3px 4px 1px max(8px, env(safe-area-inset-left)); gap: 6px; }
  .round-info { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; font-size: 0.66rem; line-height: 1.05; }
  .round-info b { font-size: 1.3rem; }
  .top-actions { gap: 5px; }
  .btn-icon { min-height: 38px; width: 38px; }
    /* équipage : une ligne par pirate — emblème, nom, plis/pari, score */.rail { display: flex; flex-direction: column; justify-content: flex-start; gap: 3px; padding: 2px 4px 4px max(8px, env(safe-area-inset-left)); max-width: none; margin: 0; width: auto; }
  .pl { flex: none; padding: 3px 7px 3px 4px; border-radius: 14px; }
  .pl-in { flex-direction: row; align-items: center; justify-content: flex-start; gap: 6px; }
  .pl-av { display: contents; }
  .pl-av .avatar { width: 28px; height: 28px; border-width: 2px; }
  .pl-nm { order: 1; flex: 1; min-width: 0; font-size: 0.84rem; margin: 0; text-align: left; }
  .pl-bid { order: 2; position: static; transform: none; flex: none; min-width: 2.5em; height: 1.55em; font-size: 0.78rem; }
  .pl-score { order: 3; flex: none; min-width: 2.3em; text-align: right; font-size: 0.8rem; }
  .pl.turn::after { display: none; }
  .pl .host-mark { width: 14px; height: 14px; top: -4px; left: -4px; }
  .game[data-n='7'] .rail, .game[data-n='8'] .rail { gap: 2px; padding-top: 1px; }
  .game[data-n='7'] .pl, .game[data-n='8'] .pl { padding-top: 2px; padding-bottom: 2px; }
  .game[data-n='7'] .pl-av .avatar, .game[data-n='8'] .pl-av .avatar { width: 25px; height: 25px; }
  .table-wrap { padding: 4px 8px 2px; }
  .game[data-phase='play'] .table-wrap, .game[data-phase='pause'] .table-wrap { padding-top: 26px; }
  .lead-chip { font-size: 0.74rem; padding: 2px 10px 2px 3px; top: 0; }
  .lead-chip .dot { width: 18px; height: 18px; }
  .lead-chip .dot .ic { width: 12px; height: 12px; }
  .table { max-height: none; border-radius: 24px; }
  .table::before { width: 34%; }
    /* pas de place pour réserver le bandeau du pli : le gagnant s'annonce en grand (PLI GAGNÉ) et dans le statut */.game[data-phase='play'] .trick, .game[data-phase='pause'] .trick { --bud: calc(100cqh - 34px); margin-bottom: 0; }
  .trick .slot .who .wn { display: block; }
  .trick .slot .who .wa { display: none; }
  .trick .slot .who i { display: block; }
  .table-msg { padding: 0 8%; font-size: 0.92rem; line-height: 1.25; }
  .table-msg .big { font-size: 1.6rem; }
  .dock { flex-direction: row; align-items: center; gap: 10px; padding: 0 8px 0 4px; min-width: 0; }
  .dk-main { height: 46px; width: auto; flex: 1 1 52%; max-width: none; }
  .meter { flex: 1 1 48%; width: auto; max-width: none; height: 30px; }
  .status strong { font-size: 1.5rem; }
  .status strong.calm { font-size: 1.15rem; }
  .status .st-line { font-size: 0.9rem; }
  .btn-go { min-height: 42px; min-width: 92px; padding: 0 14px; font-size: 1.45rem; border-radius: 14px; }
  .mt-bid { width: 28px; height: 28px; font-size: 1.1rem; }
  .mt-bar { height: 15px; }
  .mt-num b { font-size: 1.4rem; }
    /* fiche de carte : sous l'équipage (colonne de gauche) tant qu'il reste de la place, sinon posée au bas de la table (6 à 8 pirates) */.dock .card-info { position: absolute; left: max(8px, env(safe-area-inset-left)); bottom: 6px; width: 196px; height: auto; max-height: 148px; z-index: 9; max-width: none; overflow: visible; }
  .dock .card-info:has(.ci-hint) { display: none; }
  .dock .card-info .ci { grid-template-columns: auto 1fr; grid-template-areas: 'm t' 'x x'; align-items: start; background: rgba(15, 18, 24, 0.97); padding: 6px; }
  .dock .card-info .ci .card.mini { --cw: 30px; grid-area: m; }
  .dock .card-info .ci-txt { grid-area: t; }
  .dock .card-info .ci-more { display: none; }
  .ci-txt p { -webkit-line-clamp: 3; font-size: 0.86rem; line-height: 1.22; }
  .ci.has-fc .ci-role, .ci .ci-fc { -webkit-line-clamp: 3 !important; }
  .game[data-n='6'] .dock, .game[data-n='7'] .dock, .game[data-n='8'] .dock { position: relative; }
  .game[data-n='6'] .dock .card-info, .game[data-n='7'] .dock .card-info, .game[data-n='8'] .dock .card-info { left: 50%; transform: translateX(-50%); bottom: calc(100% + 4px); width: min(580px, 96%); height: 42px; max-height: none; overflow: hidden; }
  .game[data-n='6'] .dock .card-info .ci, .game[data-n='7'] .dock .card-info .ci, .game[data-n='8'] .dock .card-info .ci { grid-template-columns: auto 1fr auto; grid-template-areas: none; align-items: center; padding: 2px 8px 2px 4px; }
  .game[data-n='6'] .dock .card-info .ci .card.mini, .game[data-n='7'] .dock .card-info .ci .card.mini, .game[data-n='8'] .dock .card-info .ci .card.mini { --cw: 24px; grid-area: auto; }
  .game[data-n='6'] .dock .card-info .ci-txt, .game[data-n='7'] .dock .card-info .ci-txt, .game[data-n='8'] .dock .card-info .ci-txt { grid-area: auto; }
  .game[data-n='6'] .dock .card-info .ci-more, .game[data-n='7'] .dock .card-info .ci-more, .game[data-n='8'] .dock .card-info .ci-more { display: grid; place-items: center; }
  .game[data-n='6'] .ci-txt p, .game[data-n='7'] .ci-txt p, .game[data-n='8'] .ci-txt p { -webkit-line-clamp: 1; font-size: 0.78rem; line-height: 1.2; }
  .game[data-n='6'] .ci.has-fc .ci-role, .game[data-n='7'] .ci.has-fc .ci-role, .game[data-n='8'] .ci.has-fc .ci-role, .game[data-n='6'] .ci .ci-fc, .game[data-n='7'] .ci .ci-fc, .game[data-n='8'] .ci .ci-fc { -webkit-line-clamp: 1 !important; }
  .kbd-only { display: none !important; }
  .drop-hint { bottom: 8px; font-size: 1.2rem; padding: 4px 14px 2px; }
    /* pari : jeton à gauche, jetons de raccourci à droite */.bidpad { flex-direction: row; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 22px; padding: 4px 12px; }
  .bp-head { display: none; }
  .bp-stage { flex: none; }
  .coin { --d: clamp(62px, 40cqh, 84px); }
  .bp-step { width: 42px; height: 42px; font-size: 1.8rem; }
  .bp-stage { gap: 12px; }
  .bidpad { gap: 4px 16px; }
  .bp-chips { --chip: clamp(32px, min(calc((100cqw - 250px - (var(--cols, 6) - 1) * 6px) / var(--cols, 6)), 21cqh), 44px); flex: 0 1 auto; gap: 6px; max-width: calc(var(--cols, 6) * (var(--chip) + 6px)); }
  .bang-t { font-size: clamp(2.8rem, 16vh, 5rem) !important; -webkit-text-stroke-width: 7px; }
  .bang-badge { font-size: 2rem; margin-top: 2px; }
  .bang-s { margin-top: 6px; }
  .hand-wrap { grid-area: hand; }
}
@container (max-height: 175px) {
  .table-msg { font-size: 0.8rem; line-height: 1.2; padding: 0 12%; }
  .table-msg .big { font-size: 1.3rem; }
}
@container (max-height: 120px) {
  .table-msg > :not(.big) { display: none; }
  .table-msg .big { margin: 0; }
}
@container (max-height: 235px) {
  .result-banner { display: none; }
}
/* ───────── Annonces plein écran (À TOI !, PLI GAGNÉ +1, MANCHE 3…) ───────── */
.bang { position: fixed; inset: 0; z-index: 70; pointer-events: none; display: grid; place-items: center; overflow: hidden; animation: bang-bg var(--ms, 1200ms) linear both; --bc: var(--accent-2); }
.bang::before { content: ''; position: absolute; inset: -30%; opacity: 0.5; background: repeating-conic-gradient(from 0deg, color-mix(in oklab, var(--bc) 30%, transparent) 0 7deg, transparent 7deg 20deg); -webkit-mask: radial-gradient(circle, #000 0, transparent 62%); mask: radial-gradient(circle, #000 0, transparent 62%); animation: spin 14s linear infinite; }
.bang-in { position: relative; text-align: center; padding: 0 12px; max-width: 100%; animation: bang-pop var(--ms, 1200ms) cubic-bezier(0.2, 1.3, 0.3, 1) both; }
.bang-t {
  display: block; font-family: var(--f-display); font-weight: var(--fw-display); font-size: clamp(3.4rem, 21vw, 7.5rem); line-height: 0.88; letter-spacing: 0.01em; color: var(--bc);
  -webkit-text-stroke: 9px #0a0c10; paint-order: stroke fill; text-shadow: 0 8px 0 #0a0c10, 0 0 50px color-mix(in oklab, var(--bc) 60%, transparent); transform: rotate(-3deg); text-wrap: balance;
}
.bang-badge { display: inline-block; margin-top: 8px; padding: 2px 22px 0; border-radius: 999px; font: var(--fw-display) clamp(2.2rem, 12vw, 4rem)/1.1 var(--f-display); color: #0e2a18; background: var(--ok); border: 4px solid #d6ffe4; box-shadow: 0 6px 0 #1b6a3a; transform: rotate(2deg); }
.bang-s { display: block; margin: 12px auto 0; max-width: 20em; font: 800 1rem/1.25 var(--f-label); letter-spacing: 0.06em; text-transform: uppercase; color: #fff8f0; text-shadow: 0 2px 0 #0a0c10, 0 0 12px #000; text-wrap: balance; }
.bang.k-win { --bc: #ffe0cf; }
.bang.k-round { --bc: var(--text); }
.bang.k-turn .bang-t { font-size: clamp(4rem, 26vw, 9rem); }
@keyframes bang-bg { 0% { background: rgba(8, 10, 14, 0); } 12% { background: rgba(8, 10, 14, 0.55); } 75% { background: rgba(8, 10, 14, 0.5); } 100% { background: rgba(8, 10, 14, 0); } }
@keyframes bang-pop { 0% { transform: scale(0.3) rotate(-10deg); opacity: 0; } 14% { transform: scale(1.16) rotate(2deg); opacity: 1; } 24% { transform: scale(0.97); } 32%, 78% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }
/* Révélation des paris : plus gros */
.reveal h2 { font-size: clamp(3.4rem, 18vw, 6.5rem); -webkit-text-stroke: 8px #0a0c10; paint-order: stroke fill; text-shadow: 0 7px 0 #0a0c10; transform: rotate(-3deg); }
.reveal .bids-reveal div { width: 78px; padding: 6px 0 4px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 2px solid var(--line-2); }
.reveal .bids-reveal b { color: var(--accent-2); font-size: 3rem; }
/* ───────── Fiches (feuilles) : plus franches ───────── */
.sheet { border-radius: 28px 28px 0 0; border-width: 2px; }
@media (min-width: 700px) {
  .sheet { border-radius: 28px; }
}
.sheet-head h2 { font-size: 2.3rem; }
.sheet .btn-icon { border-color: var(--line-2); }
.hero { text-align: center; margin: 0 0 12px; padding: 12px 10px 10px; border-radius: 20px; border: 3px solid var(--line-2); background: rgba(0, 0, 0, 0.25); animation: slam 0.55s var(--ease) both; display: grid; justify-items: center; gap: 0; }
.hero-t { font: var(--fw-display) clamp(2.4rem, 11vw, 3.6rem)/0.95 var(--f-display); letter-spacing: 0.02em; }
.hero-d { font: var(--fw-display) clamp(3rem, 15vw, 5rem)/0.95 var(--f-display); }
.hero small { font: 800 0.82rem var(--f-label); letter-spacing: 0.08em; color: var(--text-2); text-transform: uppercase; margin-top: 4px; }
.hero.made { border-color: var(--ok); background: rgba(98, 210, 142, 0.12); }
.hero.made .hero-t, .hero.made .hero-d { color: var(--ok); }
.hero.miss { border-color: var(--bad); background: rgba(240, 84, 84, 0.12); }
.hero.miss .hero-t, .hero.miss .hero-d { color: var(--bad-ink); }
.hero.half { border-color: var(--accent-2); background: rgba(255, 162, 118, 0.1); }
.hero.half .hero-t, .hero.half .hero-d { color: var(--accent-2); }
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding: 4px 8px; margin-bottom: 6px; grid-template-columns: auto auto; gap: 0 14px; justify-content: center; align-items: center; }
  .hero small { grid-column: 1 / -1; margin: 0; }
  .hero-t { font-size: 1.8rem; }
  .hero-d { font-size: 2.4rem; }
}
.choice button { border-width: 2.5px; border-radius: 20px; box-shadow: 0 5px 0 #05070a; min-height: 160px; }
.choice button:active { transform: translateY(3px); box-shadow: 0 1px 0 #05070a; }
.choice button b { font-size: 1.9rem; }
.choice.c3 button b { font-size: 3.2rem; }
.menu-item { box-shadow: 0 3px 0 #05070a; }
.menu-item.btn-accent { box-shadow: 0 4px 0 #8a3410; }
/* ───────── Accueil & salon : même franchise ───────── */
.brand h1 { filter: drop-shadow(0 5px 0 #4a1c05); }
.panel { border-radius: 24px; border: 2px solid var(--line-2); }
.panel h2 { font-size: 1rem; }
.input { border-width: 2px; border-radius: 14px; min-height: 54px; }
.emblem-opt { border-width: 2px; border-radius: 16px; min-height: 54px; aspect-ratio: 1; box-shadow: 0 3px 0 #05070a; }
.emblem-opt[aria-checked='true'] { border-color: var(--accent-2); background: rgba(255, 162, 118, 0.18); transform: translateY(-2px); box-shadow: 0 5px 0 #8a3410; }
.home .btn-accent, .home .btn { min-height: 56px; font-size: 1.1rem; }
.home .btn-accent { font-family: var(--f-display); font-size: 1.7rem; font-weight: var(--fw-display); letter-spacing: 0.03em; border-radius: 18px; }
.ticket { border-radius: 20px; border: 3px solid var(--paper-ink); box-shadow: 0 6px 0 rgba(0, 0, 0, 0.4), var(--shadow); }
.crew li { border-radius: 16px; border-width: 2px; min-height: 60px; }
.crew .avatar { width: 46px; height: 46px; }
.crew .nm { font-size: 1.15rem; }
.seg button, .toggle { border-width: 2px; border-radius: 16px; box-shadow: 0 3px 0 #05070a; min-height: 58px; }
.seg button[aria-pressed='true'], .toggle[aria-pressed='true'] { box-shadow: 0 3px 0 #8a3410; }
.start-bar .btn-accent { min-height: 62px; white-space: nowrap; font-family: var(--f-display); font-size: 1.7rem; font-weight: var(--fw-display); border-radius: 20px; }
@media (prefers-reduced-motion: reduce) {
  .bang, .bang-in, .bang::before { animation: none !important; }
  .hand .card { transition-duration: 0.01ms; }
}
@media (orientation: portrait) {
  @container (max-height: 235px) {
    .game[data-phase='play'] .trick, .game[data-phase='pause'] .trick { --bud: calc(100cqh - 34px); margin-bottom: 0; }
  }
}
/* Étiquette sous chaque carte du pli : nom (≤ 5 joueurs) ou emblème coloré (6 à 8) ; places à venir en pointillé */
.trick .slot .who .wa { display: block; }
.trick .slot .who .wa .avatar { width: 22px; height: 22px; border-width: 2px; margin: 0 auto; }
.trick .slot .who .wn, .trick .slot .who i { display: none; }
.trick.names .slot .who .wn { display: block; }
.trick.names .slot .who i { display: block; }
.trick.names .slot .who .wa { display: none; }
.trick .slot .who { font-size: 0.74rem; }
.trick .slot.ghost { z-index: 0; }
.trick .slot .who { width: 100%; }
.trick .slot .gh { display: grid; place-items: center; width: var(--tcw); height: calc(var(--tcw) * 1.48); border-radius: calc(var(--tcw) * 0.1); border: 2.5px dashed rgba(238, 241, 246, 0.28); background: rgba(0, 0, 0, 0.12); }
.trick .slot .gh .avatar { width: 38%; height: auto; aspect-ratio: 1; opacity: 0.55; }
.trick .slot.ghost .who { opacity: 0.6; }
.trick .slot.ghost.next .gh { border-color: var(--accent-2); background: rgba(255, 162, 118, 0.12); }
.trick .slot.ghost.next .gh .avatar { opacity: 1; animation: ring 1.2s ease-in-out infinite; animation-delay: var(--ph, 0ms); }
.trick .slot.ghost.next .who { opacity: 1; color: var(--accent-2); }
.trick .slot.win .card { transform: translateY(-8px) scale(1.06); }
.trick .slot.win { z-index: 30; }
.status .st-line { font: 800 1.05rem/1 var(--f-label); letter-spacing: 0.04em; color: var(--text); text-transform: uppercase; }
.status .st-line strong { font-size: 1.5rem; margin: 0 2px; }
.ci-hint { flex-wrap: nowrap !important; gap: 10px !important; justify-content: center; padding: 0 4px; }
.ci-hint > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-hint .ci-more { flex: none; white-space: nowrap; }
/* Accueil : tout l'essentiel dès le premier écran du téléphone */
@media (max-width: 520px) and (orientation: portrait) {
  .home { padding-top: 16px; align-items: start; }
  .brand { margin-bottom: 12px; }svg.brand-crest { width: 62px; height: 62px; margin-bottom: 0; }
  .brand h1 { font-size: 3.4rem; }
  .brand .sub { margin-top: 4px; }
  .home .panel { padding: 16px; }
  .home .panel h2 { margin-bottom: 8px; }
  .home .field { margin-bottom: 10px; }
  .home .emblems { gap: 6px; }
  .home .emblem-opt { min-height: 0; aspect-ratio: 1.35; }
  .home .or { margin: 10px 0; }
  .solo-hint { display: none; }
}
/* Pieds de feuille : l'action principale en grand, le reste en rangée */
.sheet-foot .ready-row { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
.sheet-foot .btn-ghost { font-size: 0.88rem; padding-left: 0.6em; padding-right: 0.6em; text-align: center; line-height: 1.1; }
.sheet-foot .ready-row > .btn-accent { min-height: 58px; font-family: var(--f-display); font-size: 1.6rem; font-weight: var(--fw-display); border-radius: 18px; }
/* ───────── Fin de partie et classements : podium, noms et scores agrandis (« Grand format ») ───────── */
.sheet.end { font-size: 1.1rem; }
.champ-name { font-size: clamp(2.6rem, 11vw, 3.6rem); }
.champ-line { font-size: 1.2rem; }
.champion .avatar { width: 92px; height: 92px; }
.podium .step .avatar { width: 52px; height: 52px; }
.podium .nm { font-size: 1.1rem; }
.podium .pts { font-size: 1.1rem; }
.podium .block { font-size: 2.4rem; }
.podium .p1 .block { height: 108px; }
.podium .p2 .block { height: 80px; }
.podium .p3 .block { height: 58px; }
.rest li { font-size: 1.15rem; padding: 8px 12px; }
.rest b { font-size: 1.7rem; }
.rest .rank { font-size: 1.5rem; }
.rest .avatar { width: 36px; height: 36px; }
table.scores { font-size: 1.1rem; }
table.scores th, table.scores td { padding: 8px 6px; min-width: 70px; }
table.scores .hn { font-size: 0.95rem; max-width: 84px; }
table.scores td .d { font-size: 0.95rem; }
table.scores .total th, table.scores .total td { font-size: 1.7rem; }
table.scores tbody th, table.scores thead td:first-child, table.scores .total th { min-width: 58px; padding-left: 8px; padding-right: 6px; }
table.scores .total th { font-size: 0.85rem; letter-spacing: 0.04em; }
.sheet.end .sheet-foot .btn-ghost { font-size: 1.05rem; min-height: 54px; }
@media (max-height: 520px) and (orientation: landscape) {
  .sheet.end { font-size: 1rem; }
  .champ-name { font-size: 2rem; }
  .champ-line { font-size: 1rem; }
  .champion .avatar { width: 56px; height: 56px; }
  .podium .step .avatar { width: 40px; height: 40px; }
  .podium .p1 .block { height: 56px; }
  .podium .p2 .block { height: 42px; }
  .podium .p3 .block { height: 32px; }
  .podium .block { font-size: 1.6rem; }
  .podium .nm, .podium .pts { font-size: 0.95rem; }
  .rest li { font-size: 1rem; padding: 4px 10px; }
  .rest b { font-size: 1.3rem; }
}
/* ───────── Ordinateur (≥ 1100 px) : équipage en lignes, grandes cartes, fiche dans le panneau latéral ───────── */
@media (min-width: 1100px) and (min-height: 521px) {
  .game .dock .card-info { display: none; }
  .rail { max-width: 1040px; gap: 8px; padding: 8px 12px 6px; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl { padding: 6px 12px 6px 8px; border-radius: 18px; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'av nm bid' 'av sc bid'; align-items: center; column-gap: 10px; row-gap: 0; justify-items: start; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl-av { display: contents; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl-av .avatar { grid-area: av; width: 46px; height: 46px; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl-nm { grid-area: nm; max-width: 100%; margin: 0; font-size: 1.05rem; text-align: left; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl-bid { grid-area: bid; position: static; transform: none; font-size: 0.95rem; justify-self: end; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl-score { grid-area: sc; font-size: 1rem; }
  .game:is([data-n='2'], [data-n='3'], [data-n='4']) .pl.turn::after { display: none; }
  .game:is([data-n='5'], [data-n='6'], [data-n='7'], [data-n='8']) .pl { padding: 6px 4px 5px; border-radius: 18px; }
  .lead-chip { font-size: 1rem; }
  .status strong { font-size: 2.2rem; }
  .status strong.calm { font-size: 1.7rem; }
  .status .hint { font-size: 0.95rem; }
  .dk-main, .meter { max-width: 760px; }
  .dk-main { height: 62px; }
  .btn-go { min-height: 58px; font-size: 2rem; }
}
/* Petit portrait à 7-8 joueurs : la main cède de la place à la table (le pli passe en priorité) */
@media (max-height: 780px) and (max-width: 699px) and (orientation: portrait) {
  .game[data-n='7'], .game[data-n='8'] { --hand-h: clamp(128px, 23.5dvh, 200px); }
}
.result-banner small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.result-banner { bottom: 4%; max-width: 94%; }
.podium { margin-top: 30px; }
.sheet.end .sheet-foot .btn-ghost { font-size: 0.98rem; }
.result-banner { bottom: 2.5%; padding: 3px 14px 4px; }
.result-banner b { font-size: 1.3rem; }
.result-banner small { font-size: 0.74rem; line-height: 1.15; }
@media (max-height: 520px) and (orientation: landscape) {
  .sheet.end .sheet-body { display: grid; grid-auto-rows: max-content; align-content: start; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 14px; align-items: center; }
  .sheet.end .champion { grid-column: 1; }
  .sheet.end .podium { grid-column: 2; margin-top: 22px; }
  .sheet.end .sheet-body > :not(.champion):not(.podium):not(.confetti-box) { grid-column: 1 / -1; }
}
/* ───────── Petit portrait à 7-8 joueurs (« Grand format ») : l'équipage passe sur deux rangées de quatre — le nom en entier, puis emblème + « plis/pari » en gros ───────── */
@media (max-width: 699px) and (orientation: portrait) {
  .game[data-n='7'] .rail, .game[data-n='8'] .rail { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 2px 8px 4px; }
  .game[data-n='6'] .rail { gap: 3px; }
}
@media (max-width: 699px) and (orientation: portrait), (max-width: 359px) and (orientation: portrait) {
  .game[data-n='7'] .pl, .game[data-n='8'] .pl { padding: 4px 4px 4px; border-radius: 14px; }
  .game[data-n='7'] .pl-in, .game[data-n='8'] .pl-in { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'nm nm' 'av bid'; column-gap: 4px; row-gap: 3px; align-items: center; justify-items: stretch; }
  .game[data-n='7'] .pl-av, .game[data-n='8'] .pl-av { display: contents; }
  .game[data-n='7'] .pl-av .avatar, .game[data-n='8'] .pl-av .avatar { grid-area: av; width: 23px; height: 23px; border-width: 2px; }
  .game[data-n='7'] .pl-nm, .game[data-n='8'] .pl-nm { grid-area: nm; margin: 0; font-size: 0.78rem; text-align: center; }
  .game[data-n='7'] .pl-bid, .game[data-n='8'] .pl-bid { grid-area: bid; position: static; transform: none; width: 100%; min-width: 0; height: 24px; padding: 0 0.15em; font-size: 0.98rem; }
  .game[data-n='7'] .pl-score, .game[data-n='8'] .pl-score { display: none; }
  .game[data-n='7'] .pl.turn::after, .game[data-n='8'] .pl.turn::after { display: none; }
  .game[data-n='7'] .pl .host-mark, .game[data-n='8'] .pl .host-mark { width: 13px; height: 13px; top: -4px; left: -4px; }
}
@media (max-width: 359px) and (orientation: portrait) {
  .game[data-n='6'] .rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game[data-n='6'] .pl { padding: 4px 4px 4px; border-radius: 14px; }
  .game[data-n='6'] .pl-in { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'nm nm' 'av bid'; column-gap: 4px; row-gap: 3px; align-items: center; justify-items: stretch; }
  .game[data-n='6'] .pl-av { display: contents; }
  .game[data-n='6'] .pl-av .avatar { grid-area: av; width: 23px; height: 23px; border-width: 2px; }
  .game[data-n='6'] .pl-nm { grid-area: nm; margin: 0; font-size: 0.78rem; text-align: center; }
  .game[data-n='6'] .pl-bid { grid-area: bid; position: static; transform: none; width: 100%; min-width: 0; height: 24px; padding: 0 0.15em; font-size: 0.98rem; }
  .game[data-n='6'] .pl-score { display: none; }
  .game[data-n='6'] .pl.turn::after { display: none; }
}
/* Pas de transition sur une main fraîchement redessinée ; la distribution reprend où elle en était (voir dealHand) */
.hand.settling .card { transition: none !important; }
.hand.deal .card { animation-delay: calc(var(--i) * 60ms - var(--el, 0ms)); }

/* ════════════════════════════════════════════════════════════
   Spécifique au gabarit (après la base ci-dessus)
   ════════════════════════════════════════════════════════════ */
/* Bandeau des pastilles de table (atout, couleur demandée…) : emplacement RÉSERVÉ dans toutes les phases de jeu, vide ou non */
.game[data-phase='bid'] .table-wrap, .game[data-phase='play'] .table-wrap, .game[data-phase='pause'] .table-wrap { padding-top: 34px; }
.chips { position: absolute; top: 3px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; gap: 6px; white-space: nowrap; max-width: 98%; pointer-events: none; }
.chips .lead-chip { position: static; transform: none; }
.lead-chip, .trump-chip { font-family: var(--f-label); letter-spacing: 0.06em; font-weight: 800; color: #fff8f0; display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; border: 2px solid color-mix(in oklab, var(--sc, #888) 55%, #eef1f6); background: color-mix(in oklab, var(--sc, #444) 62%, #0f1218); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); font-size: 0.82rem; }
.trump-chip .dot, .lead-chip .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in oklab, var(--sc, #666) 70%, #eef1f6 20%); color: #fff; flex: none; }
.trump-chip .dot .ic, .lead-chip .dot .ic { width: 15px; height: 15px; stroke-width: 4.5; }
.trump-chip small { font-weight: 600; opacity: 0.8; letter-spacing: 0.02em; }
@media (max-width: 380px) { .lead-chip, .trump-chip { font-size: 0.74rem; padding-right: 9px; letter-spacing: 0.03em; } }
@media (max-height: 520px) and (orientation: landscape) {
  .game[data-phase='bid'] .table-wrap, .game[data-phase='play'] .table-wrap, .game[data-phase='pause'] .table-wrap { padding-top: 26px; }
  .lead-chip, .trump-chip { font-size: 0.72rem; padding: 2px 10px 2px 3px; } .trump-chip .dot, .lead-chip .dot { width: 18px; height: 18px; } .trump-chip .dot .ic, .lead-chip .dot .ic { width: 12px; height: 12px; }
}
.seg { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.toggles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chip-bid.forbidden { opacity: 0.35; text-decoration: line-through; }
.legal-note { margin: 0; text-align: center; font-size: 0.8rem; color: var(--muted); }
.mini-cards .card.mini, .lad-cards .card.mini { --cw: 34px; }
.foot-note small { display: block; opacity: 0.8; }
.home .btn-accent, .start-bar .btn-accent { font-size: 1.35rem; white-space: nowrap; }
.sheet-foot .ready-row > .btn-accent { font-size: 1.3rem; }
/* Paysage (≤ 5 joueurs) : la fiche flotte sous l'équipage dans un emplacement de hauteur FIXE (le contenu s'aligne en bas) :
   son rectangle ne change jamais, qu'elle montre une fiche ou l'indication « touchez une carte ». */
@media (max-height: 520px) and (orientation: landscape) {
  .game:not([data-n='6']):not([data-n='7']):not([data-n='8']) .dock .card-info { height: 148px; max-height: 148px; display: flex; flex-direction: column; justify-content: flex-end; pointer-events: none; }
  .game:not([data-n='6']):not([data-n='7']):not([data-n='8']) .dock .card-info > * { pointer-events: auto; width: 100%; }
}
/* l'étiquette « En tête » ne doit jamais cacher l'index de la carte : elle se pose en bas */
.lead-tag { top: auto; bottom: 22px; }
