/* ═══════════════ Gin Rami — Le Salon ═══════════════ */
:root {
  --ink: #04100c;
  --felt-1: #17705a;
  --felt-2: #0e4d3d;
  --felt-3: #072a21;
  --gold-1: #fbeab5;
  --gold-2: #e0b85a;
  --gold-3: #a87a2a;
  --gold-rgb: 224, 184, 90;
  --cream: #f4ecd8;
  --muted: #9db3a8;
  --red: #b3202c;
  --black: #1b1e26;
  --panel-1: #13281f;
  --panel-2: #0a1712;
  --display: 'Playfair Display', 'Didot', 'Bodoni MT', Georgia, serif;
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 0.9, 0.24, 1);
  --bk-a: #1d2b57;
  --bk-b: #0b1330;
}
body[data-back='1'], .back-1 { --bk-a: #7a1a2c; --bk-b: #360710; }
body[data-back='2'], .back-2 { --bk-a: #11664e; --bk-b: #05241b; }
body[data-back='3'], .back-3 { --bk-a: #33333a; --bk-b: #0c0c10; }
body[data-back='4'], .back-4 { --bk-a: #f6edd6; --bk-b: #d8c494; }
body[data-back='5'], .back-5 { --bk-a: #2f8be0; --bk-b: #0d3d7c; }
.back-0 { --bk-a: #1d2b57; --bk-b: #0b1330; }

/* Tapis de jeu */
body[data-table='1'], .table-1 { --felt-1: #2470b0; --felt-2: #164a7c; --felt-3: #0a2644; }
body[data-table='2'], .table-2 { --felt-1: #9a2a3e; --felt-2: #661626; --felt-3: #330812; }
body[data-table='3'], .table-3 { --felt-1: #566070; --felt-2: #343b47; --felt-3: #171a20; }
body[data-table='4'], .table-4 { --felt-1: #6a45a4; --felt-2: #442a70; --felt-3: #20123a; }
body[data-table='5'], .table-5 { --felt-1: #a07a40; --felt-2: #6b4d24; --felt-3: #33230d; }
.table-0 { --felt-1: #17705a; --felt-2: #0e4d3d; --felt-3: #072a21; }

/* Les styles de cartes (papier, encres, costumes, cadre…) sont des variables posées par js/skins.js. */
.card {
  --robe: var(--robe-black);
  --hair: var(--hair-black);
  --robe-dark: color-mix(in srgb, var(--robe) 66%, #000);
  --trim-dark: color-mix(in srgb, var(--trim) 68%, #000);
  --skin-dark: color-mix(in srgb, var(--skin) 80%, #3a1c08);
  --hair-dark: color-mix(in srgb, var(--hair) 60%, #000);
}
.card.red { --robe: var(--robe-red); --hair: var(--hair-red); }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ink);
  color: var(--cream);
  font: 500 15px/1.5 var(--ui);
  font-variant-numeric: lining-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--gold-1); outline-offset: 3px; }
[hidden] { display: none !important; }
.spacer { flex: 1; }
h1, h2, h3, p { margin: 0; }

.screen {
  position: fixed;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s;
}
.screen:not(.active) { pointer-events: none; }
.screen.active { opacity: 1; visibility: visible; }

/* ─────────────── Éléments communs ─────────────── */
.kicker {
  font: 700 11px/1 var(--ui);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.deco-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(260px, 70%);
  margin: 14px auto;
}
.deco-rule::before, .deco-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb), 0.8));
}
.deco-rule::after { transform: scaleX(-1); }
.deco-rule i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold-2); box-shadow: 0 0 10px rgba(var(--gold-rgb), 0.8); }

.btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 0.15s var(--ease), filter 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s, opacity 0.2s;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: 0.45; }
.btn.small { min-height: 36px; padding: 6px 14px; border-radius: 11px; font-size: 13px; }
.btn.icon { padding: 6px 10px; min-width: 38px; font-size: 16px; }
.btn.gold {
  color: #2b1d05;
  background: linear-gradient(180deg, #fdf0c4 0%, var(--gold-2) 55%, #b98a32 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(120, 80, 10, 0.35), 0 8px 24px rgba(var(--gold-rgb), 0.28), 0 2px 0 #6f4f15;
}
.btn.gold:hover:not(:disabled) { filter: brightness(1.07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -2px 0 rgba(120, 80, 10, 0.35), 0 10px 34px rgba(var(--gold-rgb), 0.45), 0 2px 0 #6f4f15; }
.btn.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(var(--gold-rgb), 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}
.btn.glass:hover:not(:disabled) { border-color: var(--gold-2); background: linear-gradient(180deg, rgba(var(--gold-rgb), 0.16), rgba(var(--gold-rgb), 0.05)); }
.btn.ghost { border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(0, 0, 0, 0.25); backdrop-filter: blur(6px); }
.btn.ghost:hover:not(:disabled) { border-color: rgba(var(--gold-rgb), 0.6); }
.btn.big { width: 100%; min-height: 68px; border-radius: 18px; }
.btn.big b { font: 700 19px/1.2 var(--display); letter-spacing: 0.01em; }
.btn.big small { font-size: 12px; font-weight: 600; opacity: 0.72; letter-spacing: 0.04em; }
.link { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px; border-bottom: 1px solid transparent; }
.link:hover { color: var(--gold-1); }

.avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 18px/1 var(--display);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  background: linear-gradient(145deg, var(--a1), var(--a2));
  box-shadow: 0 0 0 2px rgba(var(--gold-rgb), 0.75), 0 0 0 3px rgba(0, 0, 0, 0.5), inset 0 2px 5px rgba(255, 255, 255, 0.4), inset 0 -7px 10px rgba(0, 0, 0, 0.35);
}
.av-0 { --a1: #e0475a; --a2: #7d1022; }
.av-1 { --a1: #4f8df5; --a2: #152a8a; }
.av-2 { --a1: #2fc79a; --a2: #0b5a45; }
.av-3 { --a1: #a66cf0; --a2: #45187f; }
.av-4 { --a1: #f5b13d; --a2: #9a4d06; }
.av-5 { --a1: #34c6d6; --a2: #0b5766; }
.av-6 { --a1: #f277b4; --a2: #8c1d57; }
.av-7 { --a1: #9aa7b8; --a2: #36404f; }
.av-ai { --a1: #3a3a44; --a2: #0b0b10; color: var(--gold-1); }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(var(--gold-rgb), 0.25);
  border-top-color: var(--gold-2);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #5b6a63; }
.dot.on { background: #48e29a; box-shadow: 0 0 8px #48e29a; }
.dot.wait { background: var(--gold-2); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* ─────────────── Accueil ─────────────── */
#home {
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden auto;
}
.backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 38%, rgba(26, 128, 100, 0.55), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 110%, rgba(var(--gold-rgb), 0.12), transparent 60%),
    linear-gradient(180deg, #051510, #020806);
}
.backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.7) 100%);
}
.rays {
  position: absolute;
  left: 50%;
  top: 36%;
  width: 180vmax;
  height: 180vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(var(--gold-rgb), 0.055) 0deg 3deg, transparent 3deg 12deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 42%);
  mask: radial-gradient(circle, #000 0%, transparent 42%);
  animation: turn 180s linear infinite;
}
@keyframes turn { to { transform: translate(-50%, -50%) rotate(1turn); } }
.card.floater {
  position: absolute;
  left: var(--x);
  top: var(--y);
  --fs: clamp(7px, 1.1vw, 13px);
  opacity: 0.5;
  filter: blur(1.2px) brightness(0.75);
  transform: rotate(var(--r));
  animation: drift 14s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -2.3s);
}
@keyframes drift {
  from { transform: translateY(-14px) rotate(calc(var(--r) - 4deg)); }
  to { transform: translateY(16px) rotate(calc(var(--r) + 5deg)); }
}

.home-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; }
.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 16px 5px 5px;
  border-radius: 999px;
  border: 1px solid rgba(var(--gold-rgb), 0.3);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  text-align: left;
  transition: border-color 0.2s;
}
.chip:hover { border-color: var(--gold-2); }
.who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { white-space: nowrap; color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; font-variant-numeric: lining-nums tabular-nums; }
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  background: #2aa876;
  color: #fff;
}
.badge.alert { background: var(--red); }
#btn-friends { flex-direction: row; }

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 0;
  animation: rise 1s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.crest {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  border: 1px solid rgba(var(--gold-rgb), 0.6);
  box-shadow: 0 0 0 5px rgba(var(--gold-rgb), 0.08), 0 0 40px rgba(var(--gold-rgb), 0.3), inset 0 0 18px rgba(var(--gold-rgb), 0.2);
}
.crest svg { width: 28px; height: 28px; fill: var(--gold-2); filter: drop-shadow(0 0 6px rgba(var(--gold-rgb), 0.8)); }
.logo {
  margin-top: 10px;
  font: 900 clamp(56px, 13.5vw, 136px) / 0.95 var(--display);
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, #b98a32 0%, #fbeab5 22%, #e0b85a 40%, #fff7dc 50%, #e0b85a 60%, #a87a2a 80%, #fbeab5 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.6));
  animation: foil 7s ease-in-out infinite alternate;
}
.logo span:last-child { font-style: italic; font-weight: 500; }
@keyframes foil { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.menu { display: grid; gap: 12px; width: min(400px, 100%); margin: 18px 0 8px; }

.stats {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: clamp(18px, 6vw, 56px);
  padding-top: 10px;
}
.stat { text-align: center; line-height: 1.2; }
.stat b { display: block; font: 700 24px var(--display); color: var(--gold-1); }
.stat small { font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* ─────────────── Fenêtres ─────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(1, 8, 6, 0.7);
  backdrop-filter: blur(8px);
  animation: fade 0.25s ease both;
}
.modal.out { opacity: 0; transition: opacity 0.2s; }
@keyframes fade { from { opacity: 0; } }
.panel, .result-panel {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: hidden auto;
  padding: 30px 26px 24px;
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(var(--gold-rgb), 0.13), transparent 70%),
    linear-gradient(180deg, var(--panel-1), var(--panel-2));
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), inset 0 0 0 5px var(--panel-2), inset 0 0 0 6px rgba(var(--gold-rgb), 0.16);
  animation: pop 0.4s var(--ease) both;
}
.panel.wide { width: min(640px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
.panel h2, .result-panel h2 { margin-top: 8px; font: 700 clamp(24px, 6vw, 31px) / 1.15 var(--display); color: var(--gold-1); }
.panel .x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.panel .x:hover { color: var(--gold-1); border-color: var(--gold-2); }
.panel-body { text-align: left; }
.lead { color: var(--muted); text-align: center; margin-bottom: 4px; }
.field { display: block; margin: 18px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold-2); }
.actions { display: grid; gap: 10px; margin-top: 22px; }
.actions.row { grid-template-columns: 1fr 1fr; }
input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
  font-weight: 600;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder { color: #5f7269; }
input:focus { border-color: var(--gold-2); box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5), 0 0 0 3px rgba(var(--gold-rgb), 0.2); }
.code-input { margin-top: 16px; height: 72px; text-align: center; font: 700 36px var(--display); letter-spacing: 0.32em; padding-left: 0.32em; color: var(--gold-1); text-transform: uppercase; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(0, 0, 0, 0.28);
  transition: all 0.2s;
}
.seg b { font: 700 16px var(--display); }
.seg small { font-size: 11px; color: var(--muted); }
.seg:hover { border-color: rgba(var(--gold-rgb), 0.5); }
.seg.on { border-color: var(--gold-2); background: linear-gradient(180deg, rgba(var(--gold-rgb), 0.24), rgba(var(--gold-rgb), 0.06)); box-shadow: 0 0 22px rgba(var(--gold-rgb), 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12); }
.seg.on b { color: var(--gold-1); }

.code { display: flex; justify-content: center; gap: clamp(5px, 1.6vw, 9px); margin: 16px 0 4px; }
.code span {
  width: clamp(40px, 12vw, 54px);
  height: clamp(54px, 16vw, 70px);
  display: grid;
  place-items: center;
  border-radius: 12px;
  font: 700 clamp(26px, 8vw, 36px) var(--display);
  color: var(--gold-1);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.25));
  border: 1px solid rgba(var(--gold-rgb), 0.5);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 18px rgba(var(--gold-rgb), 0.12);
  animation: pop 0.5s var(--ease) both;
}
.code span:nth-child(2) { animation-delay: 0.05s; } .code span:nth-child(3) { animation-delay: 0.1s; }
.code span:nth-child(4) { animation-delay: 0.15s; } .code span:nth-child(5) { animation-delay: 0.2s; }
.code span:nth-child(6) { animation-delay: 0.25s; }
.waiting-line { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; color: var(--muted); font-size: 13.5px; }

.friend { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); margin-bottom: 8px; }
.friend .who, .friend > b { flex: 1; min-width: 0; }
.my-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px dashed rgba(var(--gold-rgb), 0.5); background: rgba(var(--gold-rgb), 0.06); }
.my-code small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }
.my-code b { font: 700 25px var(--display); letter-spacing: 0.1em; color: var(--gold-1); }
.add-friend { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.net-status { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 18px 8px 4px; }

.avatar-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; justify-items: center; }
.avatar-pick button { padding: 3px; border-radius: 50%; border: 2px solid transparent; transition: transform 0.15s, border-color 0.15s; }
.avatar-pick button.on { border-color: var(--gold-1); transform: scale(1.1); }
.avatar-pick .avatar { width: 34px; height: 34px; font-size: 15px; }
.skin-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.skin-pick button { display: grid; justify-items: center; align-content: space-between; gap: 8px; padding: 10px 4px 7px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.22); transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease); }
.skin-pick button:hover { border-color: rgba(var(--gold-rgb), 0.5); }
.skin-pick button.on { border-color: var(--gold-2); background: rgba(var(--gold-rgb), 0.12); box-shadow: 0 0 20px rgba(var(--gold-rgb), 0.18); }
.skin-pick small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.skin-pick button.on small { color: var(--gold-1); }
.card.swatch { --fs: 4.6px; }
.table-swatch { width: 100%; max-width: 86px; aspect-ratio: 1.5; border-radius: 10px; border: 1px solid rgba(var(--gold-rgb), 0.45); background: radial-gradient(ellipse at 50% 45%, var(--felt-1), var(--felt-2) 55%, var(--felt-3)); box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.45); }
.face-swatch { --fs: 4.4px; }
.face-swatch .card + .card { margin-left: -4.4em; }
.skin-pick.faces { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); max-height: none; }
.segmented:has(.seg:nth-child(4)) { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }
.steps { margin: 16px 0 0; padding-left: 22px; color: #cfd8d0; }
.steps li { margin: 8px 0; }
.steps li::marker { color: var(--gold-2); font-weight: 800; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
.link.install { color: var(--gold-1); }
.toggles { display: grid; gap: 8px; margin-top: 18px; }
.toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); font-weight: 600; text-align: left; }
.toggle i { position: relative; width: 42px; height: 24px; border-radius: 12px; background: rgba(255, 255, 255, 0.14); transition: background 0.2s; }
.toggle i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); }
.toggle.on i { background: var(--gold-2); }
.toggle.on i::after { transform: translateX(18px); }

.rules h3 { margin: 20px 0 6px; font: 700 18px var(--display); color: var(--gold-1); }
.rules h3:first-child { margin-top: 4px; }
.rules p, .rules li { color: #cfd8d0; }
.rules ol, .rules ul { margin: 6px 0; padding-left: 20px; }
.rules li { margin: 4px 0; }
.rules b { color: var(--gold-1); }
.rules .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; text-align: center; }
.rules .two > div { padding: 14px 8px 10px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.07); }
.rules .two small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.cards { display: flex; justify-content: center; }
.cards .card + .card { margin-left: -4.6em; }
.rcards .cards .card + .card { margin-left: -5.6em; }
.cards.example { --fs: 5.6px; }

/* ─────────────── Notifications ─────────────── */
#toasts {
  position: fixed;
  z-index: 80;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(430px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(24, 48, 39, 0.97), rgba(10, 23, 18, 0.97));
  border: 1px solid rgba(var(--gold-rgb), 0.45);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  font-weight: 600;
  animation: drop 0.4s var(--ease) both;
}
.toast.error { border-color: rgba(230, 90, 90, 0.7); }
.toast.out { opacity: 0; transform: translateY(-10px); transition: all 0.3s; }
.toast-text { flex: 1; min-width: 150px; }
.toast-actions { display: flex; gap: 8px; margin-left: auto; }
@keyframes drop { from { opacity: 0; transform: translateY(-16px); } }
#fx { position: fixed; inset: 0; z-index: 70; width: 100%; height: 100%; pointer-events: none; }

/* ─────────────── Cartes ─────────────── */
.card {
  position: absolute;
  left: 0;
  top: 0;
  font-size: calc(var(--cw, 90px) / 10);
  width: 10em;
  height: 14em;
  perspective: 80em;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  transition: transform 0.55s var(--ease) var(--delay, 0s), opacity 0.4s ease, filter 0.3s;
  will-change: transform;
}
.card.static { position: relative; flex: none; font-size: var(--fs, 4.6px); touch-action: auto; transition: none; will-change: auto; }
.card-in {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateY(180deg);
  transition: transform 0.55s cubic-bezier(0.3, 0.7, 0.2, 1) var(--delay, 0s);
}
.card.up .card-in { transform: rotateY(0); }
.card.no-tr, .card.no-tr .card-in, .card.drag { transition: none !important; }
.card.gone { opacity: 0; pointer-events: none; }
.face {
  position: absolute;
  inset: 0;
  border-radius: 0.85em;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.front {
  color: var(--ink-0);
  background: var(--texture, none), var(--paper);
  box-shadow: 0 0.08em 0.15em rgba(0, 0, 0, 0.4), 0 0.5em 1.2em rgba(0, 0, 0, 0.3), inset 0 0 0 0.07em rgba(60, 40, 0, 0.16), inset 0 0.12em 0 rgba(255, 255, 255, 0.35);
  transition: box-shadow 0.25s;
}
.card.s1 .front { color: var(--ink-1); }
.card.s2 .front { color: var(--ink-2); }
.card.s3 .front { color: var(--ink-3); }

/* Cadre intérieur, selon le style */
.front::before { content: ''; position: absolute; inset: 0.36em; border-radius: 0.55em; pointer-events: none; display: none; }
[data-frame='line'] .front::before { display: block; border: 0.07em solid var(--frame); opacity: 0.75; }
[data-frame='double'] .front::before { display: block; border: 0.1em solid var(--frame); outline: 0.05em solid var(--frame); outline-offset: -0.32em; }
[data-frame='ornate'] .front::before { display: block; inset: 0; background: var(--corner-art) center / 100% 100% no-repeat; }

.suit { fill: currentColor; display: block; }
.corner { position: absolute; z-index: 2; width: 2.5em; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.corner.tl { top: 0.55em; left: 0.42em; }
.corner.br { bottom: 0.55em; right: 0.42em; transform: rotate(180deg); }
[data-frame='ornate'] .corner.tl { top: 0.85em; left: 0.7em; }
[data-frame='ornate'] .corner.br { bottom: 0.85em; right: 0.7em; }
.rk { font: var(--index-font); letter-spacing: -0.04em; filter: var(--glow); }
.rk.ten { letter-spacing: -0.13em; margin-left: -0.12em; transform: scaleX(0.86); }
.corner .suit { width: 1.5em; height: 1.5em; margin-top: 0.1em; filter: var(--glow); }
.pips { position: absolute; inset: 1.7em 2.3em 1.7em 3em; filter: var(--glow); }
.pips i { position: absolute; width: 2.05em; height: 2.05em; transform: translate(-50%, -50%); }
.pips i.flip { transform: translate(-50%, -50%) rotate(180deg); }
.pips.dense i { width: 1.75em; height: 1.75em; }
.bigsuit { display: none; }
.pips .suit { width: 100%; height: 100%; }
.ace { position: absolute; left: 55%; top: 50%; width: 5.6em; height: 5.6em; transform: translate(-50%, -50%); border-radius: 50%; border: 0.08em solid var(--frame); box-shadow: 0 0 0 0.3em transparent, 0 0 0 0.36em color-mix(in srgb, var(--frame) 45%, transparent); }
.ace .suit { position: absolute; left: 50%; top: 50%; width: 3.7em; height: 3.7em; transform: translate(-50%, -50%); filter: var(--glow); }

/* Figures : deux bustes tête-bêche, l'index en haut à gauche et en bas à droite */
.court { position: absolute; inset: 0.6em; display: flex; flex-direction: column; border-radius: 0.4em; overflow: hidden; background: var(--court-bg); }
.court::after { content: ''; position: absolute; left: 8%; right: 8%; top: 50%; height: 0.14em; margin-top: -0.07em; background: var(--line); opacity: 0.85; }
.court-half { position: relative; flex: 1; min-height: 0; }
.court-half + .court-half { transform: rotate(180deg); }
.court-art { position: absolute; inset: 0; width: 100%; height: 100%; filter: var(--art-filter); }

/* Styles épurés : gros index, grande enseigne, figure unique */
[data-layout='modern'] .rk { letter-spacing: -0.06em; }
[data-layout='modern'] .corner { width: 2.9em; }
[data-layout='modern'] .corner .suit { width: 1.8em; height: 1.8em; }
[data-layout='modern'] .corner.br,
[data-layout='modern'] .pips,
[data-layout='modern'] .ace,
[data-layout='modern'] .court::after,
[data-layout='modern'] .court-half + .court-half { display: none; }
[data-layout='modern'] .bigsuit { display: block; position: absolute; right: -1.1em; bottom: -0.9em; width: 8.2em; height: 8.2em; opacity: 0.92; }
[data-layout='modern'] .bigsuit .suit { width: 100%; height: 100%; }
[data-layout='modern'] .court { inset: 3.4em 0 0 1.6em; border-radius: 0; }
[data-layout='modern'] .card:has(.court) .bigsuit { display: none; }

.back {
  transform: rotateY(180deg);
  border: 0.42em solid #fbf6e8;
  background:
    radial-gradient(circle at 50% 50%, var(--bk-b) 0 1.25em, rgba(var(--gold-rgb), 0.9) 1.3em 1.42em, transparent 1.48em),
    repeating-linear-gradient(45deg, rgba(var(--gold-rgb), 0.28) 0 0.09em, transparent 0.09em 0.82em),
    repeating-linear-gradient(-45deg, rgba(var(--gold-rgb), 0.28) 0 0.09em, transparent 0.09em 0.82em),
    linear-gradient(155deg, var(--bk-a), var(--bk-b));
  box-shadow: 0 0.08em 0.15em rgba(0, 0, 0, 0.4), 0 0.5em 1.2em rgba(0, 0, 0, 0.3), inset 0 0 0 0.1em rgba(var(--gold-rgb), 0.75), inset 0 0 1.4em rgba(0, 0, 0, 0.45);
}
.back::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.95em;
  height: 0.95em;
  transform: translate(-50%, -50%) rotate(45deg);
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
}
.card.swatch .card-in { transform: rotateY(180deg); }

.card.mine { cursor: grab; }
.meld-0 { --mc: #19b98a; }
.meld-1 { --mc: #3f8cf0; }
.meld-2 { --mc: #a56bf2; }
.meld-3 { --mc: #f0a030; }
.card.melded .front::after {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 0.34em solid var(--mc);
  background: linear-gradient(180deg, color-mix(in srgb, var(--mc) 62%, transparent) 0%, color-mix(in srgb, var(--mc) 26%, transparent) 26%, transparent 58%);
  pointer-events: none;
}
.card.melded .front { box-shadow: 0 0.08em 0.15em rgba(0, 0, 0, 0.4), 0 0.5em 1.2em rgba(0, 0, 0, 0.3), 0 0 0 0.09em color-mix(in srgb, var(--mc) 80%, #000); }
.card.selected .front { box-shadow: 0 0 0 0.2em var(--gold-2), 0 0 2.2em rgba(var(--gold-rgb), 0.75), 0 1em 2em rgba(0, 0, 0, 0.45); }
.card.drag { cursor: grabbing; }
.card.drag .front { box-shadow: 0 0 0 0.14em var(--gold-2), 0 2em 3.4em rgba(0, 0, 0, 0.55); }
.card.dim { filter: brightness(0.5) saturate(0.6); }
.card.locked .front { box-shadow: 0 0.5em 1.2em rgba(0, 0, 0, 0.3), inset 0 0 0 0.2em rgba(70, 140, 235, 0.65); }
.card.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { margin-left: -0.7em; } 40%, 80% { margin-left: 0.7em; } }

/* ─────────────── Table ─────────────── */
#game { overflow: hidden; }
.felt {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 70% at 50% 46%, var(--felt-1) 0%, var(--felt-2) 36%, var(--felt-3) 72%, #020b08 100%);
}
.felt::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.32;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.felt::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(92vw, 150vh);
  height: min(62vh, 60vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(var(--gold-rgb), 0.22);
  box-shadow: 0 0 0 7px rgba(var(--gold-rgb), 0.04), inset 0 0 90px rgba(0, 0, 0, 0.22);
}
.layer { position: absolute; inset: 0; z-index: 1; touch-action: none; }

.hud-top, .hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  pointer-events: none;
}
.hud-top > *, .hud-bottom > * { pointer-events: auto; }
.hud-top { top: max(10px, env(safe-area-inset-top)); justify-content: space-between; }
.hud-bottom { bottom: max(10px, env(safe-area-inset-bottom)); }
.plate {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 5px 16px 5px 5px;
  border-radius: 999px;
  background: rgba(2, 12, 9, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}
.plate.active { border-color: var(--gold-2); box-shadow: 0 0 26px rgba(var(--gold-rgb), 0.35); }
.plate.active .avatar { animation: halo 1.6s ease-in-out infinite; }
@keyframes halo {
  50% { box-shadow: 0 0 0 2px var(--gold-1), 0 0 0 3px rgba(0, 0, 0, 0.5), 0 0 18px 4px rgba(var(--gold-rgb), 0.8), inset 0 2px 5px rgba(255, 255, 255, 0.4), inset 0 -7px 10px rgba(0, 0, 0, 0.35); }
}
.plate .who b { max-width: 22vw; }
.plate .dealer {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font: 800 11px var(--ui);
  color: #2b1d05;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
}
.plate .meter { position: absolute; left: 52px; right: 16px; bottom: 3px; height: 2px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold-3), var(--gold-1)); transition: width 0.9s var(--ease); }
.deadwood {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(2, 12, 9, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}
.deadwood small { white-space: nowrap; font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.deadwood b { font: 700 21px var(--display); font-variant-numeric: lining-nums tabular-nums; }
.deadwood.ok { border-color: rgba(var(--gold-rgb), 0.7); }
.deadwood.ok b { color: var(--gold-1); }
.btn.sort.on { border-color: var(--gold-2); color: var(--gold-1); background: rgba(var(--gold-rgb), 0.14); }
.btn.knock { min-width: 118px; animation: pulse 1.5s ease-in-out infinite; }
.btn.knock.armed { animation: none; background: rgba(0, 0, 0, 0.5); color: var(--cream); border: 1px solid var(--gold-2); box-shadow: none; }
.btn.knock.gin { background: linear-gradient(180deg, #fff6d6, #ffd76a 50%, #e89a1c); }
@keyframes pulse { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 0 7px rgba(var(--gold-rgb), 0.16), 0 0 38px rgba(var(--gold-rgb), 0.7), 0 2px 0 #6f4f15; } }

.stock, .discard-slot {
  position: absolute;
  left: 0;
  top: 0;
  font-size: calc(var(--cw, 90px) / 10);
  width: 10em;
  height: 14em;
  border-radius: 0.85em;
}
.stock {
  border: 0.42em solid #fbf6e8;
  background:
    radial-gradient(circle at 50% 50%, var(--bk-b) 0 1.25em, rgba(var(--gold-rgb), 0.9) 1.3em 1.42em, transparent 1.48em),
    repeating-linear-gradient(45deg, rgba(var(--gold-rgb), 0.28) 0 0.09em, transparent 0.09em 0.82em),
    repeating-linear-gradient(-45deg, rgba(var(--gold-rgb), 0.28) 0 0.09em, transparent 0.09em 0.82em),
    linear-gradient(155deg, var(--bk-a), var(--bk-b));
  box-shadow:
    inset 0 0 0 0.1em rgba(var(--gold-rgb), 0.75),
    0.1em 0.14em 0 #d9d2bf, 0.2em 0.28em 0 #a9a290, 0.3em 0.42em 0 #d9d2bf, 0.4em 0.56em 0 #a9a290, 0.5em 0.7em 0 #d9d2bf,
    0.6em 1.6em 2.4em rgba(0, 0, 0, 0.55);
  transition: filter 0.2s;
}
.stock.low { box-shadow: inset 0 0 0 0.1em rgba(var(--gold-rgb), 0.75), 0.1em 0.14em 0 #d9d2bf, 0.2em 0.28em 0 #a9a290, 0.4em 1.2em 2em rgba(0, 0, 0, 0.55); }
.stock .count {
  position: absolute;
  left: 50%;
  bottom: -2.9em;
  transform: translateX(-50%);
  min-width: 2.6em;
  padding: 0.12em 0.7em;
  border-radius: 1em;
  font: 700 max(11px, 1.15em) var(--ui);
  color: var(--cream);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.discard-slot { border: 0.16em dashed rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.16); transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; }
.stock.glow, .discard-slot.glow { animation: ring 1.4s ease-in-out infinite; cursor: pointer; }
.discard-slot.glow { border-color: rgba(var(--gold-rgb), 0.8); }
.discard-slot.target { border-style: solid; border-color: var(--gold-1); background: rgba(var(--gold-rgb), 0.2); box-shadow: 0 0 3em rgba(var(--gold-rgb), 0.7); }
@keyframes ring {
  0%, 100% { outline: 0.14em solid rgba(var(--gold-rgb), 0.9); outline-offset: 0.35em; }
  50% { outline: 0.14em solid rgba(var(--gold-rgb), 0.15); outline-offset: 0.9em; }
}

.prompt {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: var(--prompt-y, 60%);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 24px);
  padding: 7px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: clamp(12.5px, 3.4vw, 15px);
  white-space: nowrap;
  color: var(--muted);
  background: rgba(2, 12, 9, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.3s, color 0.3s, border-color 0.3s;
  pointer-events: none;
}
.prompt.side { left: auto; right: var(--prompt-right); transform: translateY(-50%); max-width: calc(100vw - var(--prompt-right) - 12px); white-space: normal; text-align: center; border-radius: 18px; }
.prompt.show { opacity: 1; }
.prompt.mine { color: var(--gold-1); border-color: rgba(var(--gold-rgb), 0.45); }
.prompt .btn { pointer-events: auto; min-height: 30px; margin-right: -10px; border-color: var(--gold-2); color: var(--gold-1); }

.bubble {
  position: absolute;
  z-index: 6;
  left: 50%;
  padding: 8px 16px;
  border-radius: 16px;
  font-weight: 700;
  color: #20170a;
  background: linear-gradient(180deg, #fffaf0, #f1e3c0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate(-50%, 8px) scale(0.9);
  transition: all 0.3s var(--ease);
  pointer-events: none;
}
.bubble.opp { top: 66px; }
.bubble.me { bottom: calc(var(--bar-h, 80px) + 6px); }
.bubble.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.emote-menu {
  position: absolute;
  z-index: 7;
  right: 12px;
  bottom: calc(var(--bar-h, 80px) + 4px);
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(6, 20, 15, 0.95);
  border: 1px solid rgba(var(--gold-rgb), 0.4);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.emote-menu.open { display: grid; animation: pop 0.25s var(--ease) both; }

.link-lost {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-radius: 18px;
  font-weight: 700;
  background: rgba(6, 20, 15, 0.96);
  border: 1px solid rgba(230, 90, 90, 0.6);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}
.link-lost.open { display: flex; }

/* ─────────────── Fin de manche ─────────────── */
.result {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(1, 8, 6, 0.74);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.result.open { opacity: 1; visibility: visible; }
.result:not(.open) .result-panel { animation: none; }
.result-panel { width: min(600px, 100%); max-height: calc(100dvh - 24px); padding: 24px 20px 20px; }
.result-panel h2 {
  font-size: clamp(34px, 9vw, 54px);
  font-weight: 900;
  background: linear-gradient(100deg, #b98a32, #fbeab5 30%, #fff7dc 50%, #e0b85a 70%, #a87a2a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.result.lose .result-panel h2 { background: linear-gradient(100deg, #8d9aa0, #e6ecee 50%, #8d9aa0); -webkit-background-clip: text; background-clip: text; }
.result.lose .result-panel { border-color: rgba(190, 205, 210, 0.3); }
.sub { color: var(--muted); margin-top: 4px; }
.rrow { margin-top: 10px; padding: 10px 12px 12px; border-radius: 16px; text-align: left; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); }
.rrow.winner { border-color: rgba(var(--gold-rgb), 0.55); background: rgba(var(--gold-rgb), 0.07); }
.rhead { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.rhead .avatar { width: 28px; height: 28px; font-size: 13px; }
.rhead .tag { padding: 1px 9px; border-radius: 8px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #2b1d05; background: var(--gold-2); }
.rhead .dw { margin-left: auto; font-weight: 700; font-size: 13px; color: var(--muted); }
.rcards { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; --fs: clamp(4.2px, 1.3vw, 5.6px); }
.result.final .tally { display: none; }
.result.final .rrow { padding: 8px 12px; }
.result.final .rcards { --fs: clamp(3.4px, 1vw, 4.2px); }
.grp small { display: block; margin-bottom: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.grp .cards { justify-content: flex-start; }
.grp.dead .card { filter: brightness(0.72) saturate(0.7); }
.grp.laid .card .front { box-shadow: 0 0 0 0.25em #48e29a, 0 0.5em 1.2em rgba(0, 0, 0, 0.3); }
.tally { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 14px; }
.tally .big { font: 900 34px/1 var(--display); color: var(--gold-1); }
.tally small { flex-basis: 100%; color: var(--muted); }
.scores { display: grid; gap: 7px; margin-top: 14px; }
.score { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto auto; align-items: center; gap: 10px; font-weight: 700; text-align: left; }
.score span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score .meter { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.09); overflow: hidden; }
.score b { min-width: 2.2em; text-align: right; font: 700 19px var(--display); color: var(--gold-1); font-variant-numeric: lining-nums tabular-nums; }
.score small { color: var(--muted); font-weight: 600; }
.final { width: 100%; margin-top: 14px; border-collapse: collapse; font-variant-numeric: lining-nums tabular-nums; }
.final th { font: 700 15px var(--display); color: var(--gold-1); padding: 4px 8px; }
.final td { padding: 6px 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-weight: 600; }
.final td:first-child { text-align: left; color: var(--muted); }
.final .total td { font: 700 21px var(--display); color: var(--gold-1); border-top-color: rgba(var(--gold-rgb), 0.5); }
.final .total td:first-child { font: 700 12px var(--ui); letter-spacing: 0.16em; text-transform: uppercase; }
.result-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 18px; }
.waiting { min-height: 20px; margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ─────────────── Petits écrans ─────────────── */
@media (max-width: 560px) {
  .plate .who small { font-size: 10.5px; }
  .hud-bottom { gap: 6px; }
  .hud-bottom .plate .who b { max-width: 18vw; }
  .btn.knock { position: fixed; left: 50%; top: calc(var(--prompt-y, 60%) + 28px); margin-left: -80px; width: 160px; min-height: 44px; }
  .hud-bottom .plate .who b { display: none; }
  .deadwood { padding: 5px 10px; }
  .panel { padding: 28px 18px 20px; }
  .chip .who small { display: none; }
}
@media (max-height: 520px) {
  .hud-top { top: 5px; }
  .hud-bottom { bottom: 5px; }
  .plate { padding: 3px 12px 3px 3px; }
  .plate .avatar { width: 32px; height: 32px; font-size: 14px; }
  .plate .meter { left: 42px; }
  .crest, .hero .kicker, .stats { display: none; }
  .logo { font-size: 44px; }
  .menu { grid-template-columns: repeat(3, 1fr); width: min(760px, 100%); }
  .bubble.opp { top: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .rays, .card.floater, .logo, .btn.knock, .plate.active .avatar { animation: none; }
  .card, .card-in { transition-duration: 0.15s; }
}
