/* ------------------------------------------------------------------
   La Tablée — style élégant et sobre (sombre par défaut, clair possible)
   ------------------------------------------------------------------ */
:root {
  --bg: #0d0e10;
  --bg-glow: #15140f;
  --surface: #15171a;
  --surface-2: #1c1f23;
  --line: #2a2d33;
  --line-soft: #202328;
  --text: #f0ece5;
  --muted: #a19d95;
  --faint: #6f6c66;
  --accent: #d7b77f;
  --accent-ink: #1b150a;
  --danger: #e5705f;
  --ok: #5bb38e;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -24px rgba(0,0,0,.8);

  --corail: #e2735e;
  --saphir: #4d7bd1;
  --jade: #3aa57f;
  --ambre: #e0a83a;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 16px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f2ec; --bg-glow: #efe7d8; --surface: #fffdf9; --surface-2: #f1ede6; --line: #e1dbd0; --line-soft: #ebe6dd;
    --text: #1d1b18; --muted: #6b665e; --faint: #9a958c; --accent: #9c7a3c; --accent-ink: #fffaf0;
    --shadow: 0 20px 40px -28px rgba(60,45,20,.35); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f2ec; --bg-glow: #efe7d8; --surface: #fffdf9; --surface-2: #f1ede6; --line: #e1dbd0; --line-soft: #ebe6dd;
  --text: #1d1b18; --muted: #6b665e; --faint: #9a958c; --accent: #9c7a3c; --accent-ink: #fffaf0;
  --shadow: 0 20px 40px -28px rgba(60,45,20,.35); color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(1200px 600px at 80% -10%, var(--bg-glow), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
main { outline: none; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }

/* ---------- en-tête ---------- */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line-soft); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a, .icon-btn { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 14px; border: 0; background: none; }
.nav a:hover, .nav a.on, .icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; }
.user-pill { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px !important; color: var(--text) !important; border: 1px solid var(--line) !important; }
@media (max-width: 600px) { .nav .hide-sm { display: none; } }

/* ---------- boutons & champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 500; font-size: 15px;
  transition: transform .12s ease, background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }
.btn-ghost { background: none; }
.btn-danger { color: var(--danger); background: none; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.input, select.input { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  width: 100%; transition: border-color .15s; }
.input:focus { outline: none; border-color: var(--accent); }
select.input { appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.code-input { text-transform: uppercase; letter-spacing: .4em; font-family: var(--serif); font-size: 22px; text-align: center; padding-left: calc(14px + .4em); }
.code-input::placeholder { letter-spacing: .4em; color: var(--faint); }

/* ---------- accueil ---------- */
.hero { padding: 72px 0 40px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: end; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding: 40px 0 24px; gap: 28px; } }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.02em; margin: 0; }
.hero h1 { font-size: clamp(38px, 6vw, 66px); line-height: 1.02; }
.hero h1 em { font-style: italic; color: var(--accent); font-weight: 400; }
.hero p.lead { color: var(--muted); font-size: 17px; max-width: 520px; margin: 20px 0 0; }
.join-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.join-card h2 { font-size: 20px; }
.join-card p { color: var(--muted); font-size: 14px; margin: 6px 0 16px; }
.join-row { display: flex; gap: 10px; }
.join-row .input { flex: 1; min-width: 0; }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 14px; }

.section { padding: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 28px; }
.section-head .muted { font-size: 14px; }

.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 960px) { .games { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .games { grid-template-columns: 1fr; } }
.game-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; overflow: hidden; transition: transform .2s ease, border-color .2s; box-shadow: var(--shadow); }
.game-card.live:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.game-card.featured { grid-column: span 2; flex-direction: row; }
@media (max-width: 600px) { .game-card.featured { grid-column: auto; flex-direction: column; } }
.game-art { height: 168px; display: grid; place-items: center; background: var(--surface-2); border-bottom: 1px solid var(--line-soft); color: var(--faint); position: relative; overflow: hidden; }
.featured .game-art { height: auto; min-height: 240px; flex: 1.1; border-bottom: 0; border-right: 1px solid var(--line-soft); }
@media (max-width: 600px) { .featured .game-art { min-height: 200px; border-right: 0; border-bottom: 1px solid var(--line-soft); } }
.game-art svg.art { width: 84px; height: 84px; opacity: .8; }
.game-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.game-body h3 { font-size: 24px; }
.featured .game-body { padding: 28px; justify-content: center; }
.featured .game-body h3 { font-size: 34px; }
.game-body p { margin: 0; color: var(--muted); font-size: 14.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.accent { border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.game-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; gap: 10px; }
.soon { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.game-card:not(.live) .game-body h3 { color: var(--muted); }
.ribbon { position: absolute; top: 14px; left: 14px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 600; z-index: 2; }

.fan { position: relative; width: 210px; height: 170px; }
.fan .card { position: absolute; left: 50%; top: 50%; margin: -63px 0 0 -42px; transform-origin: 50% 120%; }
.game-card.live:hover .fan .card:nth-child(1) { transform: rotate(-24deg) translateX(-6px); }
.game-card.live:hover .fan .card:nth-child(3) { transform: rotate(24deg) translateX(6px); }
.fan .card { transition: transform .35s cubic-bezier(.2,.8,.2,1); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.stat .v { font-family: var(--serif); font-size: 34px; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }

footer.foot { padding: 40px 0 56px; color: var(--faint); font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- panneaux génériques ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.panel h2 { font-size: 22px; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.page-head { padding: 44px 0 24px; }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); }
.page-head p { color: var(--muted); margin: 10px 0 0; max-width: 620px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.back:hover { color: var(--text); }

.auth { max-width: 420px; margin: 48px auto; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--surface-2); border-radius: 999px; margin-bottom: 22px; }
.tabs button { height: 38px; border: 0; background: none; border-radius: 999px; color: var(--muted); font-weight: 500; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.form { display: grid; gap: 14px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 1em; margin: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.how { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; counter-reset: how; }
.how li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; color: var(--muted); font-size: 14.5px; }
.how li::before { counter-increment: how; content: counter(how); font-family: var(--serif); color: var(--accent); font-size: 20px; line-height: 1.2; }
.how b { color: var(--text); font-weight: 500; }
.card-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- salon ---------- */
.lobby { display: grid; grid-template-columns: 380px 1fr; gap: 20px; padding: 28px 0 48px; align-items: start; }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } }
.table-code { font-family: var(--serif); font-size: 52px; letter-spacing: .14em; line-height: 1; margin: 6px 0 14px; }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.players { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.player { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.player .name { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .tag { font-size: 12px; color: var(--muted); }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif);
  font-size: 15px; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); position: relative; }
.avatar.bot { background: var(--surface); color: var(--muted); border-color: var(--line); }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--faint); border: 2px solid var(--surface-2); }
.avatar .dot.on { background: var(--ok); }
.x-btn { border: 0; background: none; color: var(--faint); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.x-btn:hover { background: var(--surface); color: var(--danger); }
.add-bot { display: flex; gap: 8px; margin-top: 12px; }
.add-bot .btn { flex: 1; }

.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 22px; }
@media (max-width: 560px) { .rules-grid { grid-template-columns: 1fr 1fr; } }
.rules-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 4px 0 10px; }
.toggles { display: grid; gap: 2px; }
.toggle { display: flex; align-items: flex-start; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.toggle:last-child { border-bottom: 0; }
.toggle .txt { flex: 1; }
.toggle .t { font-weight: 500; font-size: 15px; }
.toggle .d { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.switch { position: relative; flex: none; width: 44px; height: 26px; margin-top: 2px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.locked .toggle { cursor: default; }
.lobby-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.waiting { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

/* ---------- cartes Chroma ---------- */
.card { --w: 84px; width: var(--w); height: calc(var(--w) * 1.5); border-radius: calc(var(--w) * .12); position: relative; flex: none;
  color: #fff; user-select: none; -webkit-user-select: none;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 24px -12px rgba(0,0,0,.65), 0 0 0 1px rgba(0,0,0,.25); }
.card.face { background: linear-gradient(160deg, color-mix(in srgb, var(--suit) 82%, #fff) 0%, var(--suit) 38%, color-mix(in srgb, var(--suit) 78%, #000) 100%); }
.card.face::before { content: ""; position: absolute; inset: calc(var(--w) * .07); border-radius: calc(var(--w) * .07); border: 1px solid rgba(255,255,255,.5); pointer-events: none; }
.card.corail { --suit: var(--corail); } .card.saphir { --suit: var(--saphir); } .card.jade { --suit: var(--jade); } .card.ambre { --suit: var(--ambre); }
.card.wild { --suit: #22242a; background: linear-gradient(160deg, #34363d, #17181c); }
.card .mid { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 500;
  font-size: calc(var(--w) * .56); line-height: 1; text-shadow: 0 2px 8px rgba(0,0,0,.25); letter-spacing: -.03em; }
.card .mid svg { width: calc(var(--w) * .46); height: calc(var(--w) * .46); }
.card .cn { position: absolute; font-family: var(--serif); font-size: calc(var(--w) * .17); line-height: 1; font-weight: 600; }
.card .cn.tl { top: calc(var(--w) * .12); left: calc(var(--w) * .13); }
.card .cn.br { bottom: calc(var(--w) * .12); right: calc(var(--w) * .13); transform: rotate(180deg); }
.card .cn svg { width: calc(var(--w) * .17); height: calc(var(--w) * .17); display: block; }
.prism { width: calc(var(--w) * .58); height: calc(var(--w) * .58); border-radius: 50%; position: relative;
  background: conic-gradient(var(--corail) 0 25%, var(--saphir) 0 50%, var(--jade) 0 75%, var(--ambre) 0); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.prism::after { content: ""; position: absolute; inset: 26%; border-radius: 50%; background: #1d1e23; }
.prism b { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; font-size: calc(var(--w) * .22); color: #fff; font-weight: 600; }
.card.back { background: #131418; border: 1px solid color-mix(in srgb, var(--accent) 35%, #000);
  background-image: repeating-linear-gradient(45deg, rgba(215,183,127,.06) 0 2px, transparent 2px 9px), repeating-linear-gradient(-45deg, rgba(215,183,127,.06) 0 2px, transparent 2px 9px); }
.card.back::after { content: "T"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-style: italic;
  color: #d7b77f; font-size: calc(var(--w) * .42); }
.card.back::before { content: ""; position: absolute; inset: 22% 18%; border: 1px solid rgba(215,183,127,.45); border-radius: 50%; }
.card.sm { --w: 56px; }
.card.xs { --w: 22px; box-shadow: none; }
.card.xs::after, .card.xs::before { display: none; }

/* ---------- table de jeu ---------- */
.table { display: flex; flex-direction: column; min-height: calc(100dvh - 64px); padding-top: 12px; }
.table-bar .btn { flex: none; }
@media (max-width: 600px) { .table-bar .round-lbl { display: none; } }
.table-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.table-bar .code { font-family: var(--serif); letter-spacing: .12em; color: var(--text); font-size: 15px; }
.table-bar .sp { flex: 1; }
.opps { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 6px; scrollbar-width: none; }
.opps::-webkit-scrollbar { display: none; }
.opp { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; min-width: 0; }
.opp.turn { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.opp .nm { font-size: 13.5px; font-weight: 500; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp .ct { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.opp .badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent); }
.opp .btn-contre { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 999px; border: 0; background: var(--danger); color: #fff; font-weight: 600; animation: pulse-b 1s ease-in-out infinite; }
@keyframes pulse-b { 50% { transform: scale(1.06); } }

.board { flex: 1; display: grid; place-items: center; padding: 18px 0; }
.center { display: flex; align-items: center; gap: 28px; position: relative; }
.pile { position: relative; border: 0; background: none; padding: 0; }
.pile .card { --w: 92px; }
.pile .card:nth-child(1) { position: absolute; top: 4px; left: 4px; opacity: .6; }
.pile .card:nth-child(2) { position: absolute; top: 2px; left: 2px; opacity: .8; }
.pile.can { cursor: pointer; }
.pile.can .card:last-child { box-shadow: 0 0 0 2px var(--accent), 0 14px 30px -14px rgba(0,0,0,.8); }
.pile.can:hover .card:last-child { transform: translateY(-3px); }
.pile .count { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--faint); }
.discard { position: relative; width: 120px; height: 168px; display: grid; place-items: center; }
.discard .ring { position: absolute; inset: -10px; border-radius: 26px; border: 2px solid var(--cur); opacity: .9; transition: border-color .3s;
  box-shadow: 0 0 40px -6px var(--cur); }
.discard .card { --w: 104px; }
.discard .card.pop { animation: pop .35s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pop { from { transform: scale(.7) rotate(-8deg); opacity: .3; } }
.dir { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dir svg { width: 16px; height: 16px; }
.pending { position: absolute; top: 50%; right: -76px; transform: translateY(-50%); font-family: var(--serif); font-size: 26px; color: var(--danger); }
.status { text-align: center; margin-top: 34px; min-height: 58px; }
.status .who { font-family: var(--serif); font-size: 22px; }
.status .who.me { color: var(--accent); }
.status .last { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.timer { height: 3px; border-radius: 3px; background: var(--line-soft); overflow: hidden; width: 200px; margin: 10px auto 0; }
.timer i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.timer.low i { background: var(--danger); }

.me-zone { position: sticky; bottom: 0; padding: 10px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 26%); }
.actions { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; min-height: 44px; }
.btn-chroma { background: var(--danger); color: #fff; border-color: transparent; font-family: var(--serif); font-size: 17px; letter-spacing: .02em; }
.hand { display: flex; justify-content: safe center; overflow-x: auto; padding: 22px 16px 6px; scrollbar-width: none; }
.hand::-webkit-scrollbar { display: none; }
.hand .card { --w: 80px; margin-left: -26px; transition: transform .18s ease, opacity .2s, filter .2s; border: 0; padding: 0; font: inherit; }
.hand .card:first-child { margin-left: 0; }
.hand .card.dim { filter: saturate(.35) brightness(.62); }
.hand .card.ok { cursor: pointer; transform: translateY(-12px); }
.hand .card.ok:hover { transform: translateY(-22px); z-index: 2; }
.hand .card.drawn { box-shadow: 0 0 0 3px var(--accent), 0 10px 24px -12px rgba(0,0,0,.65); }
.hand-info { text-align: center; font-size: 12px; color: var(--faint); margin-top: 4px; }
@media (max-width: 600px) {
  .hand .card { --w: 66px; margin-left: -24px; }
  .pile .card { --w: 74px; } .discard { width: 100px; height: 140px; } .discard .card { --w: 86px; }
  .center { gap: 22px; } .pending { right: -60px; font-size: 22px; }
}

/* ---------- fenêtres ---------- */
#overlay:empty { display: none; }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(5,5,7,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 16px; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 26px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
  animation: rise .28s cubic-bezier(.2,.8,.2,1); max-height: calc(100dvh - 32px); overflow: auto; }
@keyframes rise { from { transform: translateY(16px); opacity: 0; } }
.modal h2 { font-size: 26px; }
.modal .sub { color: var(--muted); margin: 6px 0 20px; font-size: 14px; }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.color-btn { height: 74px; border-radius: 16px; border: 0; color: #fff; font-family: var(--serif); font-size: 19px; background: var(--c);
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset; transition: transform .12s; }
.color-btn:hover { transform: translateY(-2px); }
.pick-list { display: grid; gap: 8px; }
.pick-list button { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; }
.pick-list button:hover { border-color: var(--accent); }
.results { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 6px; }
.results li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.results li.win { background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.results .rk { font-family: var(--serif); width: 22px; color: var(--muted); }
.results .nm { flex: 1; font-weight: 500; }
.results .pt { font-family: var(--serif); font-size: 17px; }
.trophy { font-family: var(--serif); font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }

/* ---------- profil / classement ---------- */
.list { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.list th { text-align: left; font-weight: 500; color: var(--faint); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 0 10px 10px; }
.list td { padding: 12px 10px; border-top: 1px solid var(--line-soft); }
.list td.num, .list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.list tr.me td { color: var(--accent); }
.res-w { color: var(--ok); } .res-l { color: var(--muted); } .res-a { color: var(--danger); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; font-size: 14px; }

/* ---------- messages ---------- */
#toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 30px -10px rgba(0,0,0,.6); animation: rise .25s ease; text-align: center; }
.toast.err { background: var(--danger); color: #fff; }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
