:root {
  --felt: #1e6a40;
  --felt-d: #0f3d24;
  --gold: #e3b448;
  --gold-d: #a37a1c;
  --ink: #f4efe2;
  --muted: #b9c9bd;
  --panel: rgba(10, 30, 20, .78);
  --panel-b: rgba(255, 255, 255, .12);
  --red: #d8344a;
  --ok: #3fbf7a;
  --cw: 84px;
  --ch: calc(var(--cw) * 1.8333);
  --tw: 76px;
  --th: calc(var(--tw) * 1.8333);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; color: var(--ink); background: #0b2516; }
body {
  background:
    radial-gradient(ellipse at 50% 40%, #2b8452 0%, #1d6a40 35%, #114429 75%, #0a2b19 100%);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
body::before { /* grain du tapis */
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
h1, h2, h3, .serif { font-family: Georgia, "Times New Roman", serif; }
input, select, button { font: inherit; }
input, select {
  background: rgba(0, 0, 0, .35); color: var(--ink); border: 1px solid var(--panel-b);
  border-radius: 10px; padding: 9px 12px; outline: none;
}
input:focus, select:focus { border-color: var(--gold); }
select option { background: #123; }

.btn {
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .1); color: var(--ink);
  border-radius: 10px; padding: 9px 16px; cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s;
  font-weight: 600; white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, .18); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(180deg, #f2c75c, #c8952b); color: #2a1c05; border-color: #f7d98a; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.btn.primary:hover { background: linear-gradient(180deg, #f8d474, #d6a236); }
.btn.danger { background: linear-gradient(180deg, #e0505f, #a8202f); border-color: #f08a96; }
.btn.ghost { background: transparent; }
.btn.big { padding: 12px 22px; font-size: 17px; }
.btn.sel { background: var(--gold); color: #2a1c05; border-color: #ffe7a6; }
.row { display: flex; gap: 8px; align-items: center; }

.conn { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 100; background: #a8202f; padding: 6px 16px; border-radius: 0 0 10px 10px; font-weight: 600; }

/* ───────── Accueil ───────── */
.screen { position: fixed; inset: 0; }
#home { display: grid; place-items: center; overflow: auto; padding: 20px; }
.home-card { width: min(920px, 100%); background: var(--panel); border: 1px solid var(--panel-b); border-radius: 22px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.logo { text-align: center; margin-bottom: 14px; }
.logo h1 { margin: 6px 0 0; font-size: 54px; letter-spacing: 2px; color: var(--gold); text-shadow: 0 2px 0 #5a3e08, 0 6px 20px rgba(0,0,0,.5); }
.tagline { margin: 4px 0 0; color: var(--muted); }
.logo-cards { height: 120px; position: relative; }
.logo-cards img { width: 64px; position: absolute; left: 50%; top: 4px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.5); transform-origin: 50% 120%; }
.logo-cards img:nth-child(1) { transform: translateX(-50%) rotate(-16deg); }
.logo-cards img:nth-child(2) { transform: translateX(-50%) translateY(-6px); }
.logo-cards img:nth-child(3) { transform: translateX(-50%) rotate(16deg); }
.field { display: flex; flex-direction: column; gap: 6px; max-width: 320px; margin: 10px auto 18px; font-weight: 600; text-align: center; }
.field input { text-align: center; font-size: 18px; }
.home-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.home-box { background: rgba(255,255,255,.05); border: 1px solid var(--panel-b); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; }
.home-box h3 { margin: 0 0 4px; color: var(--gold); }
.home-box p { margin: 0 0 12px; color: var(--muted); font-size: 14px; flex: 1; }
.home-box .row > * { flex: 1; min-width: 0; }
.home-box .row > select { flex: 0 0 auto; width: auto; padding-right: 6px; }
.home-box .row > .code-input { flex: 1 1 60px; }
.code-input { text-transform: uppercase; letter-spacing: 4px; text-align: center; font-weight: 700; }
.home-foot { display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } .logo h1 { font-size: 40px; } }

/* ───────── Salon ───────── */
#lobby { overflow: auto; padding: 18px; }
.lobby-wrap { max-width: 1200px; margin: 0 auto; }
.lobby-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--panel-b); border-radius: 16px; padding: 14px 18px; }
.big-code { font-family: Georgia, serif; font-size: 42px; font-weight: 700; letter-spacing: 8px; color: var(--gold); line-height: 1; }
.share { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.share input { flex: 1; min-width: 0; }
.lobby-main { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 980px) { .lobby-main { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--panel-b); border-radius: 16px; padding: 14px; }
.panel-title { font-weight: 700; margin-bottom: 10px; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); }
.seat-list { display: flex; flex-direction: column; gap: 8px; }
.seat-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid transparent; }
.seat-row.me { border-color: var(--gold); }
.seat-row.empty { border: 1px dashed rgba(255,255,255,.25); background: transparent; }
.seat-row .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-row .btn { padding: 5px 10px; font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); font-size: 15px; }
.settings { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; margin-bottom: 14px; }
.settings select { width: 100%; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.14); font-weight: 700; letter-spacing: .3px; }
.tag.gold { background: var(--gold); color: #2a1c05; }
.tag.red { background: var(--red); }
.tag.blue { background: #3d6fd1; }

/* ───────── Table ───────── */
#game { display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: rgba(0,0,0,.35); border-bottom: 1px solid rgba(255,255,255,.08); z-index: 20; min-height: 46px; }
.tb-left { display: flex; gap: 10px; align-items: center; }
.pill { background: var(--gold); color: #2a1c05; padding: 3px 10px; border-radius: 99px; font-weight: 800; letter-spacing: 2px; cursor: pointer; }
.tb-deal { color: var(--muted); font-size: 14px; }
.tb-contract { flex: 1; text-align: center; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-contract b { color: var(--gold); }
.tb-right { display: flex; gap: 4px; }
.icon-btn { position: relative; background: transparent; border: 0; color: var(--ink); font-size: 18px; padding: 6px 9px; border-radius: 8px; cursor: pointer; display: flex; gap: 6px; align-items: center; }
.icon-btn span { font-size: 13px; font-weight: 600; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
@media (max-width: 820px) { .icon-btn span { display: none; } .tb-deal { display: none; } }
.badge { position: absolute; top: 2px; right: 2px; background: var(--red); color: #fff; font-size: 10px; font-style: normal; border-radius: 99px; padding: 1px 5px; font-weight: 800; }
.menu { position: absolute; right: 8px; top: 48px; z-index: 40; background: #13301f; border: 1px solid var(--panel-b); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; min-width: 230px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.menu button { background: transparent; border: 0; color: var(--ink); text-align: left; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: rgba(255,255,255,.1); }

.felt { position: relative; flex: 1; overflow: hidden; }
.felt-ring { position: absolute; left: 4%; right: 4%; top: 3%; bottom: 20%; border-radius: 50%; border: 2px solid rgba(255,255,255,.06); box-shadow: inset 0 0 120px rgba(0,0,0,.35); pointer-events: none; }

/* Sièges */
.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; z-index: 5; transition: left .4s, top .4s; pointer-events: none; }
.seat .plate { display: flex; align-items: center; gap: 8px; background: rgba(5, 20, 12, .82); border: 1px solid rgba(255,255,255,.14); padding: 5px 12px 5px 5px; border-radius: 99px; box-shadow: 0 6px 16px rgba(0,0,0,.35); min-width: 120px; max-width: 220px; pointer-events: auto; }
.seat .plate .info { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.seat .plate .nm { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .plate .sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.seat .plate .sub b { color: var(--ink); }
.seat.turn .plate { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 24px rgba(227,180,72,.65); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 6px rgba(227,180,72,.3); } }
.seat.dead .plate { opacity: .55; }
.seat.offline .avatar { filter: grayscale(1); opacity: .6; }
.seat .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.seat .backs { display: flex; height: 34px; }
.seat .backs img { width: 20px; margin-left: -13px; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.seat .backs img:first-child { margin-left: 0; }
.bubble { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #fffbea; color: #2a1c05; padding: 4px 12px; border-radius: 12px; font-weight: 800; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.4); font-size: 14px; animation: pop .25s ease-out; }
.bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fffbea; }
.bubble.pass { background: #ddd; color: #555; }
.seat.me .bubble { bottom: auto; top: calc(100% + 6px); }
.seat.me .bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #fffbea; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }

/* Cartes */
.card { position: absolute; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .075); }
.card img { width: 100%; height: 100%; display: block; border-radius: inherit; pointer-events: none; -webkit-user-drag: none; }
.card { box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 1px 1px rgba(0,0,0,.3); }

.hand { position: absolute; left: 0; right: 0; bottom: 0; height: var(--handH, calc(var(--ch) + 34px)); z-index: 10; }
.hand .card { bottom: 14px; transition: transform .16s ease-out, filter .2s, box-shadow .16s; transform-origin: 50% 120%; touch-action: none; }
.hand .card.playable { cursor: pointer; }
.hand .card.playable:hover, .hand .card.sel { transform: var(--rot) translateY(-22px) !important; box-shadow: 0 10px 22px rgba(0,0,0,.5); }
.hand .card.playable::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; box-shadow: 0 0 0 2px rgba(255, 230, 140, .9), 0 0 14px rgba(255, 220, 110, .55); pointer-events: none; }
.hand .card.off img { filter: brightness(.55) saturate(.6); }
.hand .card.sel::after { content: ''; position: absolute; inset: -3px; border-radius: inherit; box-shadow: 0 0 0 3px #6fd3ff, 0 0 16px rgba(111,211,255,.8); }
.hand .card.fromdog::before { content: 'chien'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; background: #6fd3ff; color: #062033; padding: 1px 6px; border-radius: 6px; font-weight: 800; z-index: 2; }
.hand .card.forbid img { filter: brightness(.55) grayscale(.5); }
.hand .card.dragging { transition: none; z-index: 50; box-shadow: 0 18px 36px rgba(0,0,0,.6); cursor: grabbing; }
.hand.deal .card { animation: dealIn .45s cubic-bezier(.2,.8,.3,1.1) backwards; }
@keyframes dealIn { from { transform: translate(var(--dx, 0), -40vh) rotate(-30deg) scale(.6); opacity: 0; } }

#center { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.dog { display: flex; gap: 6px; pointer-events: auto; }
.dog .card { position: relative; width: var(--tw); height: var(--th); animation: flip .5s backwards; }
@keyframes flip { from { transform: rotateY(90deg) scale(.8); opacity: 0; } }
.center-label { background: rgba(0,0,0,.45); padding: 4px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; }
#trickLayer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
#trickLayer .card { width: var(--tw); height: var(--th); margin-left: calc(var(--tw) / -2); margin-top: calc(var(--th) / -2); box-shadow: 0 6px 16px rgba(0,0,0,.45); }
#trickLayer .card.win { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(227,180,72,.9); z-index: 3; }

.status { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--handH, var(--ch)) + 56px); z-index: 9; background: rgba(0,0,0,.5); padding: 6px 16px; border-radius: 99px; font-weight: 600; font-size: 14px; white-space: nowrap; pointer-events: none; }
.status:empty { display: none; }
.actionbar { position: absolute; left: 2vw; right: 2vw; bottom: calc(var(--handH, var(--ch)) + 6px); z-index: 12; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; pointer-events: none; }
.actionbar > * { pointer-events: auto; }
.actionbar:empty { display: none; }
.actionbar .box { background: rgba(6, 22, 14, .9); border: 1px solid var(--gold); border-radius: 16px; padding: 10px 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: rise .25s ease-out; }
.actionbar .box .lbl { font-weight: 700; margin-right: 4px; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.call-cards { display: flex; gap: 8px; }
.call-cards img { width: 64px; border-radius: 5px; cursor: pointer; transition: transform .15s; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.call-cards img:hover { transform: translateY(-8px) scale(1.05); }
.call-cards img.mine { opacity: .6; }

/* Panneau latéral */
.side { position: absolute; right: 0; top: 46px; bottom: 0; width: min(420px, 100vw); background: rgba(8, 24, 15, .96); border-left: 1px solid var(--panel-b); z-index: 30; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0,0,0,.4); animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.side-tabs { display: flex; border-bottom: 1px solid var(--panel-b); }
.side-tabs button { flex: 1; background: transparent; border: 0; color: var(--muted); padding: 12px 6px; cursor: pointer; font-weight: 700; }
.side-tabs button.active { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); }
.side-tabs .side-close { flex: 0 0 44px; }
.side-body { flex: 1; overflow: auto; padding: 12px; }
.chat-box { display: flex; flex-direction: column; }
.chat-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; min-height: 120px; max-height: 100%; }
#lobbyChat { max-height: 260px; }
.chat-list .m { font-size: 14px; line-height: 1.35; }
.chat-list .m b { color: var(--gold); }
.chat-list .m.sys { color: var(--muted); font-style: italic; font-size: 13px; }
.chat-form { display: flex; gap: 6px; margin-top: 8px; }
.chat-form input { flex: 1; min-width: 0; }
.log-line { font-size: 13px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.05); color: #d9e4dc; }
.log-line.deal { color: var(--gold); font-weight: 700; margin-top: 6px; }

table.scores { width: 100%; border-collapse: collapse; font-size: 13px; }
table.scores th, table.scores td { padding: 5px 6px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.07); white-space: nowrap; }
table.scores th:first-child, table.scores td:first-child, table.scores .l { text-align: left; }
table.scores th { color: var(--gold); font-weight: 700; position: sticky; top: 0; background: #0d2618; }
table.scores tfoot td { font-weight: 800; border-top: 2px solid var(--gold); }
table.scores tr.me td { background: rgba(227,180,72,.12); }
.pos { color: #6fe39a; } .neg { color: #ff7f8f; }
.sec-title { font-weight: 800; color: var(--gold); margin: 14px 0 6px; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
.sec-title:first-child { margin-top: 0; }

/* Overlays */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; display: grid; place-items: center; padding: 14px; animation: fade .2s; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } }
.modal { background: linear-gradient(180deg, #16402a, #0d2a1b); border: 1px solid rgba(227,180,72,.5); border-radius: 20px; padding: 20px 22px; width: min(760px, 100%); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: zoom .25s ease-out; position: relative; }
@keyframes zoom { from { transform: scale(.94); opacity: 0; } }
.modal h2 { margin: 0 0 10px; font-size: 28px; }
.modal h2.win { color: #7ff0a8; } .modal h2.lose { color: #ff8b98; }
.modal .close { position: absolute; top: 10px; right: 12px; background: transparent; border: 0; color: var(--ink); font-size: 22px; cursor: pointer; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 10px 0; }
.res-grid .it { background: rgba(255,255,255,.06); border-radius: 10px; padding: 8px 10px; }
.res-grid .it .k { font-size: 12px; color: var(--muted); }
.res-grid .it .v { font-weight: 800; font-size: 17px; }
.mini-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.mini-cards img { width: 44px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.calc { font-family: ui-monospace, Menlo, Consolas, monospace; background: rgba(0,0,0,.3); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 8px 0; white-space: pre-wrap; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 16px 0 10px; }
.podium .p { text-align: center; width: 140px; }
.podium .p .blk { border-radius: 10px 10px 0 0; display: grid; place-items: center; font-size: 30px; font-weight: 800; font-family: Georgia, serif; box-shadow: inset 0 -6px 0 rgba(0,0,0,.2); }
.podium .p1 .blk { height: 110px; background: linear-gradient(#f6d77a, #c99a2e); color: #3a2806; }
.podium .p2 .blk { height: 80px; background: linear-gradient(#e6e9ee, #a9b0ba); color: #333; }
.podium .p3 .blk { height: 60px; background: linear-gradient(#e7b083, #b06f3e); color: #3a1d06; }
.podium .nm { font-weight: 800; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trick-view { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 10px 0; }
.trick-view .tc { text-align: center; font-size: 13px; }
.trick-view .tc img { width: 86px; border-radius: 6px; display: block; margin-bottom: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.trick-view .tc.win img { box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(227,180,72,.8); }
.rules { line-height: 1.55; font-size: 15px; }
.rules h3 { color: var(--gold); margin: 16px 0 4px; }
.rules table { border-collapse: collapse; margin: 6px 0; }
.rules td, .rules th { border: 1px solid rgba(255,255,255,.15); padding: 4px 10px; }

/* Toasts */
.toasts { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(10, 26, 17, .95); border: 1px solid var(--gold); padding: 8px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.5); animation: tin .3s ease-out; max-width: 92vw; text-align: center; }
.toast.err { border-color: var(--red); background: rgba(80, 10, 20, .95); }
.toast .mini-cards { justify-content: center; margin-top: 6px; }
.toast .mini-cards img { width: 34px; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(-12px); } }

/* Responsive : cartes plus petites sur mobile */
@media (max-width: 700px) {
  .seat .plate { min-width: 0; padding: 3px 8px 3px 3px; }
  .seat .plate .nm { font-size: 12px; max-width: 80px; }
  .seat .plate .sub { font-size: 10px; }
  .avatar { width: 26px; height: 26px; font-size: 12px; }
  .seat .backs { display: none; }
  .modal { padding: 14px; }
  .actionbar .box { padding: 7px 9px; gap: 6px; border-radius: 12px; }
  .actionbar .box .lbl { width: 100%; text-align: center; margin: 0; font-size: 14px; }
  .actionbar .box .muted.small { display: none; }
  .actionbar .btn { padding: 7px 10px; font-size: 14px; }
  .actionbar .btn.big { padding: 9px 14px; font-size: 15px; }
  .call-cards img { width: 52px; }
  .status { font-size: 12px; }
}

/* ───────── v2 : lisibilité & confort ───────── */
.zoom { position: fixed; z-index: 90; pointer-events: none; filter: drop-shadow(0 18px 40px rgba(0,0,0,.65)); animation: zin .14s ease-out; }
.zoom img { width: 100%; display: block; border-radius: 12px; background: #fff; }
.zoom .zl { text-align: center; margin-top: 6px; font-weight: 800; background: rgba(0,0,0,.65); border-radius: 99px; padding: 3px 10px; }
@keyframes zin { from { transform: scale(.85); opacity: 0; } }
#trickLayer .card { pointer-events: auto; }
#trickLayer .card .who { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); background: rgba(0,0,0,.72); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; white-space: nowrap; max-width: 140%; overflow: hidden; text-overflow: ellipsis; }
#trickLayer .card.lead { box-shadow: 0 0 0 2px rgba(255,255,255,.85), 0 0 18px rgba(255,255,255,.55); }
#trickLayer .card.lead .who { background: #fff; color: #111; }
#trickLayer .card.win .who { background: var(--gold); color: #2a1c05; }
.dog .card, .mini-cards img, .trick-view img { cursor: zoom-in; }
.toasts { top: 52px; }
.toast { font-size: 14px; padding: 6px 14px; }
.credit { position: absolute; right: 10px; top: 6px; font-size: 11px; color: rgba(255,255,255,.55); z-index: 3; pointer-events: none; }
.menu { max-height: calc(100vh - 60px); overflow: auto; }
.menu-sec { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold); padding: 8px 12px 2px; font-weight: 800; }
.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; gap: 10px; }
.menu-row span { display: flex; align-items: center; gap: 6px; }
.menu-row span button { width: 30px; height: 30px; padding: 0; text-align: center; background: rgba(255,255,255,.12); border-radius: 8px; font-size: 18px; font-weight: 800; }
.tk-row { margin: 10px 0 4px; display: flex; gap: 8px; align-items: baseline; }
.tk-row .redsuit { color: #ff8a98; }
.tk-grid { display: grid; grid-template-columns: repeat(11, 1fr); gap: 3px; }
.tk { text-align: center; font-size: 12px; font-weight: 800; padding: 4px 0; border-radius: 5px; background: rgba(255,255,255,.12); cursor: default; }
.tk.gone { opacity: .28; text-decoration: line-through; }
.tk.mine { background: var(--gold); color: #2a1c05; }
.tk.cur { background: #6fd3ff; color: #062033; }
.react-btn { position: absolute; z-index: 11; left: 10px; bottom: calc(var(--handH, var(--ch)) + 8px); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; font-size: 22px; cursor: pointer; border: 1px solid rgba(255,255,255,.15); }
.react-btn:hover { background: rgba(0,0,0,.65); }
.react-menu { position: absolute; z-index: 41; left: 10px; bottom: calc(var(--handH, var(--ch)) + 54px); background: #13301f; border: 1px solid var(--panel-b); border-radius: 14px; padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.react-menu button { background: rgba(255,255,255,.08); border: 0; color: var(--ink); border-radius: 10px; padding: 6px 9px; font-size: 18px; cursor: pointer; }
.react-menu button:hover { background: rgba(255,255,255,.2); }
.react-pop { position: absolute; z-index: 15; transform: translate(-50%, -100%); font-size: 34px; pointer-events: none; animation: reactUp 2.6s ease-out forwards; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); white-space: nowrap; }
.react-pop.txt { font-size: 15px; font-weight: 800; background: #fffbea; color: #2a1c05; padding: 5px 12px; border-radius: 14px; }
@keyframes reactUp { 0% { opacity: 0; transform: translate(-50%, -60%) scale(.6); } 12% { opacity: 1; transform: translate(-50%, -100%) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -170%); } }
.seat .plate { position: relative; }
@media (max-width: 700px) { .react-btn { width: 34px; height: 34px; font-size: 18px; left: auto; right: 8px; } .react-menu { left: auto; right: 8px; } #trickLayer .card .who { font-size: 9px; } }
.card img, .mini-cards img, .trick-view img, .zoom img, .dog img { object-fit: fill; }
.credit { max-width: 60vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .credit { max-width: 70vw; font-size: 9px; top: 3px; right: 6px; } }

/* Valeurs superposées aux jeux anciens (taille relative à la carte) */
.card, .zcard { container-type: inline-size; }
.zcard { position: relative; border-radius: 12px; overflow: hidden; }
.dog .card { position: relative; }
.ix { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; min-width: 17cqw; padding: 1.5cqw 1.6cqw 1cqw;
  background: rgba(255, 253, 246, .95); border-radius: 3.5cqw; box-shadow: 0 0.6cqw 1.8cqw rgba(0,0,0,.28); color: #16171b;
  font: 700 17cqw/0.95 Georgia, "Times New Roman", serif; letter-spacing: -0.06em; pointer-events: none; }
.ix i { font-style: normal; font-size: 0.86em; line-height: 1; margin-top: 0.4cqw; font-family: "Segoe UI Symbol", "Noto Sans Symbols2", "DejaVu Sans", sans-serif; letter-spacing: 0; }
.ix.red { color: #c3162b; }
.ix.tl { left: 2.5cqw; top: 2.5cqw; }
.ix.br { right: 2.5cqw; bottom: 2.5cqw; transform: rotate(180deg); }
