/* Le Bistrot des Jeux — feuille de style
   Direction : une salle de jeu de nuit. Fond encre, tapis de feutre vert profond, dés ivoire en 3D,
   un accent par jeu (or pour le 10 000, corail pour le Yam's). Thème clair disponible. */
:root {
  --bg: #0B1214;
  --bg-2: #0F191C;
  --surface: #131E22;
  --surface-2: #19272C;
  --surface-3: #213238;
  --line: rgba(220, 240, 235, .09);
  --line-2: rgba(220, 240, 235, .16);
  --ink: #EAF2EF;
  --muted: #8EA29C;
  --faint: #5F726C;
  --felt: #12463C;
  --felt-2: #0A2B25;
  --felt-ink: #E6F2EC;
  --gold: #F2B84B;
  --coral: #FF7D5C;
  --sky: #6DB3F2;
  --violet: #B593F5;
  --rose: #F27BA0;
  --mint: #4FC48F;
  --amber: #F2994A;
  --teal: #5FD0D6;
  --good: #5CCB98;
  --bad: #F26B5B;
  --die: #FBF7EE;
  --die-2: #E9E2D2;
  --pip: #16201D;
  --pip-red: #C8402F;
  --die-hi: #FFFFFF; --pip-hi: #4b5753; --pip-red-hi: #e7705c; --pip-glow: rgba(255, 255, 255, .75);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .25);
  --p0: #6DB3F2; --p1: #FF7D5C; --p2: #5CCB98; --p3: #C49BF2; --p4: #F2B84B; --p5: #5FD0D6;
  --accent: var(--gold);
  --accent-ink: #1E1503;
  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-body: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-sm: 10px; --r: 16px; --r-lg: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #EDF2EF; --bg-2: #E4EBE7; --surface: #FFFFFF; --surface-2: #F4F7F5; --surface-3: #E8EEEB;
  --line: rgba(12, 40, 33, .1); --line-2: rgba(12, 40, 33, .18);
  --ink: #0F1B18; --muted: #566A63; --faint: #8A9B95;
  --felt: #17604F; --felt-2: #0F4639; --felt-ink: #EAF5EF;
  --gold: #C4870F; --coral: #E0563A; --sky: #2F7BC0; --violet: #7B4FCB; --rose: #D2416F; --mint: #1F8A5B; --amber: #C76A16; --teal: #1E8E94; --good: #23885A; --bad: #C8402F;
  --shadow: 0 18px 40px rgba(15, 40, 33, .14); --shadow-sm: 0 6px 16px rgba(15, 40, 33, .1);
  --p0: #2F7BC0; --p1: #E0563A; --p2: #23885A; --p3: #8350C4; --p4: #C4870F; --p5: #1E9AA0;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #EDF2EF; --bg-2: #E4EBE7; --surface: #FFFFFF; --surface-2: #F4F7F5; --surface-3: #E8EEEB;
    --line: rgba(12, 40, 33, .1); --line-2: rgba(12, 40, 33, .18);
    --ink: #0F1B18; --muted: #566A63; --faint: #8A9B95;
    --felt: #17604F; --felt-2: #0F4639; --felt-ink: #EAF5EF;
    --gold: #C4870F; --coral: #E0563A; --sky: #2F7BC0; --violet: #7B4FCB; --rose: #D2416F; --mint: #1F8A5B; --amber: #C76A16; --teal: #1E8E94; --good: #23885A; --bad: #C8402F;
    --shadow: 0 18px 40px rgba(15, 40, 33, .14); --shadow-sm: 0 6px 16px rgba(15, 40, 33, .1);
    --p0: #2F7BC0; --p1: #E0563A; --p2: #23885A; --p3: #8350C4; --p4: #C4870F; --p5: #1E9AA0;
    color-scheme: light;
  }
}
[data-game="yams"] { --accent: var(--coral); --accent-ink: #250903; }
[data-game="10000"] { --accent: var(--gold); --accent-ink: #1E1503; }
[data-game="tarot"] { --accent: var(--violet); --accent-ink: #160B2E; }
[data-game="rami"] { --accent: var(--sky); --accent-ink: #04182B; }
[data-game="bataille"] { --accent: var(--rose); --accent-ink: #2B0412; }
[data-game="belote"] { --accent: var(--mint); --accent-ink: #052014; }
[data-game="crapette"] { --accent: var(--amber); --accent-ink: #2A1302; }
[data-game="421"] { --accent: var(--teal); --accent-ink: #03222A; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--f-body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1200px 600px at 85% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--felt) 35%, transparent), transparent 60%);
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; line-height: 1.1; text-wrap: balance; letter-spacing: -.02em; }
p { margin: 0; }
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 800; font-size: 21px; letter-spacing: -.03em; flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, var(--felt), var(--felt-2)); display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px; gap: 1px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.brand-mark i { width: 4px; height: 4px; border-radius: 50%; place-self: center; background: transparent; }
.brand-mark i.on { background: var(--die); }
.top-center { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; justify-content: center; }
.top-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.navlink { text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.navlink:hover, .navlink.on { color: var(--ink); background: var(--surface-2); }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; position: relative; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn.on { color: var(--accent); }
.iconbtn svg { width: 20px; height: 20px; flex: none; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.conn-dot.ok { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.conn-dot.ko { background: var(--bad); }
.profile-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font-weight: 600; font-size: 14px; max-width: 170px; }
.profile-chip span.n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.table-chip .gname { font-family: var(--f-display); font-size: 18px; font-weight: 800; white-space: nowrap; }
.code-pill { font-family: var(--f-num); font-size: 13px; letter-spacing: .12em; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; color: var(--ink); }
.code-pill:hover { border-color: var(--accent); }

/* ---------- Boutons et champs ---------- */
.btn { --b: var(--surface-2); appearance: none; border: 1px solid transparent; background: var(--b); color: var(--ink); border-radius: 999px; padding: 11px 20px; font-weight: 650; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: transform .12s var(--ease), background .15s, box-shadow .15s, opacity .15s; user-select: none; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); filter: none; }
.btn.outline { background: transparent; border-color: var(--line-2); }
.btn.outline:hover:not(:disabled) { border-color: var(--ink); filter: none; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.lg { padding: 15px 26px; font-size: 16px; }
.btn.sm { padding: 7px 13px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .kbd { font-family: var(--f-num); font-size: 11px; opacity: .55; font-weight: 500; }
.link { background: none; border: 0; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; cursor: pointer; }
.input, .select { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s; }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--muted); }
.field .help { font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: var(--shadow-sm); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface-2); font-size: 18px; font-weight: 600; cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 34px; text-align: center; font-family: var(--f-num); font-weight: 600; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 20px; }

/* ---------- Accueil ---------- */
.page { padding-block: 28px 64px; display: flex; flex-direction: column; gap: 28px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.hero h1 { font-size: clamp(42px, 7vw, 84px); font-weight: 800; letter-spacing: -.045em; line-height: .95; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 48ch; margin-top: 16px; }
.hero-side { display: flex; flex-direction: column; gap: 14px; }
.hero-felt { position: relative; border-radius: var(--r-lg); background: radial-gradient(120% 100% at 50% 20%, var(--felt), var(--felt-2)); padding: 30px 18px; box-shadow: inset 0 2px 30px rgba(0,0,0,.35), var(--shadow); overflow: hidden; min-height: 170px; display: grid; place-items: center; }
.hero-felt::before, .felt::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 2px, transparent 2px 5px), repeating-linear-gradient(-45deg, rgba(0,0,0,.05) 0 2px, transparent 2px 6px); }
.profile-card { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.profile-card .field { flex: 1; min-width: 180px; }
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.game-card { --accent: var(--gold); position: relative; display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.game-card[data-game="yams"] { --accent: var(--coral); }
.game-card::after { content: ""; position: absolute; width: 260px; height: 260px; right: -90px; top: -110px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%); pointer-events: none; }
.game-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.game-card h2 { font-size: 34px; font-weight: 800; }
.game-card .tag { font-size: 14px; color: var(--muted); max-width: 40ch; }
.game-card .art { display: flex; gap: 8px; position: relative; z-index: 1; }
.game-card .gstats { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.game-card .gstats b { color: var(--ink); font-family: var(--f-num); font-weight: 600; }
.game-card .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.soon-card { border-style: dashed; background: transparent; justify-content: center; }
.soon-card h2 { font-size: 24px; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.join-row { display: flex; gap: 10px; }
.join-row .input { font-family: var(--f-num); letter-spacing: .2em; text-transform: uppercase; max-width: 160px; }
.tables { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tables li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.tables li:first-child { border-top: 0; padding-top: 0; }
.tcode { font-family: var(--f-num); font-weight: 600; letter-spacing: .1em; font-size: 14px; padding: 6px 9px; border-radius: 9px; background: var(--surface-2); }
.tinfo { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tinfo .names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tinfo .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; }
.status.lobby { color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, transparent); }
.status.playing { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.status.finished { color: var(--muted); background: var(--surface-2); }
.tacts { display: flex; gap: 6px; }
.empty { color: var(--muted); font-size: 14px; }

/* ---------- Avatars ---------- */
.avatar { --c: var(--p0); width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 15px; color: #0b1214; background: var(--c); position: relative; }
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 46px; height: 46px; font-size: 19px; }
.avatar .bot { position: absolute; right: -4px; bottom: -4px; font-size: 9px; font-family: var(--f-body); font-weight: 700; background: var(--surface-3); color: var(--ink); border: 2px solid var(--surface); border-radius: 6px; padding: 0 3px; line-height: 1.3; }

/* ---------- Fenêtres ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(4, 9, 8, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s ease; }
.modal { width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: pop .28s var(--ease); display: flex; flex-direction: column; }
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 0; }
.modal-head h2 { font-size: 26px; font-weight: 800; }
.modal-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { padding: 0 22px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: pop .25s var(--ease); pointer-events: auto; }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------- Règles ---------- */
.rules h3 { font-size: 17px; margin-top: 4px; }
.rules ol, .rules ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: top; }
.ptable td:last-child { text-align: right; font-family: var(--f-num); font-weight: 600; white-space: nowrap; }

/* ---------- Salon ---------- */
.lobby { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.lobby h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 800; }
.lobby h1 .code { font-family: var(--f-num); color: var(--accent); letter-spacing: .12em; }
.invite { display: flex; gap: 8px; }
.invite .input { font-family: var(--f-num); font-size: 13px; }
.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.seat .n { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .tag { font-size: 12px; color: var(--muted); }
.seat.empty-seat { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); justify-content: center; }
.addbot { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Table de jeu ---------- */
.table-page { padding-block: 18px 40px; }
.table-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 20px; align-items: start; }
[data-game="yams"] .table-grid { grid-template-columns: minmax(0, 1fr) minmax(340px, 480px); }
.play { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.players-bar { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 4px; scrollbar-width: none; }
.players-bar::-webkit-scrollbar { display: none; }
.pcard { position: relative; flex: 1 0 140px; max-width: 240px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color .25s, box-shadow .25s, transform .25s var(--ease); }
.pcard.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.pcard .pinfo { min-width: 0; display: flex; flex-direction: column; }
.pcard .pname { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pscore { font-family: var(--f-num); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.pcard .plive { font-family: var(--f-num); font-size: 12px; color: var(--accent); }
.pcard .bar { position: absolute; left: 12px; right: 12px; bottom: 5px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pcard .bar i { display: block; height: 100%; background: var(--c, var(--accent)); transition: width .6s var(--ease); }
.pcard .flag { position: absolute; top: -9px; right: 10px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 2px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.bubble { position: absolute; left: 50%; top: -8px; transform: translate(-50%, -100%); font-size: 30px; pointer-events: none; animation: bubble 2.2s var(--ease) forwards; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); z-index: 5; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -110%) scale(1.15); } 30% { transform: translate(-50%, -100%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -170%); } }

.felt { position: relative; border-radius: 28px; padding: 22px 18px 18px; color: var(--felt-ink);
  background: radial-gradient(130% 100% at 50% 15%, var(--felt) 0%, var(--felt-2) 100%);
  box-shadow: inset 0 2px 30px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.05), var(--shadow); overflow: hidden; }
.felt-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.turn-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.turn-who .label { color: color-mix(in srgb, var(--felt-ink) 65%, transparent); }
.turn-who .who { font-family: var(--f-display); font-size: clamp(22px, 3.4vw, 30px); font-weight: 800; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-pts { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.turn-pts .label { color: color-mix(in srgb, var(--felt-ink) 65%, transparent); }
.turn-pts .big { font-family: var(--f-display); font-size: clamp(34px, 5.4vw, 52px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; transition: color .2s; }
.turn-pts .sub { font-size: 13px; color: color-mix(in srgb, var(--felt-ink) 70%, transparent); min-height: 1.4em; font-variant-numeric: tabular-nums; }
.rolls { display: inline-flex; gap: 6px; margin-top: 8px; }
.rolls i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--felt-ink) 60%, transparent); }
.rolls i.on { background: var(--accent); border-color: var(--accent); }
.felt-msg { position: relative; text-align: center; font-weight: 650; min-height: 1.5em; font-size: 15px; }
.felt-msg.good { color: #9BF0C6; }
.felt-msg.bad { color: #FFB2A6; }
.felt-msg.big { font-family: var(--f-display); font-size: 26px; font-weight: 800; color: var(--accent); animation: pop .4s var(--ease); }
.felt.shake { animation: shake .35s ease; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }

.controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.controls .btn.lg { min-width: 180px; }
.subline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); min-height: 1.5em; }
.subline b { color: var(--ink); font-family: var(--f-num); }
.coach { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: color-mix(in srgb, var(--sky) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sky) 30%, transparent); font-size: 14px; animation: fade .25s ease; }
.coach .ico { width: 30px; height: 30px; border-radius: 10px; background: color-mix(in srgb, var(--sky) 22%, transparent); color: var(--sky); display: grid; place-items: center; flex: none; font-weight: 800; font-family: var(--f-display); }
.coach p + p { margin-top: 4px; color: var(--muted); }
.coach .ctitle { font-weight: 700; color: var(--sky); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px; }
.reactions { display: flex; gap: 6px; flex-wrap: wrap; }
.chat .reactions button { width: 38px; height: 38px; font-size: 18px; }
.reactions button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; cursor: pointer; transition: transform .15s var(--ease), background .15s; }
.reactions button:hover { transform: translateY(-2px) scale(1.06); background: var(--surface-2); }
.kbd-hint { font-size: 12px; color: var(--faint); }

/* ---------- Dés (rangée fixe, saut et rotation au lancer) ---------- */
.dzone { display: flex; flex-direction: column; gap: 14px; padding-block: 26px 6px; }
.drow { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 2.6vw, 18px); min-height: calc(var(--ds) + 20px); --ds: clamp(52px, 13vw, 70px); }
.die2 { position: relative; width: var(--ds); height: var(--ds); padding: 0; border: 0; background: none; cursor: pointer; flex: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: transform .22s var(--ease), opacity .25s; }
.die2:disabled { cursor: default; }
.die2:focus-visible { outline: none; }
.die2:focus-visible .dface { outline: 3px solid var(--accent); outline-offset: 3px; }
.dshadow { position: absolute; left: 10%; right: 10%; bottom: -9%; height: 22%; border-radius: 50%; background: rgba(0, 0, 0, .42); filter: blur(5px); transition: transform .22s var(--ease), opacity .22s; }
.dbody { position: absolute; inset: 0; will-change: transform; }
.dface { position: absolute; inset: 0; border-radius: 22%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 15%;
  background: linear-gradient(155deg, var(--die-hi) 0%, var(--die) 38%, var(--die-2) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 -4px 0 rgba(0, 0, 0, .09), 0 1px 0 rgba(0, 0, 0, .12); transition: box-shadow .2s, filter .2s; }
.dface i { display: block; width: 72%; aspect-ratio: 1; border-radius: 50%; place-self: center; }
.dface i.on { background: radial-gradient(circle at 36% 30%, var(--pip-hi), var(--pip) 64%); box-shadow: inset 0 1.5px 2px rgba(0, 0, 0, .55), 0 1px 0 var(--pip-glow); }
.dface.one i.on { width: 92%; background: radial-gradient(circle at 36% 30%, var(--pip-red-hi), var(--pip-red) 64%); }
.die2.held { transform: translateY(-10px); }
.die2.held .dshadow { transform: translateY(10px) scale(.82); opacity: .55; }
.die2.held .dface { box-shadow: 0 0 0 3px var(--accent), 0 0 20px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 2px 0 rgba(255, 255, 255, .9), inset 0 -4px 0 rgba(0, 0, 0, .09); }
.die2.held::after { content: "gardé"; position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.die2.blank { opacity: .32; }
.die2.dead .dface { filter: saturate(.35) brightness(.8); }
.die2.hint .dface { outline: 2px dashed var(--sky); outline-offset: 4px; }
@media (hover: hover) { .die2:not(:disabled):not(.held):hover { transform: translateY(-4px); } }
.dstrip { display: flex; align-items: center; gap: 12px; justify-content: center; border-top: 1px dashed color-mix(in srgb, var(--felt-ink) 26%, transparent); padding-top: 12px; }
.dstrip-dice { display: flex; gap: 6px; }
.dstrip .mini-die { --s: 30px; opacity: .85; }
.keep-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: color-mix(in srgb, var(--felt-ink) 60%, transparent); white-space: nowrap; }

/* ---------- Bulles et chat ---------- */
.bubble-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.bubble-layer .bubble { position: fixed; transform: translate(-50%, -100%); font-size: 34px; line-height: 1; animation: bubbleUp 2.2s var(--ease) forwards; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.bubble-layer .bubble.text { transform: none; font-size: 14px; font-weight: 600; line-height: 1.35; max-width: min(280px, 80vw); padding: 9px 13px; border-radius: 4px 16px 16px 16px; background: var(--ink); color: var(--bg); filter: none; box-shadow: var(--shadow-sm); animation: bubbleText 4.2s var(--ease) forwards; text-align: left; }
@keyframes bubbleUp { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.4); } 15% { opacity: 1; transform: translate(-50%, -115%) scale(1.15); } 30% { transform: translate(-50%, -105%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -190%); } }
@keyframes bubbleText { 0% { opacity: 0; transform: translateY(-6px) scale(.92); } 8% { opacity: 1; transform: none; } 88% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat .card-head { margin-bottom: 0; }
.quick-msgs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; touch-action: manipulation; transition: background .15s, border-color .15s; }
.chip:hover { border-color: var(--accent); }
.chip:active { transform: scale(.97); }
.chat-list { list-style: none; margin: 0; padding: 10px 12px; max-height: 190px; min-height: 64px; overflow-y: auto; border-radius: 12px; background: var(--bg-2); display: flex; flex-direction: column; gap: 6px; font-size: 14px; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 8px; }
.chat-form .input { flex: 1; min-width: 0; }
.mini-die { --s: 34px; width: var(--s); height: var(--s); border-radius: 22%; background: radial-gradient(120% 120% at 30% 25%, var(--die-hi), var(--die) 45%, var(--die-2)); display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: calc(var(--s) * .15); box-shadow: 0 3px 8px rgba(0,0,0,.3); flex: none; }
.mini-die .pip { width: 72%; aspect-ratio: 1; border-radius: 50%; place-self: center; }
.mini-die .pip.on { background: radial-gradient(circle at 35% 30%, var(--pip-hi), var(--pip) 60%); box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.mini-die.v1 .pip.on { background: radial-gradient(circle at 35% 30%, var(--pip-red-hi), var(--pip-red) 60%); width: 86%; }
.mini-die.sm { --s: 24px; }
.mini-die.lg { --s: 48px; }

/* ---------- Feuille du 10 000 ---------- */
.side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
.side .card { padding: 18px; }
.hist-wrap { max-height: 46vh; overflow: auto; margin-inline: -4px; }
.hist { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.hist th { position: sticky; top: 0; background: var(--surface); text-align: right; font-weight: 650; padding: 6px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist th:first-child, .hist td:first-child { text-align: left; color: var(--muted); width: 34px; }
.hist td { text-align: right; padding: 6px; border-top: 1px solid var(--line); font-family: var(--f-num); }
.hist td small { display: block; font-size: 11px; color: var(--good); }
.hist td.bust { color: var(--muted); }
.hist td.bust small { color: var(--bad); }
.hist tr.fresh td { animation: flash 1.2s ease; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 25%, transparent); } }

/* ---------- Feuille du Yam's ---------- */
.ysheet-wrap { overflow-x: auto; margin-inline: -6px; }
.ysheet { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.ysheet th, .ysheet td { padding: 0; height: 36px; border-bottom: 1px solid var(--line); }
.ysheet thead th { height: auto; padding: 0 4px 10px; border-bottom: 1px solid var(--line-2); vertical-align: bottom; }
.ysheet thead .ph { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; max-width: 84px; margin: 0 auto; }
.ysheet thead .ph > span:not(.avatar) { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ysheet th.cat { text-align: left; font-weight: 600; padding-left: 8px; white-space: nowrap; }
.ysheet th.cat small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; line-height: 1.2; }
.ysheet td { text-align: center; font-family: var(--f-num); min-width: 56px; }
.ysheet td.cur { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.ysheet tr.sum th, .ysheet tr.sum td { background: var(--surface-2); font-weight: 700; }
.ysheet tr.total th, .ysheet tr.total td { font-size: 16px; font-weight: 800; border-bottom: 0; height: 44px; }
.ysheet tr.sep td, .ysheet tr.sep th { height: 8px; border-bottom: 0; }
.ycell { width: 100%; height: 34px; border: 0; background: transparent; font-family: var(--f-num); font-size: 15px; cursor: default; border-radius: 9px; color: inherit; }
.ycell.pick { cursor: pointer; color: var(--accent); font-weight: 700; font-style: italic; }
.ycell.pick.zero { color: var(--faint); }
.ycell.pick:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ycell.pick.suggest { box-shadow: inset 0 0 0 2px var(--sky); }
.ycell.confirm { background: var(--bad); color: #fff; font-style: normal; font-size: 12px; font-family: var(--f-body); }
.ycell.filled { font-weight: 600; }
.ycell.fresh { animation: flash 1.4s ease; }
.ycell.zeroed { color: var(--faint); }
.bonus-prog { font-size: 11px; color: var(--muted); display: block; }

/* ---------- Fin de partie ---------- */
.podium { display: flex; flex-direction: column; gap: 10px; }
.rank-row { display: grid; grid-template-columns: 36px auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.rank-row.first { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, var(--surface-2)), var(--surface-2)); }
.rank-row .rk { font-family: var(--f-display); font-weight: 800; font-size: 22px; color: var(--muted); text-align: center; }
.rank-row.first .rk { color: var(--accent); }
.rank-row .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .dt { grid-column: 3 / -1; font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.rank-row .sc { font-family: var(--f-num); font-weight: 700; font-size: 20px; }
.win-title { font-size: clamp(30px, 5vw, 42px); font-weight: 800; }
canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

/* ---------- Statistiques ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.kpi { padding: 14px; border-radius: 14px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.kpi .v { font-family: var(--f-display); font-weight: 800; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .k { font-size: 12px; color: var(--muted); }
.h2h { width: 100%; border-collapse: collapse; font-size: 14px; }
.h2h th, .h2h td { padding: 10px 6px; border-top: 1px solid var(--line); text-align: right; }
.h2h th:first-child, .h2h td:first-child { text-align: left; }
.h2h thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.wl { display: inline-flex; height: 8px; width: 90px; border-radius: 8px; overflow: hidden; background: var(--line); vertical-align: middle; }
.wl i { display: block; height: 100%; }
.recent { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.recent li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.recent li:first-child { border-top: 0; }
.medal { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-family: var(--f-display); background: var(--surface-2); flex: none; }
.medal.gold { background: color-mix(in srgb, var(--gold) 25%, transparent); color: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero, .home-grid, .lobby { grid-template-columns: minmax(0, 1fr); }
  .table-grid, [data-game="yams"] .table-grid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .hist-wrap { max-height: 260px; }
  .table-grid { display: flex; flex-direction: column; align-items: stretch; }
  .table-grid > .play { display: contents; }
  .table-grid > .play > *, .table-grid > .side { order: 1; }
  .table-grid > .play > .react-row { order: 5; }
}
@media (max-width: 560px) {
  .topbar .wrap { gap: 4px; min-height: 56px; }
  .brand .bname { display: none; }
  .profile-chip { padding: 3px; border: 0; background: transparent; }
  .profile-chip .n { display: none; }
  .iconbtn { width: 36px; height: 36px; }
  .table-chip .gname { font-size: 16px; }
  body:has(.table-page) .top-actions .hide-in-game { display: none; }
  body:has(.table-page) .table-chip .gname { display: none; }
  .top-center { justify-content: flex-start; }
  .hero-felt { padding-inline: 10px; }
  .card { padding: 18px; }
  .controls .btn.lg { min-width: 0; flex: 1; padding: 14px 14px; }
  .modal-head, .modal-body { padding-inline: 18px; }
  .modal-foot { padding-inline: 18px; }
  .kbd-hint { display: none; }
  .pcard { flex-basis: 128px; padding: 8px 10px; }
  .ysheet td { min-width: 48px; }
  .hide-sm { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Accueil (catalogue) ---------- */
.home { gap: 44px; }
.home-hero { display: flex; flex-direction: column; gap: 16px; padding-top: 18px; max-width: 760px; }
.home-hero h1 { font-size: clamp(38px, 6vw, 64px); font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.home-hero .lede { font-size: 18px; color: var(--muted); max-width: 56ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.join-inline { display: flex; gap: 8px; }
.join-inline .input { width: 108px; font-family: var(--f-num); letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.resume { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; align-self: flex-start; }
.features { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.features li { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 0 0; font-size: 14px; }
.features b { font-weight: 650; }
.features span { color: var(--muted); }
.shelf { display: flex; flex-direction: column; gap: 16px; }
.shelf-head { display: flex; align-items: baseline; gap: 12px; }
.shelf-head h2 { font-size: 24px; font-weight: 800; }
.soon-chip { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.tile { --accent: var(--gold); display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.tile[data-game="yams"] { --accent: var(--coral); }
.tile[data-game="tarot"] { --accent: var(--violet); }
.tile[data-game="rami"] { --accent: var(--sky); }
.tile[data-game="bataille"] { --accent: var(--rose); }
.tile[data-game="belote"] { --accent: var(--mint); }
.tile[data-game="crapette"] { --accent: var(--amber); }
.tile[data-game="421"] { --accent: var(--teal); }
.tile:not(.soon):hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow); }
.tile-art { position: relative; height: 128px; border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; background: radial-gradient(120% 120% at 50% 0%, var(--felt), var(--felt-2)); border-bottom: 1px solid var(--line); }
.tile-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--accent) 18%, transparent)); pointer-events: none; }
.tile-dice { display: flex; gap: 8px; position: relative; z-index: 1; }
.tile-dice .mini-die { --s: 38px; }
.tile-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tile-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tile-title h3 { font-size: 22px; font-weight: 800; }
.tile-meta { font-size: 12px; color: var(--muted); }
.tile-tag { font-size: 14px; color: var(--muted); }
.tile-stats { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.tile-actions .link { margin-left: 4px; font-size: 14px; }
.tile.soon .tile-art { cursor: default; filter: saturate(.55); }
.tile.soon .tile-body { opacity: .8; }
.tile-art.cards { display: flex; justify-content: center; align-items: center; }
@media (max-width: 760px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-actions .btn.lg { padding: 13px 18px; }
}

/* ---------- Tactile : pas de zoom au double-tap, pas de délai ---------- */
html { touch-action: manipulation; }
button, a, .die2, .ycell, .chip, input, select { touch-action: manipulation; }
.die2, .ycell, .btn, .chip, .reactions button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (hover: none) {
  .btn:hover:not(:disabled) { filter: none; }
  .reactions button:hover { transform: none; }
}
@media (max-width: 560px) {
  .input, .select { font-size: 16px; } /* évite le zoom automatique d'iOS sur les champs */
}
@media (max-width: 560px) {
  .tiles:has(.tile.soon) { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile.soon .tile-art { height: 84px; }
  .tile.soon .tile-cards .gcard { --cw: 34px; }
  .tile.soon .tile-body { padding: 10px 12px 12px; }
  .tile.soon .tile-title h3 { font-size: 17px; }
  .tile.soon .tile-tag, .tile.soon .tile-title .soon-chip { display: none; }
}

/* ---------- Partie rapide ---------- */
.searching { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-block: 8px; }
.search-dice { display: flex; gap: 10px; }
.search-dice .mini-die { --s: 40px; animation: searchHop 1.2s var(--ease) infinite; }
.search-dice .mini-die:nth-child(2) { animation-delay: .15s; }
.search-dice .mini-die:nth-child(3) { animation-delay: .3s; }
@keyframes searchHop { 0%, 60%, 100% { transform: none; } 25% { transform: translateY(-10px) rotate(-12deg); } 45% { transform: translateY(0) rotate(4deg); } }
#online-list li { grid-template-columns: auto minmax(0, 1fr) auto; }

/* =====================================================================
   v6 — mise en page centrée, cartes à jouer, profils, classement, chat
   ===================================================================== */

/* ---------- Centrage ---------- */
.home-hero { margin-inline: auto; align-items: center; text-align: center; max-width: 820px; }
.home-hero .lede { margin-inline: auto; }
.home-hero .hl { color: var(--accent); }
.hero-actions { justify-content: center; }
.resume { align-self: center; }
.features { width: 100%; }
.features li { align-items: center; text-align: center; padding: 14px 8px 0; }
.shelf-head { justify-content: center; flex-wrap: wrap; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); justify-content: center; }
.page-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.page-head h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 800; }
.page-head .muted { max-width: 60ch; }
.home-grid > .shelf { min-width: 0; }
.linkish { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 600; color: inherit; }
.linkish:hover { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---------- Avatars emoji ---------- */
.avatar.emoji { background: color-mix(in srgb, var(--c) 26%, var(--surface-2)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent); font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 20px; line-height: 1; }
.avatar.emoji.sm { font-size: 15px; }
.avatar.emoji.lg { font-size: 26px; }
.felt .avatar.emoji { background: rgba(0, 0, 0, .25); }

/* ---------- Profil ---------- */
.profile-top { display: flex; gap: 16px; align-items: flex-start; }
.profile-top > span:first-child { padding-top: 22px; }
.name-hint { min-height: 1.4em; }
.name-hint.good { color: var(--good); }
.name-hint.bad { color: var(--bad); }
.avatar-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.avatar-pick { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 22px; cursor: pointer; display: grid; place-items: center; padding: 0; transition: transform .12s var(--ease), border-color .15s, background .15s; }
.avatar-pick:hover { transform: translateY(-2px); }
.avatar-pick[aria-checked="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); box-shadow: 0 0 0 2px var(--accent); }
.code-box { border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
.code-box summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.input.mono { font-family: var(--f-num); font-size: 13px; letter-spacing: .04em; }
.tier-list { display: flex; flex-direction: column; gap: 6px; }
.tier-item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); }
.tier-item b { flex: 1; }
@media (max-width: 560px) { .avatar-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---------- Rangs et classement ---------- */
.tier { --t: var(--gold); display: inline-flex; align-items: baseline; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; color: var(--t); background: color-mix(in srgb, var(--t) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 35%, transparent); white-space: nowrap; vertical-align: middle; }
.tier small { font-size: 10px; opacity: .75; font-weight: 600; text-transform: none; letter-spacing: 0; }
.tier-ladder { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.tiers-card { text-align: center; }
.board-tabs { align-self: center; justify-content: center; }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.board li, .mini-board li { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-top: 1px solid var(--line); border-radius: 10px; }
.board li:first-child, .mini-board li:first-child { border-top: 0; }
.board li.me, .mini-board li.me, .rating-table tr.me td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.board .who { flex: 1; }
.board .when { font-size: 12px; }
.mini-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-board li.empty { border: 0; }
.medal.m1 { background: color-mix(in srgb, #E2B044 28%, transparent); color: #E2B044; }
.medal.m2 { background: color-mix(in srgb, #A8B3B8 28%, transparent); color: #A8B3B8; }
.medal.m3 { background: color-mix(in srgb, #C08457 28%, transparent); color: #C08457; }
.who { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; min-width: 0; text-align: left; }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who:hover span { text-decoration: underline; text-decoration-color: var(--accent); }
.rating-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rating-table th, .rating-table td { padding: 9px 6px; border-top: 1px solid var(--line); text-align: left; }
.rating-table thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.rating-table .num { text-align: right; }
.me-card { padding: 16px 18px; }
.me-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kpis.compact { grid-template-columns: repeat(3, minmax(90px, auto)); }
.kpis.compact .kpi { padding: 10px 12px; }
.kpis.compact .kpi .v { font-size: 22px; }
.rating-delta { align-self: flex-start; font-weight: 700; font-family: var(--f-num); padding: 6px 12px; border-radius: 999px; font-size: 14px; }
.rating-delta.up { color: var(--good); background: color-mix(in srgb, var(--good) 15%, transparent); }
.rating-delta.down { color: var(--bad); background: color-mix(in srgb, var(--bad) 15%, transparent); }
.game-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.game-pick .btn { box-shadow: none; }
@media (max-width: 560px) { .me-row .kpis.compact { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Cartes à jouer ---------- */
.gcard { --w: var(--cw, 64px); position: relative; flex: none; width: var(--w); aspect-ratio: 5 / 7; padding: 0; border: 0; border-radius: calc(var(--w) * .1);
  background: linear-gradient(160deg, #FFFFFF 0%, #FBF7EE 55%, #E9E2D2 100%); color: #16201D;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 0 0 1px rgba(0, 0, 0, .08), 0 4px 10px rgba(0, 0, 0, .28);
  font-family: var(--f-display); line-height: 1; transition: transform .18s var(--ease), box-shadow .18s, filter .18s; user-select: none; -webkit-user-select: none; }
.gcard.red { color: #C8402F; }
.gcard .corner { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 1px; font-weight: 800; font-size: calc(var(--w) * .2); letter-spacing: -.03em; }
.gcard .corner i { font-style: normal; font-size: .85em; }
.gcard .corner.tl { top: 6%; left: 8%; }
.gcard .corner.br { bottom: 6%; right: 8%; transform: rotate(180deg); }
.gcard .mid { position: absolute; inset: 24% 20%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%; }
.gcard .mid .sym { font-size: calc(var(--w) * .42); line-height: 1; }
.gcard.face .mid { border-radius: calc(var(--w) * .06); background: color-mix(in srgb, currentColor 8%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 30%, transparent); }
.gcard.face .mid .fig { font-size: calc(var(--w) * .32); font-weight: 800; }
.gcard.face .mid .sym { font-size: calc(var(--w) * .22); }
.gcard.trump { color: #3B2A80; background: linear-gradient(160deg, #FFFFFF 0%, #F5F1FF 55%, #E4DCF7 100%); }
.gcard.trump .mid { inset: 20% 16%; border-radius: calc(var(--w) * .06); box-shadow: inset 0 0 0 1.5px rgba(59, 42, 128, .25); }
.gcard.trump .mid b { font-size: calc(var(--w) * .36); font-weight: 800; }
.gcard.trump .mid small { font-family: var(--f-body); font-size: calc(var(--w) * .11); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.gcard.excuse { color: #8A5A00; background: linear-gradient(160deg, #FFFFFF 0%, #FFF6E0 55%, #F3E2B5 100%); }
.gcard.joker { color: #7B2E8E; }
.gcard.joker .mid b { font-size: calc(var(--w) * .4); }
.gcard.joker .mid small, .gcard.excuse .mid small { font-family: var(--f-body); font-size: calc(var(--w) * .11); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.gcard.back { background: linear-gradient(145deg, color-mix(in srgb, var(--felt) 80%, #fff 14%), var(--felt-2)); }
.gcard .pback { position: absolute; inset: 7%; border-radius: calc(var(--w) * .06); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .09) 0 3px, transparent 3px 7px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, .12) 0 3px, transparent 3px 7px); }
.gcard.small { --cw: 40px; }
button.gcard { cursor: default; }
button.gcard.playable, button.gcard[aria-pressed] { cursor: pointer; }
.gcard.dim { filter: brightness(.62) saturate(.55); }
.gcard.selected { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--accent), 0 10px 24px color-mix(in srgb, var(--accent) 45%, transparent); }
.gcard.taken { box-shadow: 0 0 0 2px var(--sky), 0 4px 10px rgba(0, 0, 0, .28); }
.gcard:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { button.gcard.playable:not(.selected):hover { transform: translateY(-8px); } }
.tempty { display: inline-block; width: var(--cw, 62px); aspect-ratio: 5 / 7; border-radius: 8px; border: 1.5px dashed rgba(255, 255, 255, .2); }
.felt .label { color: color-mix(in srgb, var(--felt-ink) 65%, transparent); }

/* Tuiles de l'accueil */
.tile-cards { display: flex; justify-content: center; align-items: center; position: relative; z-index: 1; }
.tile-cards .gcard { --cw: 52px; margin: 0 -7px; transform: rotate(var(--r, 0deg)) translateY(calc(var(--r, 0deg) / 1deg * .25px)); box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.tile-art:hover .tile-cards .gcard { transform: rotate(calc(var(--r, 0deg) * 1.4)); }
.search-cards { display: flex; gap: 8px; }
.search-cards .gcard { --cw: 42px; animation: searchHop 1.2s var(--ease) infinite; }
.search-cards .gcard:nth-child(2) { animation-delay: .15s; }
.search-cards .gcard:nth-child(3) { animation-delay: .3s; }

/* ---------- Plateau des jeux de cartes ---------- */
.felt-extra { position: relative; }
.felt-extra:empty { display: none; }
.turn-pts .big.small-big { font-size: clamp(22px, 3.4vw, 30px); }
.below { display: flex; flex-direction: column; gap: 12px; }
.below:empty { display: none; }
.hand { --cw: 74px; display: flex; justify-content: center; align-items: flex-end; padding: 18px 4px 4px; min-height: 120px; }
.hand > .gcard + .gcard { margin-left: min(6px, calc((100% - var(--n, 1) * var(--cw)) / (var(--n, 2) - 1))); }
@media (max-width: 560px) {
  .hand { --cw: min(66px, calc((100vw - 54px) / var(--n2, 9) + 14px)); display: grid; grid-template-columns: repeat(var(--n2, 9), minmax(0, 1fr)); row-gap: 10px; padding: 16px 22px 4px 0; justify-items: start; }
  .hand > .gcard + .gcard { margin-left: 0; }
}

/* Tarot : quatre places autour du tapis */
.trick-table { display: grid; grid-template-areas: ". r2 ." "r3 c r1" ". r0 ."; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px 8px; align-items: center; justify-items: center; padding: 14px 0 6px; }
.tslot { --cw: 62px; display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; max-width: 100%; }
.tslot.r0 { grid-area: r0; } .tslot.r1 { grid-area: r1; } .tslot.r2 { grid-area: r2; } .tslot.r3 { grid-area: r3; }
.tslot.r0 { flex-direction: column-reverse; }
.tname { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 13px; font-weight: 650; padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(0, 0, 0, .22); transition: box-shadow .2s; }
.tname > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tslot.active .tname { box-shadow: 0 0 0 2px var(--accent); }
.tcard .gcard { --cw: 62px; animation: deal .28s var(--ease); }
.tslot.won .tcard .gcard { box-shadow: 0 0 0 3px var(--accent), 0 0 26px color-mix(in srgb, var(--accent) 60%, transparent); }
@keyframes deal { from { opacity: 0; transform: translateY(16px) scale(.9); } }
.tcenter { grid-area: c; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-height: 40px; }
.tcenter .eyebrow { color: color-mix(in srgb, var(--felt-ink) 70%, transparent); }
.tcenter .muted { color: color-mix(in srgb, var(--felt-ink) 75%, transparent); font-size: 13px; }
.mini-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.mini-row .gcard { --cw: 38px; }
.res { font-family: var(--f-display); font-weight: 800; font-size: 22px; }
.res.good { color: #9BF0C6; } .res.bad { color: #FFB2A6; }
.bid-panel { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; }
.controls { justify-content: center; }
.subline { justify-content: center; text-align: center; }
@media (max-width: 560px) {
  .tslot, .tcard .gcard { --cw: 50px; }
  .tname { font-size: 12px; }
  .tname > span:last-child { max-width: 74px; }
  .trick-table { gap: 8px 4px; }
}

/* Rami */
.rami-piles { display: flex; gap: 26px; justify-content: center; padding: 14px 0 10px; }
.pile { --cw: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pile .gcard.playable { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-5px); } 90% { transform: translateY(0); } }
.melds { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 4px 2px; }
.meld { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgba(0, 0, 0, .18); border: 1.5px solid transparent; color: inherit; text-align: left; font: inherit; min-width: 0; }
button.meld { cursor: pointer; }
.meld.fits { border-color: var(--accent); border-style: dashed; background: color-mix(in srgb, var(--accent) 14%, rgba(0, 0, 0, .18)); }
.meld-owner { font-size: 11px; font-weight: 700; color: var(--c, inherit); text-transform: uppercase; letter-spacing: .06em; flex: none; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meld-cards { display: flex; min-width: 0; }
.meld-cards .gcard { --cw: 36px; }
.meld-cards .gcard + .gcard { margin-left: -13px; }
.melds-empty { grid-column: 1 / -1; text-align: center; color: color-mix(in srgb, var(--felt-ink) 60%, transparent) !important; font-size: 14px; padding: 6px 0; }
.staged { padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1.5px dashed var(--accent); display: flex; flex-direction: column; gap: 10px; }
.staged-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.staged-list { display: flex; flex-wrap: wrap; gap: 8px; }
.staged-meld { background: var(--surface-2); }
.rules-mini p { font-size: 13px; margin-top: 6px; }

/* Bataille */
.battle { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 4px; }
.bside { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 10px 16px; border-radius: 20px; transition: background .25s, box-shadow .25s; min-width: min(100%, 320px); }
.bside.won { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 60%, transparent); }
.bdeck { --cw: 66px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gcard.deck { box-shadow: 2px 2px 0 var(--felt-2), 4px 4px 0 rgba(255, 255, 255, .18), 6px 6px 0 var(--felt-2), 0 10px 18px rgba(0, 0, 0, .35); }
.gcard.deck.playable { animation: nudge 1.6s ease-in-out infinite; cursor: pointer; }
.bcount { font-size: 12px; color: color-mix(in srgb, var(--felt-ink) 78%, transparent); font-weight: 600; text-align: center; }
.blaid { --cw: 78px; display: flex; align-items: center; min-width: 78px; }
.blaid .gcard { animation: deal .28s var(--ease); }
.blaid .gcard + .gcard { margin-left: -46px; }
.blaid .gcard.down { transform: rotate(-4deg); }
.bvs { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: color-mix(in srgb, var(--felt-ink) 55%, transparent); }
@media (max-width: 560px) { .bdeck { --cw: 54px; } .blaid { --cw: 66px; } .bside { gap: 14px; } }

/* ---------- Chat flottant ---------- */
.table-page { padding-bottom: 96px; }
.chat-dock { position: fixed; z-index: 50; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.chat-dock > * { pointer-events: auto; }
.chat-fab { position: relative; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 40%, rgba(0, 0, 0, .3)); transition: transform .15s var(--ease); }
.chat-fab svg { width: 24px; height: 24px; }
.chat-fab:active { transform: scale(.95); }
.chat-fab.open { background: var(--surface-3); color: var(--ink); box-shadow: var(--shadow-sm); }
.chat-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.chat-panel { width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 120px)); display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: pop .22s var(--ease); }
.chat-head { display: flex; justify-content: space-between; align-items: center; }
.chat-panel .reactions { justify-content: space-between; }
.chat-panel .reactions button { width: 38px; height: 38px; font-size: 18px; }
.chat-panel .chat-list { flex: 1; max-height: none; min-height: 90px; }
.chat-panel .chat-list li b { margin-right: 2px; }
@media (max-width: 560px) {
  .chat-dock { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .chat-fab { width: 50px; height: 50px; }
  .chat-panel { position: fixed; left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: calc(100dvh - 150px); }
}

/* ---------- Équité des dés ---------- */
.fair-card summary { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.fair-card summary::-webkit-details-marker { display: none; }
.fair-card summary h3 { font-size: 18px; }
.fair-card summary .muted { font-size: 12px; }
.fair-card[open] summary { margin-bottom: 12px; }
.fair { display: flex; flex-direction: column; gap: 12px; }
.fair-row { display: flex; flex-direction: column; gap: 6px; }
.fair-name { font-weight: 650; font-size: 13px; }
.fair-name small { color: var(--muted); font-weight: 500; }
.fair-bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.fair-bar { position: relative; height: 54px; border-radius: 8px; background: var(--surface-2); overflow: hidden; display: flex; align-items: flex-end; }
.fair-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 50%; border-top: 1px dashed var(--line-2); }
.fair-bar i { display: block; width: 100%; opacity: .8; transition: height .5s var(--ease); }
.fair-bar b { position: absolute; top: 3px; left: 0; right: 0; text-align: center; font-family: var(--f-num); font-size: 11px; color: var(--muted); }
.fair-card .help { font-size: 12px; color: var(--muted); margin-top: 10px; }
.felt.cards .turn-who .who { white-space: normal; overflow: visible; }
.chat-panel .reactions { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.chat-panel .reactions button { width: auto; aspect-ratio: 1; height: auto; }
@media (max-width: 560px) { .felt.cards .turn-who .who { font-size: 20px; } }
@media (max-width: 560px) { .controls > .btn { white-space: normal; text-align: center; max-width: 100%; } .controls > .btn.outline { flex: 1; } }

.fair-seg { margin-bottom: 12px; }
.fair-seg button { padding: 7px 12px; font-size: 13px; }
.fair-name { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.fair-verdict { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.fair-verdict.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.fair-verdict.meh { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.fair-verdict.odd { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.fair-verdict.few { color: var(--muted); background: var(--surface-2); }
.fair-bar em { position: absolute; bottom: 3px; left: 0; right: 0; text-align: center; font-style: normal; font-family: var(--f-num); font-size: 10px; font-weight: 600; color: var(--ink); }
.fair-bars.big .fair-bar { height: 80px; }

/* ---------- Rangs : badges (forme et couleur par rang) ---------- */
.rank-badge { --t: var(--muted); --s: 20px; display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; flex: none; line-height: 1; }
.rank-badge svg { width: var(--s); height: var(--s); flex: none; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .35)); overflow: visible; }
.rank-badge svg .b { fill: var(--t); stroke: color-mix(in srgb, var(--t) 55%, #000); stroke-width: 1; }
.rank-badge svg .i { fill: color-mix(in srgb, var(--t) 70%, #fff); opacity: .55; }
.rank-badge svg .g { fill: #fff; opacity: .92; }
.rank-badge svg .l { fill: none; stroke: #fff; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.rank-badge .rk-name { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--t); white-space: nowrap; }
.rank-badge .rk-pts { font-family: var(--f-num); font-size: 12px; color: var(--muted); }
.rank-badge.none .rk-name { color: var(--faint); }
.rank-badge.lg { --s: 40px; }
.rank-badge.xl { --s: 46px; }
.rank-badge.mini { --s: 15px; position: absolute; top: -5px; right: -6px; }
.avatar.sm .rank-badge.mini { --s: 13px; top: -5px; right: -6px; }
.avatar.lg .rank-badge.mini { --s: 19px; }
.avatar.ranked { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--t); }
.avatar.emoji.ranked { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 55%, transparent), 0 0 0 2px var(--surface), 0 0 0 4px var(--t); }
.felt .avatar.ranked, .tname .avatar.ranked { box-shadow: 0 0 0 2px rgba(0, 0, 0, .35), 0 0 0 3.5px var(--t); }

/* Progression vers le rang suivant */
.rank-progress { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 240px; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--t) 10%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 30%, transparent); }
.rp-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rp-line b { color: var(--t); font-family: var(--f-display); font-size: 18px; }
.rp-bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; margin: 6px 0 4px; }
.rp-bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--t) 70%, transparent), var(--t)); transition: width .6s var(--ease); }
.rp-next { font-size: 12px; }
.me-who { display: flex; align-items: center; gap: 12px; }
.me-row .kpis.compact { grid-template-columns: repeat(3, minmax(80px, auto)); }

/* Échelle des rangs */
.tier-ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.tier-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 12px; border-radius: 16px; background: color-mix(in srgb, var(--t) 8%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--t) 22%, transparent); }
.tier-step b { color: var(--t); font-family: var(--f-display); font-size: 16px; }
.tier-step small { font-family: var(--f-num); font-size: 11px; color: var(--muted); }
.tier-step.mine { box-shadow: 0 0 0 2px var(--t); }
.tier-step .you { position: absolute; top: -9px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; background: var(--t); color: #111; }
.tiers-card > .muted { max-width: 60ch; margin: 6px auto 0; font-size: 14px; }
@media (max-width: 560px) { .tier-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rank-progress { min-width: 0; width: 100%; } }

/* Lignes du classement teintées par rang */
.rating-table tr.tier-row td:first-child { box-shadow: inset 3px 0 0 var(--t); }
.rating-table .rank-badge .rk-name { font-size: 10px; }

/* Ailleurs */
.seat .rank-badge { margin-left: auto; }
.seat .rank-badge + .tag { margin-left: 8px; }
.rk-where { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.rk-where .rank-badge { --s: 15px; }
.tile-stats .rank-badge { --s: 16px; }
.tier-item .rank-badge { --s: 18px; }
.rank-result { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 16px; background: color-mix(in srgb, var(--t) 10%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 30%, transparent); }
.rank-result b { font-family: var(--f-display); font-size: 18px; color: var(--t); }
.rank-result .rating-delta { padding: 0; background: none; margin-top: 2px; }
.rank-result.promo { animation: pop .5s var(--ease); box-shadow: inset 0 0 0 2px var(--t), 0 0 30px color-mix(in srgb, var(--t) 35%, transparent); }

.pname-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pname-row .pname { min-width: 0; }
.pname-row .rank-badge { --s: 14px; gap: 3px; }
.pname-row .rank-badge .rk-name { font-size: 9.5px; }
@media (max-width: 560px) { .pname-row .rank-badge .rk-name { display: none; } }

/* ---------- Yam's du jour ---------- */
.daily-home:empty { display: none; }
.daily-card { --accent: var(--coral); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; border-color: color-mix(in srgb, var(--coral) 35%, var(--line)); background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--coral) 14%, var(--surface)), var(--surface) 60%); }
.daily-head { display: flex; flex-direction: column; gap: 8px; }
.daily-title { display: flex; align-items: center; gap: 14px; }
.daily-title h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
.daily-dice { display: flex; gap: 4px; flex: none; }
.daily-dice .mini-die { --s: 26px; }
.daily-dice .mini-die:nth-child(2) { transform: translateY(-5px) rotate(8deg); }
.daily-body { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 18px; align-items: start; }
.daily-mine { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.daily-mine b { font-family: var(--f-display); font-size: 20px; }
.daily-score { font-family: var(--f-display); font-size: 40px; font-weight: 800; color: var(--coral); line-height: 1; }
.daily-board li .who { flex: 1; }
.daily-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.daily-next { font-size: 13px; }
.daily-count { color: var(--ink); font-weight: 600; }
.daily-streak { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--coral) 15%, transparent); color: var(--coral); }
.daily-more { align-self: flex-start; font-size: 14px; }
.daily-yesterday { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.daily-page .daily-card { padding: 26px; }
.daily-result { padding: 12px 16px; border-radius: 16px; background: color-mix(in srgb, var(--coral) 12%, var(--surface-2)); }
.daily-result b { font-family: var(--f-display); font-size: 20px; color: var(--coral); }
@media (max-width: 760px) { .daily-body { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Trophées ---------- */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.trophy-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.trophy { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); opacity: .55; filter: grayscale(.8); }
.trophy.got { opacity: 1; filter: none; background: color-mix(in srgb, var(--gold) 10%, var(--surface-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent); }
.trophy .ticon { font-size: 26px; line-height: 1; flex: none; width: 34px; text-align: center; }
.trophy b { display: block; font-size: 14px; }
.trophy small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
.trophy small.tdate { margin-top: 2px; color: var(--gold); font-weight: 600; }
.trophy-grid.small .trophy { padding: 6px 8px; align-items: center; }
.trophy-grid.small .ticon { font-size: 18px; width: 22px; }
.trophy-grid.small b { font-size: 12px; }
.new-trophies { display: flex; flex-direction: column; gap: 8px; }
.new-trophies .eyebrow { color: var(--gold); }
.trophy.pop { animation: trophyPop .6s var(--ease) both; }
.trophy.pop:nth-of-type(2) { animation-delay: .12s; } .trophy.pop:nth-of-type(3) { animation-delay: .24s; }
@keyframes trophyPop { 0% { opacity: 0; transform: scale(.7) rotate(-4deg); } 60% { opacity: 1; transform: scale(1.04); } 100% { transform: none; } }

/* ---------- Rivalités ---------- */
.rivals { display: flex; flex-direction: column; gap: 10px; }
.rival { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who score" "bar bar" "meta meta"; gap: 6px 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.rival .who { grid-area: who; }
.rival-score { grid-area: score; font-family: var(--f-display); font-size: 22px; font-weight: 800; }
.rival-score .w { color: var(--good); } .rival-score .l { color: var(--bad); } .rival-score .sep { margin: 0 6px; color: var(--muted); }
.rival .wl { grid-area: bar; width: 100%; }
.rival-meta { grid-area: meta; font-size: 12px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.rival-games { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rg { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); }
.form { display: inline-flex; gap: 3px; margin-left: auto; }
.form i { width: 9px; height: 9px; border-radius: 3px; }
.form .f-w { background: var(--good); } .form .f-l { background: var(--bad); } .form .f-d { background: var(--faint); }
.rival-lines { display: flex; flex-direction: column; gap: 6px; }
.rival-line { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* Langue */
.lang-btn { font-family: var(--f-num); font-size: 12px; font-weight: 700; letter-spacing: .05em; }

/* ---------- Couleur des points selon le jeu ---------- */
/* Yam's : tous les points en noir */
[data-game="yams"] .dface.one i.on, [data-game="yams"] .mini-die.v1 .pip.on { background: radial-gradient(circle at 36% 30%, var(--pip-hi), var(--pip) 64%); }
/* 10 000 : le 1 et le 5 (les dés qui rapportent) en rouge */
[data-game="10000"] .dface.five i.on, [data-game="10000"] .mini-die.v5 .pip.on { background: radial-gradient(circle at 36% 30%, var(--pip-red-hi), var(--pip-red) 64%); }
.join-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.join-code .join-inline .input { width: 104px; }
.home-hero .features { margin-top: 18px; }

/* ---------- Trophées : bandeau d'accueil et page ---------- */
.trophy-strip { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line)); text-decoration: none; color: inherit; transition: transform .2s var(--ease), box-shadow .2s; }
.trophy-strip:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.ts-icons { display: flex; flex: none; }
.ts-icons span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; background: var(--surface); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, var(--surface)); margin-left: -8px; }
.ts-icons span:first-child { margin-left: 0; }
.ts-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ts-text b { font-family: var(--f-display); font-size: 18px; }
.ts-text .muted { font-size: 13px; }
.trophy-summary { display: flex; align-items: center; gap: 18px; }
.ts-big { display: flex; align-items: baseline; gap: 4px; flex: none; }
.ts-big .num { font-family: var(--f-display); font-size: 46px; font-weight: 800; color: var(--gold); line-height: 1; }
.ts-big small { color: var(--muted); font-size: 16px; }
.trophy-summary .rp-bar i { background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 70%, transparent), var(--gold)); }
.trophy-cat .card-head h2 { font-size: 22px; }
.trophies-page .trophy.todo { opacity: .8; filter: grayscale(.85); }
.trophies-page .trophy.todo .ticon { opacity: .55; }
.tprog { margin-top: 6px; }
.tprog .rp-bar { margin: 0 0 3px; height: 6px; }
.tprog .rp-bar i { background: var(--gold); }
.tlock { margin-top: 4px; font-weight: 600; }
@media (max-width: 560px) {
  .trophy-strip { padding: 12px 14px; gap: 10px; }
  .trophy-strip .btn { display: none; }
  .ts-icons span { width: 28px; height: 28px; font-size: 15px; }
}

.tready { color: var(--gold); font-weight: 700; }

/* ---------- Personnalisation : tapis ---------- */
[data-felt="bleu"]     { --felt: #1A4C7A; --felt-2: #0B2340; }
[data-felt="bordeaux"] { --felt: #6E1F33; --felt-2: #33091A; }
[data-felt="ardoise"]  { --felt: #3A434C; --felt-2: #171C21; }
[data-felt="violet"]   { --felt: #4B2E83; --felt-2: #1E1238; }
[data-felt="petrole"]  { --felt: #0F5560; --felt-2: #06272D; }
[data-felt="cognac"]   { --felt: #7A4A26; --felt-2: #3A200E; }
[data-felt="vert"]     { --felt: #12463C; --felt-2: #0A2B25; }

/* ---------- Personnalisation : dés ---------- */
[data-dice="onyx"]   { --die: #2A3236; --die-2: #14191C; --die-hi: #4A565E; --pip: #F4F1EA; --pip-hi: #FFFFFF; --pip-red: #FF6B57; --pip-red-hi: #FFA294; --pip-glow: rgba(0, 0, 0, .35); }
[data-dice="rubis"]  { --die: #C42032; --die-2: #7A0D1B; --die-hi: #EE5A69; --pip: #FFFFFF; --pip-hi: #FFFFFF; --pip-red: #FFC94D; --pip-red-hi: #FFF0BF; --pip-glow: rgba(0, 0, 0, .25); }
[data-dice="saphir"] { --die: #2F6FD6; --die-2: #163A80; --die-hi: #79A6F3; --pip: #FFFFFF; --pip-hi: #FFFFFF; --pip-red: #FFC94D; --pip-red-hi: #FFF0BF; --pip-glow: rgba(0, 0, 0, .25); }
[data-dice="jade"]   { --die: #2C9E77; --die-2: #12654A; --die-hi: #6AD7AE; --pip: #FFFFFF; --pip-hi: #FFFFFF; --pip-red: #FFC94D; --pip-red-hi: #FFF0BF; --pip-glow: rgba(0, 0, 0, .25); }
[data-dice="or"]     { --die: #E6B547; --die-2: #A87612; --die-hi: #FFE59A; --pip: #3A2A08; --pip-hi: #6B5420; --pip-red: #B3261E; --pip-red-hi: #E0574F; --pip-glow: rgba(255, 240, 200, .6); }
[data-dice="glace"]  { --die: #E3EEFC; --die-2: #BCD2F0; --die-hi: #FFFFFF; --pip: #1E3A5F; --pip-hi: #4A6C99; --pip-red: #D23B3B; --pip-red-hi: #F07A7A; --pip-glow: rgba(255, 255, 255, .8); }

/* ---------- Fenêtre « Personnaliser » ---------- */
.look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.look-opt { position: relative; display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font: inherit; color: inherit; text-align: center; transition: transform .15s var(--ease), border-color .15s, box-shadow .15s; }
.look-opt:hover { transform: translateY(-2px); }
.look-opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.look-opt[aria-checked="true"]::after { content: "✓"; position: absolute; top: 8px; right: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--accent); color: var(--accent-ink); }
.look-felt { height: 70px; border-radius: 11px; display: flex; gap: 5px; align-items: center; justify-content: center; background: radial-gradient(130% 100% at 50% 15%, var(--felt), var(--felt-2)); box-shadow: inset 0 2px 14px rgba(0, 0, 0, .4); position: relative; overflow: hidden; }
.look-felt::before { content: ""; position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 2px, transparent 2px 5px); }
.look-felt .mini-die { --s: 26px; position: relative; }
.look-opt b { font-size: 13px; font-weight: 650; }
.look-preview { border-radius: 20px; padding: 18px; display: flex; justify-content: center; gap: 10px; background: radial-gradient(130% 100% at 50% 15%, var(--felt), var(--felt-2)); box-shadow: inset 0 2px 20px rgba(0, 0, 0, .4); }
.look-preview .mini-die { --s: 42px; }
.look-preview .gcard { --cw: 44px; }
@media (max-width: 560px) { .look-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } .look-felt { height: 56px; } .look-felt .mini-die { --s: 20px; } }
[data-dice="ivoire"] { --die: #FBF7EE; --die-2: #E9E2D2; --die-hi: #FFFFFF; --pip: #16201D; --pip-hi: #4b5753; --pip-red: #C8402F; --pip-red-hi: #e7705c; --pip-glow: rgba(255, 255, 255, .75); }
body:has(.table-page) #btn-look { display: none; }
.brand-mark { background: linear-gradient(145deg, #12463C, #0A2B25) !important; }
.brand-mark i.on { background: #FBF7EE !important; }


/* =====================================================================
   v8 — navigation lisible, accueil « jeux d'abord », nouveaux jeux
   ===================================================================== */

/* ---------- Barre du haut : liens avec libellés ---------- */
.top-nav { display: flex; align-items: center; gap: 2px; margin-right: 6px; }
.top-nav .navlink { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: none; transition: background .15s, color .15s; white-space: nowrap; }
.top-nav .navlink svg { width: 18px; height: 18px; }
.top-nav .navlink:hover { background: var(--surface-2); color: var(--ink); }
.top-nav .navlink.on { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
@media (max-width: 1240px) { .top-nav .navlink[data-nav="/jour"] { display: none; } }
.topbar .brand .bname { display: inline; }
@media (max-width: 1080px) { .top-nav .navlink span { display: none; } .top-nav .navlink { padding: 8px 10px; } }

/* ---------- Barre d'onglets (téléphone) ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .top-nav { display: none !important; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--ink); background: var(--surface-2); }
  .tabbar a.on svg { color: var(--accent); }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body:has(.table-page) .tabbar { display: none; }
  body:has(.table-page) { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .toasts { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
  .topbar .brand .bname { display: inline; font-size: 18px; }
  body:has(.table-page) .topbar .brand .bname { display: none; }
}

/* ---------- Accueil : les jeux d'abord ---------- */
.home { gap: 34px; }
.home-hero.compact { padding-top: 6px; gap: 8px; }
.home-hero.compact h1 { font-size: clamp(30px, 4.6vw, 48px); }
.home-hero.compact .lede { font-size: 16px; }
.games-block { display: flex; flex-direction: column; gap: 16px; }
.games-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.games-head h2 { font-size: 24px; font-weight: 800; }
.game-filter button { padding: 8px 14px; }
.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.game-tile .tile-art { height: 104px; }
.game-tile .tile-body { padding: 12px 14px 14px; gap: 4px; }
.game-tile .tile-title { align-items: center; flex-wrap: nowrap; }
.game-tile .tile-title h3 { font-size: 19px; }
.game-tile .tile-title .rank-badge { --s: 16px; }
.game-tile .tile-meta { margin: 0; }
.game-tile .tile-actions { padding-top: 8px; justify-content: space-between; }
.game-tile .tile-actions .btn { padding: 9px 16px; }
.game-tile .tile-dice .mini-die { --s: 32px; }
.game-tile .tile-cards .gcard { --cw: 46px; }
.new-chip { position: absolute; top: 10px; left: 10px; z-index: 2; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.home-duo { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 16px; }
.compact-card { padding: 16px 18px; }
.compact-card .card-head { margin-bottom: 8px; }
.compact-card .card-head h3 { font-size: 17px; }
.soon-tiles { grid-template-columns: repeat(auto-fit, minmax(220px, 300px)); }
.home .features { border-top: 1px solid var(--line); margin-top: 0; }
@media (max-width: 1080px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .home-duo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-tile .tile-art { height: 86px; }
  .game-tile .tile-title h3 { font-size: 17px; }
  .game-tile .tile-meta { font-size: 11px; }
  .game-tile .tile-actions .btn { padding: 8px 12px; font-size: 14px; flex: 1; }
  .game-tile .tile-actions .link { display: none; }
  .game-tile .tile-dice .mini-die { --s: 24px; }
  .game-tile .tile-cards .gcard { --cw: 38px; }
  .games-head { flex-direction: row; align-items: center; flex-wrap: nowrap; }
  .games-head h2 { font-size: 19px; white-space: nowrap; }
  .game-filter { padding: 3px; flex-wrap: nowrap; flex: none; }
  .game-filter button { white-space: nowrap; }
  .games-head h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .game-filter button { padding: 6px 10px; font-size: 13px; }
  .home-hero.compact { text-align: center; padding-top: 0; gap: 6px; }
  .home-hero.compact h1 { font-size: 29px; }
  .home-hero.compact .lede { font-size: 14px; }
  .home.page { gap: 18px; padding-top: 14px; }
}
@media (max-width: 380px) { .games-head h2 { font-size: 17px; } .game-filter button { padding: 6px 8px; } }

/* ---------- Choix du mode de jeu ---------- */
.mode-opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: transform .15s var(--ease), border-color .15s, background .15s; }
.mode-opt:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface-2)); }
.mode-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.mode-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mode-txt b { font-size: 16px; }
.mode-txt small { color: var(--muted); font-size: 13px; }
.mode-go { font-size: 26px; color: var(--muted); line-height: 1; }

/* ---------- Crapette ---------- */
.crap-zone { color: color-mix(in srgb, var(--felt-ink) 65%, transparent); margin: 10px 0 6px; text-align: center; }
.crap-found { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; --cw: 50px; }
.cslot { border-radius: 8px; transition: box-shadow .15s; }
.found-empty { display: inline-grid !important; place-items: center; font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--felt-ink) 55%, transparent); }
.crap-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; --cw: 54px; }
.ccol { display: flex; flex-direction: column; align-items: center; min-height: 92px; padding: 6px 2px; border-radius: 12px; background: rgba(0, 0, 0, .14); transition: box-shadow .15s, background .15s; }
.ccol .gcard + .gcard { margin-top: calc(var(--cw) * -1.05); }
.target { box-shadow: 0 0 0 2px var(--good), 0 0 18px color-mix(in srgb, var(--good) 45%, transparent) !important; cursor: pointer; }
.ccol.target { background: color-mix(in srgb, var(--good) 14%, rgba(0, 0, 0, .14)); }
.gcard.must { box-shadow: 0 0 0 3px var(--gold), 0 4px 10px rgba(0, 0, 0, .3); }
.crap-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-top: 14px; }
.cplayer { padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, .16); border: 1.5px solid transparent; }
.cplayer.active { border-color: var(--accent); }
.cplayer.penalty { opacity: .75; }
.cp-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; margin-bottom: 6px; }
.cp-name small { margin-left: auto; font-family: var(--f-num); color: color-mix(in srgb, var(--felt-ink) 75%, transparent); }
.cp-cards { display: flex; gap: 10px; align-items: flex-end; --cw: 48px; }
.cp-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; border-radius: 8px; }
.cp-slot small { font-size: 10.5px; color: color-mix(in srgb, var(--felt-ink) 70%, transparent); white-space: nowrap; }
.cp-slot.drawn { margin-left: auto; }
.gcard.drawn-card { animation: deal .3s var(--ease); }
.btn.crap-btn { background: var(--bad); color: #fff; animation: pop .3s var(--ease); box-shadow: 0 8px 24px color-mix(in srgb, var(--bad) 40%, transparent); }
@media (max-width: 560px) {
  .crap-cols { --cw: 44px; gap: 5px; }
  .crap-found { --cw: 40px; gap: 5px; }
  .cp-cards { --cw: 40px; }
  .crap-players { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Belote ---------- */
.belote-hand { --cw: 82px; }
.gcard.turned { --cw: 66px; animation: deal .35s var(--ease); }
.gcard.hinted { box-shadow: 0 0 0 2px var(--sky), 0 4px 10px rgba(0, 0, 0, .28); }
.tslot.partner .tname { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.belote-say { position: absolute; transform: translateY(-34px); padding: 4px 10px; border-radius: 999px; background: var(--gold); color: #1E1503; font-size: 12px; font-weight: 800; animation: pop .3s var(--ease); white-space: nowrap; }
.tname { position: relative; }
.turn-pts .big.red { color: #FF8C7A; }
.team-scores { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.team-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.team-row.us { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.team-row .tn { font-weight: 800; font-family: var(--f-display); }
.team-row .tp { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row b { font-size: 20px; }

/* ---------- 421 ---------- */
.q-round { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.q-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 110px); align-items: center; gap: 10px; padding: 7px 10px; border-radius: 12px; background: rgba(0, 0, 0, .14); border: 1.5px solid transparent; }
.q-row.cur { border-color: var(--accent); }
.q-row.best { background: color-mix(in srgb, var(--good) 18%, rgba(0, 0, 0, .14)); }
.q-row.worst { background: color-mix(in srgb, var(--bad) 20%, rgba(0, 0, 0, .14)); }
.q-name { font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-dice { display: flex; gap: 4px; }
.q-dice .mini-die { --s: 22px; }
.q-combo { font-family: var(--f-num); font-size: 13px; font-weight: 700; text-align: right; }
.q-combos td:last-child { color: var(--accent); }

/* v8 : finitions mobiles des nouvelles tables */
.crap-found .found-empty { font-size: 11px; overflow: hidden; text-align: center; }
@media (max-width: 560px) {
  [data-game="421"] .pcard .pscore, [data-game="crapette"] .pcard .pscore { white-space: nowrap; }
}
@media (max-width: 560px) {
  [data-game="belote"] .tslot, [data-game="belote"] .tcard .gcard { --cw: 44px; }
  [data-game="belote"] .trick-table { padding-top: 4px; gap: 4px; }
  [data-game="belote"] .tcenter .gcard { --cw: 48px; }
}

/* Crapette : table plus grande */
[data-game="crapette"] .table-grid { grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); }
[data-game="crapette"] .crap-found { --cw: 62px; gap: 10px; }
[data-game="crapette"] .crap-cols { --cw: 70px; gap: 10px; }
[data-game="crapette"] .ccol { min-height: 124px; padding: 8px 4px; }
[data-game="crapette"] .cp-cards { --cw: 60px; gap: 12px; }
[data-game="crapette"] .cp-slot small { font-size: 11.5px; }
[data-game="crapette"] .crap-zone { margin: 14px 0 8px; }
@media (max-width: 980px) { [data-game="crapette"] .table-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  [data-game="crapette"] .crap-found { --cw: 50px; gap: 6px; }
  [data-game="crapette"] .crap-cols { --cw: 58px; gap: 5px; }
  [data-game="crapette"] .ccol { min-height: 100px; padding: 6px 2px; }
  [data-game="crapette"] .cp-cards { --cw: 50px; }
  [data-game="crapette"] .felt { padding-inline: 10px; }
}
[data-game="crapette"] .side .hist td:first-child { white-space: nowrap; }

/* À qui sont les dés ? Et bandeau « À toi de jouer ! » */
.felt { position: relative; }
.dice-owner { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 -4px; font-size: 14px; font-weight: 650; color: color-mix(in srgb, var(--felt-ink) 85%, transparent); }
.dice-owner[hidden] { display: none; }
.felt.theirs .drow { opacity: .82; filter: saturate(.85); }
.turn-flash { position: absolute; left: 50%; top: 50%; z-index: 40; transform: translate(-50%, -50%); padding: 14px 26px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-family: var(--f-display); font-weight: 800; font-size: clamp(20px, 4vw, 30px); letter-spacing: -.02em; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); pointer-events: none; animation: turnflash 1.9s var(--ease) both; white-space: nowrap; }
@keyframes turnflash { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -56%) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .turn-flash { animation-duration: 1.9s; animation-name: none; } }

/* Crapette : glisser-déposer */
[data-game="crapette"] .gcard.draggable { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.gcard.dragging { opacity: .28; }
.crap-ghost { position: fixed; z-index: 200; pointer-events: none; display: flex; flex-direction: column; align-items: center; transform-origin: 50% 20%; filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .45)); }
.crap-ghost .gcard { margin: 0; }
.crap-ghost .gcard + .gcard { margin-top: calc(var(--cw) * -1.05); }
.crap-ghost .gcard.dragging, .crap-ghost .gcard.selected { opacity: 1; transform: none; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
.drop-hover { box-shadow: 0 0 0 3px var(--good), 0 0 26px color-mix(in srgb, var(--good) 55%, transparent) !important; background: color-mix(in srgb, var(--good) 22%, rgba(0, 0, 0, .14)) !important; }

/* ---------- Grand écran (jeux de cartes) ---------- */
.felt-fs { position: absolute; right: 12px; bottom: 12px; z-index: 6; width: 38px; height: 38px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--felt-ink) 22%, transparent); background: rgba(0, 0, 0, .22); color: color-mix(in srgb, var(--felt-ink) 85%, transparent); display: grid; place-items: center; cursor: pointer; transition: background .15s, transform .15s var(--ease), color .15s; }
.felt-fs svg { width: 19px; height: 19px; }
.felt-fs:hover { background: rgba(0, 0, 0, .38); color: var(--felt-ink); transform: scale(1.06); }
body.table-focus .topbar, body.table-focus .tabbar { display: none !important; }
body.table-focus { padding-bottom: 0 !important; }
body.table-focus .table-page.wrap { max-width: none; padding-inline: clamp(8px, 1.6vw, 24px); }
body.table-focus .table-page { padding-top: 10px; }
body.table-focus .table-grid { grid-template-columns: minmax(0, 1fr) !important; }
body.table-focus .table-grid > .side { display: none !important; }
body.table-focus .felt { padding-bottom: 26px; }
body.table-focus .kbd-hint { display: none; }
/* cartes plus grandes */
body.table-focus .tslot, body.table-focus .tcard .gcard { --cw: clamp(56px, 4.6vw, 76px); }
body.table-focus .trick-table { padding-top: 0; gap: 4px 8px; }
body.table-focus [data-game]:not([data-game="crapette"]) .felt.cards .felt-top { margin-bottom: -18px; }
@media (min-width: 761px) { body.table-focus .hand { --cw: clamp(74px, 6.2vw, 100px); } }
/* Crapette en grand écran : la taille des cartes dépend aussi de la hauteur, pour que tout tienne sans défiler */
body.table-focus [data-game="crapette"] { --cc: min(7.2vw, calc((100vh - 450px) / 4.2), 130px); }
@supports (height: 100dvh) { body.table-focus [data-game="crapette"] { --cc: min(7.2vw, calc((100dvh - 450px) / 4.2), 130px); } }
@media (max-width: 760px) {
  body.table-focus [data-game="crapette"] { --cc: min(15vw, calc((100vh - 450px) / 4.2)); }
  @supports (height: 100dvh) { body.table-focus [data-game="crapette"] { --cc: min(15vw, calc((100dvh - 450px) / 4.2)); } }
}
body.table-focus [data-game="crapette"] .crap-found { --cw: calc(var(--cc) * .82); gap: clamp(6px, 1vw, 14px); }
body.table-focus [data-game="crapette"] .crap-cols { --cw: var(--cc); gap: clamp(5px, 1vw, 16px); }
body.table-focus [data-game="crapette"] .ccol { min-height: calc(var(--cc) * 1.9); }
body.table-focus [data-game="crapette"] .cp-cards { --cw: calc(var(--cc) * .78); }
body.table-focus [data-game="crapette"] .crap-zone { margin: 8px 0 6px; }
body.table-focus [data-game="crapette"] .crap-players { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 10px; }
body.table-focus [data-game="crapette"] .felt { padding-top: 16px; }
/* le bouton « Retourner une carte » reste toujours accessible en bas de l'écran */
body.table-focus .table-page .controls { position: sticky; bottom: max(8px, env(safe-area-inset-bottom, 0px)); z-index: 25; }
body.table-focus .table-page .controls .btn { box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
@media (max-width: 560px) { .felt-fs { right: 8px; bottom: 8px; width: 34px; height: 34px; } }

/* Crapette : cartes restantes de chacun, en haut à droite du tapis */
.crap-counts { display: flex; gap: 14px; align-items: flex-end; justify-content: flex-end; flex-wrap: wrap; max-width: 52vw; }
.crap-counts .cc { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; opacity: .78; }
.crap-counts .cc b { font-family: var(--f-display); font-weight: 800; line-height: 1; letter-spacing: -.03em; font-size: clamp(24px, 3.4vw, 34px); font-variant-numeric: tabular-nums; }
.crap-counts .cc span { font-size: 12px; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: color-mix(in srgb, var(--felt-ink) 72%, transparent); }
.crap-counts .cc.me { opacity: 1; }
.crap-counts .cc.me b { font-size: clamp(34px, 5.4vw, 52px); }
.crap-counts .cc.cur span { color: var(--c); font-weight: 700; }
.crap-counts .cc.cur span::before { content: "● "; }
.crap-counts.many .cc b { font-size: clamp(20px, 2.6vw, 28px); }
.crap-counts.many .cc.me b { font-size: clamp(30px, 4.4vw, 44px); }
@media (max-width: 560px) { .crap-counts { gap: 10px; max-width: 58vw; } }
body.table-focus [data-game="crapette"] .players-bar { display: none; }
/* téléphone en grand écran : les joueurs côte à côte et des cartes un peu plus grandes */
@media (max-width: 760px) {
  body.table-focus [data-game="crapette"] { --cc: min(15vw, calc((100vh - 330px) / 3.5)); }
  @supports (height: 100dvh) { body.table-focus [data-game="crapette"] { --cc: min(15vw, calc((100dvh - 330px) / 3.5)); } }
  body.table-focus [data-game="crapette"] .crap-players { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
  body.table-focus [data-game="crapette"] .cplayer { padding: 6px 7px; }
  body.table-focus [data-game="crapette"] .cp-cards { gap: 6px; }
  body.table-focus [data-game="crapette"] .cp-slot small { font-size: 10px; }
  body.table-focus .table-page .subline { display: none; }
}

/* ---------- Atouts illustrés (style tarot français ancien) ---------- */
.gcard.trump.tn { background: #FBF6E9; color: #1D1A17; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .25); }
.gcard.tn .tcart { position: absolute; left: 5%; right: 5%; height: 17%; display: flex; align-items: center; gap: 4%; }
.gcard.tn .tcart.top { top: 3.5%; }
.gcard.tn .tcart.bot { bottom: 3.5%; transform: rotate(180deg); }
.gcard.tn .tcart b { flex: none; display: grid; place-items: center; height: 100%; min-width: 30%; padding: 0 3%; border: max(1px, calc(var(--w) * .014)) solid #1D1A17; border-radius: calc(var(--w) * .07); background: #fff;
  font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: calc(var(--w) * .2); line-height: 1; letter-spacing: -.04em; }
.gcard.tn .tcart i { flex: 1; align-self: stretch; margin: 8% 0; border-radius: calc(var(--w) * .03); border: max(1px, calc(var(--w) * .01)) solid rgba(29, 26, 23, .55);
  background: repeating-linear-gradient(45deg, rgba(29, 26, 23, .45) 0 1px, transparent 1px 3px), repeating-linear-gradient(-45deg, rgba(29, 26, 23, .35) 0 1px, transparent 1px 3px), #F1EAD8; }
.gcard.tn .tscene { position: absolute; left: 6%; right: 6%; top: 22.5%; bottom: 22.5%; border: max(1px, calc(var(--w) * .012)) solid #1D1A17; border-radius: calc(var(--w) * .03); overflow: hidden; background: #9BD3D6; }
.gcard.tn .tscene svg { display: block; width: 100%; height: 100%; }
/* petites cartes : un seul numéro par cartouche, plus lisible */
.gcard.tn.small .tcart b.r, .meld-cards .gcard.tn .tcart b.r, .mini-row .gcard.tn .tcart b.r { display: none; }
.gcard.excuse.tn { background: #FBF6E9; color: #1D1A17; }
.gcard.excuse.tn .tcart b { color: #8A5A00; font-size: calc(var(--w) * .13); }

/* ---------- Yam's : les dés restent visibles pendant qu'on fait défiler la feuille de marque ---------- */
.play-head { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 961px) {
  /* ordinateur : la colonne des dés reste en place, la feuille (à droite) défile normalement */
  [data-game="yams"] .table-grid > .side { position: static; }
  [data-game="yams"] .table-grid > .play { position: sticky; top: 76px; }
}
@media (max-width: 960px) {
  /* téléphone / tablette : un bandeau collé en haut avec les dés et le bouton, la feuille passe dessous */
  [data-game="yams"] .play-head { position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 20; order: 1; gap: 8px;
    margin-inline: -16px; padding: 6px 16px 10px; background: var(--bg); box-shadow: 0 10px 18px -14px rgba(0, 0, 0, .45); }
  body.table-focus [data-game="yams"] .play-head { top: env(safe-area-inset-top, 0px); }
  [data-game="yams"] .play-head .felt { padding: 12px 14px 10px; border-radius: 22px; }
  [data-game="yams"] .play-head .turn-who .who { font-size: 20px; }
  [data-game="yams"] .play-head .controls .btn.lg { padding-block: 12px; }
}

/* Yam's : dés nécessaires pour la prime, sous chaque case du haut */
.ysheet th.cat .bonus-need { display: block; margin-top: 2px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--accent); }
.ysheet th.cat .bonus-need.easy { color: var(--good); }
.ysheet th.cat .bonus-need.hard { color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
.input.locked { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* Partie rapide : choix du nombre de joueurs */
.size-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.size-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px 8px 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font: inherit; color: inherit; transition: transform .15s var(--ease), border-color .15s, background .15s; }
.size-opt b { font-family: var(--f-display); font-size: 34px; line-height: 1; font-weight: 800; }
.size-opt span { font-size: 13px; color: var(--muted); }
.size-opt small { margin-top: 4px; font-size: 11px; font-weight: 700; color: var(--good); }
.size-opt:hover, .size-opt.on { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); transform: translateY(-1px); }

/* Bilan entre joueurs, au-dessus du tapis */
.h2h-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.h2h-bar[hidden] { display: none; }
.h2h-t { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.h2h-item { display: inline-flex; align-items: baseline; gap: 2px; padding: 4px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.h2h-item .num { font-family: var(--f-num); font-weight: 800; }
.h2h-item.lead { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.h2h-item.lead .num { color: var(--good); }
.h2h-item.behind .num { color: var(--bad); }
.h2h-item small { color: var(--muted); }
body.table-focus [data-game="crapette"] .h2h-bar { display: none; }

/* ======================= v9 ======================= */
/* Accueil : missions, Yam's du jour, trophées */
.home-trio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1080px) { .home-trio { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .home-trio > .side-stack { grid-column: 1 / -1; } }
@media (max-width: 760px) { .home-trio { grid-template-columns: minmax(0, 1fr); } }
.game-tile.featured { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }
.new-chip.day-chip { background: var(--gold); color: #2A1E00; }
[data-game="president"] { --accent: #C2185B; --accent-ink: #fff; }
[data-game="solitaire"] { --accent: #2E7D5B; --accent-ink: #fff; }
.tile[data-game="president"] { --accent: #C2185B; }
.tile[data-game="solitaire"] { --accent: #2E7D5B; }

/* Missions du jour */
.missions-card { display: flex; flex-direction: column; gap: 10px; }
.missions-card .card-head { margin-bottom: 0; }
.missions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.missions li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.missions li .grow { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.missions li .rp-bar { height: 5px; }
.missions li small { color: var(--muted); font-weight: 700; }
.mcheck { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; border: 2px solid var(--line-2); color: #fff; }
.missions li.done .mcheck, .mission-done .mcheck { background: var(--good); border-color: var(--good); }
.missions li.done > .grow > span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.missions-card.perfect { box-shadow: 0 0 0 2px var(--gold), var(--shadow-sm); }
.mfoot { font-size: 12px; margin: 0; }
.day-streak { display: inline-flex; align-items: baseline; gap: 2px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.day-streak.lit { background: color-mix(in srgb, #FF7A1A 16%, var(--surface-2)); color: var(--ink); }
.new-missions { display: flex; flex-direction: column; gap: 6px; }
.mission-done { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--good) 10%, var(--surface-2)); font-size: 14px; animation: pop .35s var(--ease); }

/* Trophées : paliers */
.trophy-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 760px) { .trophy-top { grid-template-columns: minmax(0, 1fr); } }
.tier-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tier-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.tier-card .tc-head { display: flex; align-items: center; gap: 12px; }
.tier-card .tc-head .grow { display: flex; flex-direction: column; min-width: 0; }
.tier-card .tc-head small { color: var(--muted); font-size: 12px; }
.tier-card .ticon { font-size: 26px; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--surface-2); }
.tier-card.lvl-0 .ticon { filter: grayscale(1); opacity: .6; }
.tier-card .tc-foot { color: var(--muted); font-size: 12px; }
.tier-card .tc-foot b { color: var(--ink); }
.medals { display: flex; gap: 4px; flex: none; }
.md { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.md1.on { background: radial-gradient(circle at 35% 30%, #F2B98A, #C9814F 70%); box-shadow: none; }
.md2.on { background: radial-gradient(circle at 35% 30%, #F3F6F7, #9FB0B8 70%); box-shadow: none; }
.md3.on { background: radial-gradient(circle at 35% 30%, #FFF0B8, #E9B73E 70%); box-shadow: none; }
.trophy.tier-1 .ticon { box-shadow: 0 0 0 2px #C9814F; }
.trophy.tier-2 .ticon { box-shadow: 0 0 0 2px #9FB0B8; }
.trophy.tier-3 .ticon { box-shadow: 0 0 0 2px #E9B73E; }
.exploit-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; align-items: start; }
.exploit-sections .trophy-cat { margin: 0; }

/* Président */
.pres-center { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 8px 0; }
.pres-cards { display: flex; justify-content: center; --cw: 78px; }
.pres-cards .gcard { animation: deal .3s var(--ease); box-shadow: 0 10px 22px rgba(0, 0, 0, .35); }
.pres-cards .gcard + .gcard { margin-left: calc(var(--cw) * -.45); }
.pres-cards.small { --cw: 52px; }
.pres-cards.fading { opacity: .45; transition: opacity .4s; }
.pres-by { font-weight: 700; font-size: 15px; }
.pres-empty { color: color-mix(in srgb, var(--felt-ink) 75%, transparent); max-width: 36ch; }
.pres-passed { font-size: 13px; color: color-mix(in srgb, var(--felt-ink) 70%, transparent) !important; }
.pres-order { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: min(320px, 90%); }
.pres-order li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .18); }
.pres-order li span { margin-left: auto; font-size: 13px; opacity: .85; }
.pres-order li em { font-style: normal; font-weight: 800; min-width: 2.5ch; text-align: right; }
.pres-order li.role-president { background: color-mix(in srgb, var(--gold) 28%, rgba(0, 0, 0, .18)); }
.pres-order li.role-trou { background: color-mix(in srgb, var(--bad) 22%, rgba(0, 0, 0, .18)); }
@media (max-width: 560px) { .pres-cards { --cw: 60px; } .pres-center { min-height: 150px; } }

/* Solitaire */
[data-game="solitaire"] .table-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 280px); }
.sol-top, .sol-cols { --cw: min(88px, calc((100vw - 380px) / 8)); }
@media (max-width: 960px) {
  [data-game="solitaire"] .table-grid { grid-template-columns: minmax(0, 1fr); }
  .sol-top, .sol-cols { --cw: calc((100vw - 52px) / 7.7); }
}
.sol-top { display: flex; align-items: flex-start; gap: calc(var(--cw) * .14); margin-bottom: 14px; }
.sol-gap { flex: 1; }
.sol-stock { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.sol-stock small { position: absolute; bottom: -2px; right: -4px; font-size: 11px; font-weight: 800; background: rgba(0, 0, 0, .5); color: #fff; border-radius: 999px; padding: 1px 6px; }
.sol-stock .recycle { display: grid; place-items: center; font-size: calc(var(--cw) * .4); color: color-mix(in srgb, var(--felt-ink) 60%, transparent); }
.sol-waste { display: flex; width: calc(var(--cw) * 1.7); }
.sol-waste .gcard + .gcard { margin-left: calc(var(--cw) * -.72); }
.sol-found { border-radius: 8px; }
.sol-found .found-empty { display: grid !important; place-items: center; font-size: calc(var(--cw) * .36); color: color-mix(in srgb, var(--felt-ink) 45%, transparent); }
.sol-found .found-empty.red { color: color-mix(in srgb, #E2574C 55%, transparent); }
.sol-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: calc(var(--cw) * .1); align-items: start; }
.sol-col { display: flex; flex-direction: column; align-items: center; min-height: calc(var(--cw) * 1.5); padding-bottom: 8px; border-radius: 10px; transition: background .15s; }
.sol-col .gcard + .gcard { margin-top: calc(var(--cw) * -1.06); }
.sol-col .gcard.down + .gcard { margin-top: calc(var(--cw) * -1.18); }
.sol-col .tempty { display: grid; place-items: center; font-weight: 800; color: color-mix(in srgb, var(--felt-ink) 35%, transparent); }
.sol-col.target { background: color-mix(in srgb, var(--good) 14%, transparent); }
.gcard.down .pback { opacity: .95; }
[data-game="solitaire"] .gcard.draggable { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.sol-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sol-stats div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.sol-stats b { font-size: 22px; font-family: var(--f-display); }
.sol-stats span { font-size: 12px; color: var(--muted); }
.sol-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.sol-bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
body.table-focus .sol-top, body.table-focus .sol-cols { --cw: min(118px, calc((100vw - 60px) / 8.2)); }
[data-game="solitaire"] .players-bar { display: none; }
/* Belote / Tarot sur téléphone : table des plis plus compacte pour voir sa main sans défiler */
@media (max-width: 560px) {
  [data-game="belote"] .tslot, [data-game="belote"] .tcard .gcard, [data-game="tarot"] .tslot, [data-game="tarot"] .tcard .gcard { --cw: 40px; }
  [data-game="belote"] .trick-table, [data-game="tarot"] .trick-table { padding: 0; gap: 2px 4px; }
  [data-game="belote"] .tslot, [data-game="tarot"] .tslot { gap: 3px; }
  [data-game="belote"] .tslot .tname, [data-game="tarot"] .tslot .tname { font-size: 12px; }
  [data-game="belote"] .tcenter .gcard, [data-game="tarot"] .tcenter .gcard { --cw: 44px; }
  [data-game="belote"] .tcenter p, [data-game="tarot"] .tcenter p { margin: 2px 0; font-size: 12px; }
  [data-game="belote"] .felt, [data-game="tarot"] .felt { padding-top: 14px; padding-bottom: 12px; }
}
@media (max-width: 560px) {
  [data-game="belote"] .players-bar, [data-game="tarot"] .players-bar { display: none; }
  [data-game="belote"] .trick-table, [data-game="tarot"] .trick-table { margin-top: -8px; }
}

/* Yam's : cases du haut par rapport à 3 dés (vert au-dessus, rouge en dessous, gris pile) et aide pour la prime */
.ysheet .ycell.filled.up-good { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); font-weight: 800; }
.ysheet .ycell.filled.up-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.ysheet .bonus-note { display: block; width: max-content; max-width: 100%; margin-top: 3px; padding: 2px 8px; border-radius: 999px; font-family: var(--f-body); font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ysheet .bonus-note.ok { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.ysheet .bonus-note.lost { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* ======================= v10 : Cache-cache et Banco ======================= */
[data-game="cachecache"] { --accent: #3F6FD8; --accent-ink: #fff; }
[data-game="banco"] { --accent: #9C3FB8; --accent-ink: #fff; }
.tile[data-game="cachecache"] { --accent: #3F6FD8; }
.tile[data-game="banco"] { --accent: #9C3FB8; }

/* Cartes maison : même ivoire que les cartes classiques, chiffres en couleur */
.ncard { color: var(--tone, #16201D); }
.ncard .corner { font-size: calc(var(--w) * .19); }
.ncard .nmid { position: absolute; inset: 19% 14%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%;
  border-radius: calc(var(--w) * .12); background: color-mix(in srgb, var(--tone, #16201D) 13%, transparent); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--tone, #16201D) 38%, transparent); }
.ncard .nmid b { font-size: calc(var(--w) * .42); font-weight: 800; letter-spacing: -.05em; line-height: 1; }
.ncard .nmid small { font-family: var(--f-body); font-size: calc(var(--w) * .115); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.ncard.back { color: inherit; }
.ncard.cc-neg { --tone: #3949AB; }
.ncard.cc-zero { --tone: #0E7FA0; }
.ncard.cc-low { --tone: #23885A; }
.ncard.cc-mid { --tone: #B57800; }
.ncard.cc-high { --tone: #C8402F; }
.bcard.bn { --tone: hsl(var(--hue) 62% 36%); }
.bcard.bmod { --tone: #8A5A00; background: linear-gradient(160deg, #FFFDF5 0%, #FFF1C9 55%, #F2D88A 100%); }
.bcard.bmod .nmid b { font-size: calc(var(--w) * .34); }
.bcard.bact { background: linear-gradient(160deg, #2E2645 0%, #1B1529 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 4px 10px rgba(0, 0, 0, .3); }
.bcard.bact .nmid b { font-size: calc(var(--w) * .36); }
.bcard.b-aF { --tone: #FF8A7A; }
.bcard.b-a3 { --tone: #FFD36E; }
.bcard.b-aS { --tone: #7EE0B5; }

/* Cache-cache */
.cc-grid { --cw: 64px; display: grid; grid-template-columns: repeat(4, var(--cw)); grid-auto-rows: auto; gap: calc(var(--cw) * .1); justify-content: center; }
.cc-grid .gcard { --cw: inherit; width: var(--cw); }
.cc-grid.small { --cw: 28px; gap: 3px; }
.cc-grid.small .gcard { box-shadow: 0 0 0 1px rgba(0, 0, 0, .1), 0 2px 4px rgba(0, 0, 0, .25); }
.cc-grid.small .gcard .corner { display: none; }
.cc-grid.small .ncard .nmid { inset: 10%; }
.cc-grid.small .ncard .nmid b { font-size: calc(var(--w) * .5); }
.cc-gone { width: var(--cw); border-style: dotted; opacity: .45; }
.cc-grid .gcard.fresh { animation: ccflip .45s var(--ease); }
@keyframes ccflip { 0% { transform: rotateY(90deg) scale(.96); } 100% { transform: none; } }
.cc-opps { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px 0 6px; }
.cc-opp { padding: 8px 10px 10px; border-radius: 14px; background: rgba(0, 0, 0, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: box-shadow .2s; }
.cc-opp.active { box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.cc-opp.done .cc-oname b::after { content: ' ✓'; color: var(--gold); }
.cc-oname { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 6px; max-width: 150px; }
.cc-oname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-oname .num { margin-left: auto; font-weight: 800; padding-left: 6px; }
.cc-play { display: flex; justify-content: center; align-items: center; gap: clamp(18px, 4vw, 48px); margin-top: 6px; }
.cc-mid { --cw: 70px; display: grid; grid-template-columns: auto auto; justify-items: center; align-items: end; gap: 14px 16px; padding: 4px 0; }
.cc-mid .cc-hold { grid-column: 1 / -1; }
.cc-pile { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cc-pile small { font-size: 12px; font-weight: 650; color: color-mix(in srgb, var(--felt-ink) 72%, transparent); }
.cc-hold .gcard { box-shadow: 0 0 0 3px var(--gold), 0 10px 22px rgba(0, 0, 0, .35); transition: transform .2s var(--ease), opacity .2s; }
.cc-hold .gcard.dropping { opacity: .55; transform: rotate(-8deg) translateX(-10px); }
.gcard.drop-target { box-shadow: 0 0 0 3px var(--accent), 0 0 22px color-mix(in srgb, var(--accent) 50%, transparent); }
.cc-result { grid-column: 1 / -1; max-width: 260px; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 6px; }
.cc-mine { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cc-mine .cc-grid { --cw: clamp(54px, calc((100vh - 440px) / 4.4), 82px); }
.cc-mine-head { color: color-mix(in srgb, var(--felt-ink) 80%, transparent); font-size: 14px; }
.cc-mine-head .muted { color: color-mix(in srgb, var(--felt-ink) 60%, transparent); }
[data-game="cachecache"] .players-bar { display: none; }
[data-game="cachecache"] .felt { padding-bottom: 14px; }
.cc-mine-head { display: flex; align-items: baseline; gap: 10px; }
.cc-mine .gcard.playable { cursor: pointer; }
@media (hover: hover) { .cc-mine button.gcard.playable:hover { transform: translateY(-5px); } }
.hist td.bad { color: var(--bad); font-weight: 700; }
.hist td.good { color: var(--good); font-weight: 700; }
@media (max-width: 560px) {
  .cc-grid.small { --cw: 22px; gap: 2px; }
  .cc-opps { gap: 6px; }
  .cc-opp { padding: 6px 7px 8px; }
  .cc-oname { font-size: 12px; max-width: 110px; }
  .cc-oname .avatar { display: none; }
  .cc-play { flex-direction: column; gap: 12px; }
  .cc-mid { --cw: 54px; display: flex; gap: 12px; align-items: flex-end; }
  .cc-mine .cc-grid { --cw: min(74px, calc((100vw - 80px) / 4.5)); }
}
body.table-focus .cc-mine .cc-grid { --cw: clamp(56px, calc((100vh - 330px) / 4.4), 96px); }
body.table-focus .cc-mid { --cw: 80px; }

/* Banco */
.bc-board { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 10px; }
.bc-deck { --cw: 56px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; }
.bc-deck small { font-size: 12px; font-weight: 650; color: color-mix(in srgb, var(--felt-ink) 72%, transparent); }
.bc-lanes { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.bc-lane { padding: 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, .16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); transition: box-shadow .2s, opacity .2s; }
.bc-lane.active { box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.bc-lane.st-bust { opacity: .62; }
.bc-lane.st-stay, .bc-lane.st-seven { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 55%, transparent); }
.bc-lname { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; min-width: 0; }
.bc-lname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-pts { margin-left: auto; font-weight: 800; font-size: 15px; }
.bc-chip { flex: none; font-size: 10.5px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); text-transform: uppercase; letter-spacing: .05em; }
.bc-lane.st-bust .bc-chip, .bc-chip.st-bust { background: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.bc-lane.st-stay .bc-chip, .bc-lane.st-seven .bc-chip, .bc-chip.st-stay, .bc-chip.st-seven { background: color-mix(in srgb, var(--gold) 26%, transparent); }
.bc-chip.sc { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); }
.bc-cards { --cw: 34px; display: flex; flex-wrap: wrap; gap: 4px; min-height: calc(var(--cw) * 1.4); align-items: center; }
.bc-cards .gcard.small { --cw: inherit; width: var(--cw); }
.bc-cards .gcard.small .corner { display: none; }
.bc-cards .gcard.small .nmid { inset: 9%; }
.bc-cards .gcard.small .nmid b { font-size: calc(var(--w) * .46); }
.bc-cards .gcard.small .nmid small { display: none; }
.bc-cards.big { --cw: 68px; gap: 8px; justify-content: center; min-height: calc(68px * 1.4); }
.bc-cards.fresh > .gcard:last-child, .bc-lane.fresh .bc-cards > .gcard:last-child { animation: deal .35s var(--ease); }
.bc-none { font-size: 13px; }
.gcard.dupe { box-shadow: 0 0 0 3px var(--bad), 0 4px 10px rgba(0, 0, 0, .28); }
.gcard.busted { transform: rotate(9deg); }
.gcard.held { box-shadow: 0 0 0 2px var(--good), 0 4px 10px rgba(0, 0, 0, .28); }
.bc-mine { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bc-mine-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bc-mine-head .bc-chip { color: var(--ink); background: var(--surface-3); }
.bc-mine-head .bc-chip.st-bust { color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, transparent); }
.bc-mine-head .bc-chip.sc { color: var(--good); background: color-mix(in srgb, var(--good) 16%, transparent); }
.bc-dots { display: flex; gap: 6px; }
.bc-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .2s, transform .2s var(--ease); }
.bc-dots i.on { background: var(--accent); box-shadow: none; transform: scale(1.1); }
.bc-targets { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.bc-targets small { font-weight: 600; opacity: .8; }
.btn.hinted-btn { box-shadow: 0 0 0 3px var(--sky); }
@media (max-width: 560px) {
  .bc-board { grid-template-columns: minmax(0, 1fr); }
  .bc-deck { flex-direction: row; justify-content: center; --cw: 40px; }
  .bc-cards { --cw: 28px; }
  .bc-cards.big { --cw: min(60px, calc((100vw - 70px) / 5.6)); }
}

/* ======================= v11 : Bataille navale ======================= */
[data-game="navale"] { --accent: #2F7FC1; --accent-ink: #fff; }
.tile[data-game="navale"] { --accent: #2F7FC1; }
/* tuile d'accueil : une petite grille */
.tile-navale { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(10, 11px); gap: 2px; padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, .18); transform: rotate(-4deg); box-shadow: 0 8px 18px rgba(0, 0, 0, .3); }
.tile-navale i { width: 11px; height: 11px; border-radius: 3px; background: rgba(120, 190, 240, .16); position: relative; }
.tile-navale i.sh { background: #F2EEE4; }
.tile-navale i.h1 { border-radius: 7px 2px 2px 7px; } .tile-navale i.h2 { border-radius: 2px 7px 7px 2px; }
.tile-navale i.v1x { border-radius: 7px 7px 2px 2px; } .tile-navale i.v2x { border-radius: 2px 2px 7px 7px; }
.tile-navale i.v1x, .tile-navale i.vx, .tile-navale i.v2x { background: #E2735F; }
.tile-navale i.m::after { content: ''; position: absolute; inset: 3.5px; border-radius: 50%; background: rgba(255, 255, 255, .7); }
.tile-navale i.x::after { content: ''; position: absolute; inset: 2.5px; border-radius: 50%; background: #E2574C; box-shadow: 0 0 0 2px rgba(226, 87, 76, .35); }

/* grilles */
.nv-area { display: flex; justify-content: center; align-items: flex-start; gap: clamp(16px, 3vw, 36px); margin-top: 8px; flex-wrap: wrap; }
.nv-col, .nv-place { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.nv-title { margin: 0; font-size: 13px; font-weight: 700; color: color-mix(in srgb, var(--felt-ink) 78%, transparent); }
.nv-wait { margin: 4px 0 0; font-size: 14px; color: color-mix(in srgb, var(--felt-ink) 70%, transparent); }
.nv-board { --cs: 34px; display: grid; grid-template-columns: calc(var(--cs) * .62) repeat(10, var(--cs)); grid-auto-rows: var(--cs); gap: 2px; }
.nv-board.big { --cs: clamp(26px, calc((100vh - 360px) / 11.5), 40px); }
.nv-board.small { --cs: 21px; gap: 1px; }
.nv-board.small .nv-lab { font-size: 9px; }
.nv-lab { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--felt-ink) 55%, transparent); font-family: var(--f-num); }
.nv-board > .nv-lab:nth-child(-n + 11) { align-self: end; padding-bottom: 2px; }
.nv-cell { position: relative; padding: 0; border: 0; border-radius: calc(var(--cs) * .18); background: rgba(120, 190, 240, .1); box-shadow: inset 0 0 0 1px rgba(160, 210, 245, .1); transition: background .15s, transform .12s var(--ease), box-shadow .15s; }
.nv-board.armed button.nv-cell { cursor: crosshair; }
@media (hover: hover) { .nv-board.armed button.nv-cell:hover { background: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: inset 0 0 0 2px var(--accent); } }
.nv-board.placing button.nv-cell { cursor: pointer; }
/* navires : ivoire, comme les cartes du site, bouts arrondis */
.nv-cell.ship { background: linear-gradient(160deg, #FFFFFF, #ECE5D6); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); border-radius: 3px; }
.nv-cell.ship.sh-h { margin: 3px -1px; } .nv-cell.ship.sh-v { margin: -1px 3px; }
.nv-cell.ship.sh-h.sh-first { border-radius: 999px 3px 3px 999px; margin-left: 2px; } .nv-cell.ship.sh-h.sh-last { border-radius: 3px 999px 999px 3px; margin-right: 2px; }
.nv-cell.ship.sh-v.sh-first { border-radius: 999px 999px 3px 3px; margin-top: 2px; } .nv-cell.ship.sh-v.sh-last { border-radius: 3px 3px 999px 999px; margin-bottom: 2px; }
.nv-cell.ship.sh-first.sh-last { border-radius: 999px; }
.nv-cell.ship.sel { background: linear-gradient(160deg, #FFF6D8, #F2D88A); box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0, 0, 0, .3); z-index: 1; }
.nv-cell.ship.sunk { background: linear-gradient(160deg, #8B4A42, #6B342E); box-shadow: none; }
.nv-cell.ship.ghost { background: rgba(255, 255, 255, .22); }
/* tirs : à l'eau (petit point), touché (rond rouge) */
.nv-cell.miss::after { content: ''; position: absolute; left: 50%; top: 50%; width: 22%; height: 22%; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255, 255, 255, .55); }
.nv-cell.hit::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; transform: translate(-50%, -50%); border-radius: 50%; background: #E2574C; box-shadow: 0 0 0 3px rgba(226, 87, 76, .3); }
.nv-cell.ship.sunk.hit::after { background: #FFB2A6; width: 30%; height: 30%; box-shadow: none; }
.nv-cell.water.hit { background: rgba(226, 87, 76, .16); }
.nv-cell.last { animation: nvShot .6s var(--ease); box-shadow: inset 0 0 0 2px var(--gold); z-index: 2; }
.nv-cell.hint { box-shadow: inset 0 0 0 2px var(--sky); background: color-mix(in srgb, var(--sky) 30%, transparent); }
@keyframes nvShot { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: none; } }
/* choix des navires pendant le placement */
.nv-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 460px; }
.nv-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--felt-ink) 20%, transparent); background: rgba(0, 0, 0, .16); color: var(--felt-ink); font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.nv-chip.on { background: color-mix(in srgb, var(--gold) 30%, rgba(0, 0, 0, .16)); border-color: var(--gold); }
.nv-pips { display: inline-flex; gap: 2px; }
.nv-pips i { width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: .75; }
.nv-pips i.x { background: #E2574C; opacity: 1; }
/* état des flottes (panneau de côté) */
.nv-fleet + .nv-fleet { margin-top: 12px; }
.nv-fname { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.nv-fleet ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.nv-fleet li { display: flex; align-items: center; gap: 10px; }
.nv-fleet li .nv-pips { width: 56px; color: var(--muted); }
.nv-fleet li.sunk span:last-child { text-decoration: line-through; color: var(--muted); }
.nv-fleet li.sunk .nv-pips i { background: var(--bad); opacity: .8; }
[data-game="navale"] .controls .btn { min-width: 0; }
@media (max-width: 560px) {
  .nv-area { flex-direction: column; align-items: center; gap: 14px; }
  .nv-board.big { --cs: calc((100vw - 76px) / 10.8); gap: 1.5px; }
  .nv-board.small { --cs: calc((100vw - 120px) / 14); }
  [data-game="navale"] .controls { flex-wrap: wrap; }
}
body.table-focus .nv-board.big { --cs: clamp(28px, calc((100vh - 200px) / 11.5), 52px); }
/* en partie : le logo seul suffit (le nom du jeu prend la place du nom du site) */
body:has(.table-page) .topbar .brand .bname { display: none; }
@media (max-width: 420px) { .topbar .brand .bname { font-size: 16px; letter-spacing: -.03em; } }
@media (max-width: 560px) {
  .games-head { flex-wrap: wrap; row-gap: 10px; }
  .games-head h2 { flex-basis: 100%; white-space: normal; overflow: visible; }
  .games-head .game-filter { width: 100%; display: flex; }
  .games-head .game-filter button { flex: 1; }
  [data-game="navale"] .players-bar { display: none; }
}
