:root {
  --felt: #0b5d2e;
  --felt-dark: #073d1e;
  --line: rgba(255, 255, 255, 0.75);
  --red: #c0392b;
  --black: #1c1c1c;
  --green: #138a3a;
  --gold: #e8c15a;
  --text: #f4f1e8;
  --bg: #0d1a12;
  --cell-h: 58px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at top, rgba(24, 64, 42, 0.9), transparent 60%),
    radial-gradient(ellipse at bottom, #2a0d12, transparent 70%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Projecteurs qui balaient la salle, et vignette sombre sur les bords */
body::before, body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(232, 193, 90, 0.13), transparent 28%),
    radial-gradient(circle at 80% 60%, rgba(192, 57, 43, 0.12), transparent 30%),
    radial-gradient(circle at 50% 90%, rgba(52, 152, 219, 0.08), transparent 30%);
  animation: spotlights 18s ease-in-out infinite alternate;
}
body::after { background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55)); }
@keyframes spotlights {
  33% { transform: translate(6%, 4%) scale(1.1); }
  66% { transform: translate(-5%, -3%) scale(0.95); }
  100% { transform: translate(3%, -6%) scale(1.05); }
}
.topbar, main { position: relative; z-index: 1; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 2px solid var(--gold);
}
.topbar h1 {
  margin: 0; font-size: 1.4rem; color: #ffe9a8; letter-spacing: 0.04em;
  text-shadow: 0 0 4px #fff3, 0 0 10px var(--gold), 0 0 22px #e8c15a99, 0 0 40px #c0392b66;
  animation: neon 7s infinite;
}
/* néon qui grésille de temps en temps */
@keyframes neon {
  0%, 18%, 20%, 54%, 56%, 100% { opacity: 1; }
  19%, 55% { opacity: 0.55; text-shadow: none; }
}

.name-field { display: flex; flex-direction: column; }
.name-field input {
  font: inherit; width: 150px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.3); color: var(--text);
}
.name-field input:focus { outline: 2px solid var(--gold); border-color: transparent; }

.stats { display: flex; gap: 18px; }
.stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat .label, .name-field .label { font-size: 0.7rem; text-transform: uppercase; opacity: 0.7; }
.stat .value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
#balance { color: var(--gold); transition: color 0.3s, text-shadow 0.3s; }
#balance.up { color: #7dff9e; text-shadow: 0 0 12px #7dff9e; }
#balance.down { color: #ff9a8a; }

.bank-btn {
  background: linear-gradient(#f0cf6e, #c99a2e);
  color: #2a1c00; font-weight: 800; border-color: #8a6a1c;
  box-shadow: 0 0 12px rgba(232, 193, 90, 0.4);
}
.bank-btn:hover:not(:disabled) { background: linear-gradient(#ffe08a, #d8a838); }

.toggles { display: flex; gap: 4px; }
.toggle { display: grid; place-items: center; padding: 7px; line-height: 0; }
.toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toggle.off { opacity: 0.4; }
.toggle.off svg { stroke: #ff9a8a; }

.conn { font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.4); }
.conn::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #888; }
.conn.on::before { background: #4cff7a; box-shadow: 0 0 6px #4cff7a; }
.conn.off::before { background: #ff6b5b; }

main { max-width: 1080px; margin: 0 auto; padding: 16px; }

/* ---------- Arène : roue + joueurs ---------- */
.arena {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
}
.arena .wheel-zone { flex: 1 1 520px; }

/* ---------- Roue ---------- */
.wheel-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
.wheel-wrap { position: relative; width: 340px; max-width: 100%; aspect-ratio: 1; }
#wheel { width: 100%; height: 100%; display: block; position: relative; filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.7)); }

/* Ampoules autour de la roue */
.lights { position: absolute; inset: -12px; pointer-events: none; }
.bulb {
  position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
  background: #ffe9a8; box-shadow: 0 0 6px #ffd76a, 0 0 12px #e8c15a;
  animation: twinkle 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.37s);
}
@keyframes twinkle { 50% { opacity: 0.35; box-shadow: none; } }
.lights[data-mode="chase"] .bulb {
  animation: chase 0.7s linear infinite;
  animation-delay: calc(var(--i) * -0.7s / var(--n));
}
@keyframes chase { 0%, 70% { opacity: 0.2; box-shadow: none; } 80% { opacity: 1; background: #fff; } }
.lights[data-mode="win"] .bulb { animation: party 0.25s steps(1) infinite; }
.lights[data-mode="win"] .bulb:nth-child(odd) { animation-delay: -0.125s; }
@keyframes party { 50% { background: #ff5b4a; box-shadow: 0 0 10px #ff5b4a, 0 0 18px #c0392b; } }

/* Réactions qui s'envolent au-dessus de la roue */
.fx-emoji {
  position: absolute; bottom: 10%; z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
  animation: float-up 3.2s ease-out forwards;
}
.fx-emoji span { font-size: 2.2rem; filter: drop-shadow(0 2px 4px #000); }
.fx-emoji small { font-size: 0.7rem; font-weight: 700; text-shadow: 0 1px 2px #000; white-space: nowrap; }
@keyframes float-up {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  15% { transform: translateY(-20px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-260px) scale(1); opacity: 0; }
}
.pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  color: var(--gold); font-size: 22px; text-shadow: 0 2px 4px #000;
}
.side { flex: 1 1 260px; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }

.phase { display: flex; flex-direction: column; gap: 6px; }
.phase-line { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.timer { font-variant-numeric: tabular-nums; color: var(--gold); }
.bar { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.bar > div { height: 100%; width: 100%; background: linear-gradient(90deg, #c99a2e, var(--gold)); transition: width 0.2s linear; }
.bar > div.urgent { background: linear-gradient(90deg, #a31d12, #ff5b4a); }
.timer.urgent { color: #ff5b4a; animation: pulse 1s ease-in-out infinite; display: inline-block; }
@keyframes pulse { 50% { transform: scale(1.35); } }

/* ---------- Joueurs ---------- */
.players {
  flex: 0 1 240px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(232, 193, 90, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 220px;
}
.players h2 { font-size: 0.8rem; text-transform: uppercase; opacity: 0.8; margin: 0 0 8px; }
.online { font-weight: 400; text-transform: none; opacity: 0.7; }
.player-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.player-list li {
  display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center;
  padding: 4px 6px; border-radius: 6px; font-size: 0.92rem;
}
.player-list li.me { background: rgba(232, 193, 90, 0.18); }
.player-list .dot { width: 10px; height: 10px; border-radius: 50%; }
.player-list .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-list .pstake { color: #ffd76a; font-weight: 700; font-variant-numeric: tabular-nums; }
.player-list .pbal { opacity: 0.75; font-variant-numeric: tabular-nums; }

/* ---------- Salon ---------- */
.lounge-title { margin-top: 14px !important; }
.feed {
  list-style: none; margin: 0; padding: 6px; height: 190px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
  background: rgba(0, 0, 0, 0.3); border-radius: 6px; font-size: 0.82rem;
}
.feed li { line-height: 1.3; overflow-wrap: anywhere; animation: feed-in 0.3s ease-out; }
.feed li:first-child { margin-top: auto; }
.feed .ev-join, .feed .ev-reset, .feed .ev-topup { opacity: 0.7; font-style: italic; }
.feed .ev-win { color: #ffe08a; }
@keyframes feed-in { from { opacity: 0; transform: translateX(-8px); } }
.reactions { display: flex; flex-wrap: wrap; gap: 2px; margin: 6px 0; }
.react-btn { padding: 3px 5px; font-size: 1.1rem; line-height: 1; background: none; border-color: transparent; }
.react-btn:hover:not(:disabled) { transform: scale(1.25); background: none; }
.chat-form { display: flex; gap: 4px; }
.chat-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 6px 8px; border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.3); color: var(--text);
}
.chat-form input:focus { outline: 2px solid var(--gold); border-color: transparent; }
.chat-form button { padding: 6px 10px; }

.result {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 2.6rem; font-weight: 800;
  border: 4px solid var(--gold);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s;
}
.result.empty { background: #333; opacity: 0.6; }
.result.red { background: var(--red); }
.result.black { background: var(--black); }
.result.green { background: var(--green); }
.result.pop { transform: scale(1.15); }
.result.dim { opacity: 0.5; }

.table.locked { filter: saturate(0.7); }

.message { min-height: 2.6em; font-size: 1.05rem; }
.message.win { color: #7dff9e; font-weight: 700; }
.message.lose { color: #ff9a8a; }

.history h2 { font-size: 0.8rem; text-transform: uppercase; opacity: 0.7; margin: 0 0 6px; }
.history-list { display: flex; flex-wrap: wrap; gap: 4px; }
.history-list span {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.history-list span.red { background: var(--red); }
.history-list span.black { background: var(--black); }
.history-list span.green { background: var(--green); }

/* ---------- Contrôles ---------- */
/* Collés en bas de l'écran tant que le tapis est visible : jetons et tapis toujours à portée */
.controls {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  margin: 20px -10px 12px;
  padding: 10px;
  position: sticky; bottom: 0; z-index: 6;
  background: rgba(7, 24, 15, 0.92);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(232, 193, 90, 0.3);
  border-radius: 12px;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.45);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 4px dashed rgba(255, 255, 255, 0.85);
  color: #fff; font-weight: 800; font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 0 0 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.chip-btn:hover { transform: translateY(-2px); }
.chip-btn.selected { transform: translateY(-5px) scale(1.08); outline: 3px solid var(--gold); outline-offset: 2px; }
.chip-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.buttons { display: flex; flex-wrap: wrap; gap: 8px; }
button {
  font: inherit;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}
button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary {
  background: linear-gradient(#f0cf6e, #c99a2e);
  color: #2a1c00; font-weight: 800; border-color: #8a6a1c;
  padding: 9px 26px;
}
button.primary:hover:not(:disabled) { background: linear-gradient(#ffe08a, #d8a838); }

/* ---------- Tapis ---------- */
.table-scroll { overflow-x: auto; padding-bottom: 8px; }
.table {
  position: relative;
  display: grid;
  grid-template-columns: 1fr repeat(12, 1fr) 1.1fr;
  grid-template-rows: repeat(3, var(--cell-h)) 46px 46px;
  min-width: 680px;
  background: var(--felt);
  border: 3px solid var(--gold);
  border-radius: 10px;
  padding: 10px;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 40px var(--felt-dark), 0 8px 24px rgba(0, 0, 0, 0.5);
}
.table.locked { pointer-events: none; }
.table.locked .cell, .table.locked .hotspot { cursor: default; }

.cell {
  position: relative;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  margin: -0.5px;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  transition: filter 0.1s, box-shadow 0.1s;
}
.cell:hover { filter: brightness(1.25); }
.cell.num > b {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
}
.cell.red > b { background: var(--red); }
.cell.black > b { background: var(--black); }
.cell.zero { background: var(--green); border-radius: 40px 0 0 40px; font-size: 1.4rem; }
.cell.outside { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.03em; }
.cell .diamond { width: 22px; height: 22px; transform: rotate(45deg); border-radius: 3px; }
.cell .diamond.red { background: var(--red); }
.cell .diamond.black { background: var(--black); border: 1px solid #777; }
.cell.highlight { box-shadow: inset 0 0 0 3px var(--gold); filter: brightness(1.3); }
.cell.winner { animation: blink 0.6s ease-in-out 5; box-shadow: inset 0 0 0 4px #fff; }
@keyframes blink { 50% { background-color: rgba(255, 255, 255, 0.45); } }

.overlay {
  grid-column: 2 / 14;
  grid-row: 1 / 4;
  position: relative;
  pointer-events: none;
  z-index: 2;
}
.hotspot {
  position: absolute;
  width: 24px; height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
}
.hotspot:hover { background: rgba(232, 193, 90, 0.55); box-shadow: 0 0 0 2px var(--gold); }

/* jetons posés */
.chip {
  position: absolute;
  left: 50%; top: 50%;
  width: 30px; height: 30px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 800; color: #fff;
  border: 3px dashed rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6), 0 -2px 0 rgba(0, 0, 0, 0.25) inset;
  pointer-events: none;
  z-index: 3;
  animation: drop 0.15s ease-out;
}
.chip.won { box-shadow: 0 0 0 3px #7dff9e, 0 0 14px #7dff9e; }
.chip.mine { outline: 2px solid var(--gold); outline-offset: 2px; }
@keyframes drop { from { transform: translate(-50%, -80%) scale(1.3); opacity: 0; } }

.c-1 { background: #9aa4ad; }
.c-5 { background: #c0392b; }
.c-10 { background: #2f6fd1; }
.c-25 { background: #1e8a46; }
.c-100 { background: #222; }
.c-500 { background: #7b3fb0; }
.c-1000 { background: #c98a12; }
.c-5000 { background: #d1477a; }
.c-10000 { background: linear-gradient(135deg, #1abc9c, #0e6655); }

/* ---------- Banque ---------- */
.bank {
  border: 2px solid var(--gold); border-radius: 14px; padding: 0;
  background: linear-gradient(#173a26, #0d1a12); color: var(--text);
  box-shadow: 0 0 40px rgba(232, 193, 90, 0.35); width: min(380px, calc(100vw - 32px));
}
.bank::backdrop { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(2px); }
.bank-inner { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.bank h2 { margin: 0; color: var(--gold); }
.bank-note { margin: 0; opacity: 0.75; font-size: 0.9rem; }
.bank-amounts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bank-amounts button { font-weight: 800; font-size: 1.05rem; padding: 12px; }
.bank-amounts button:hover:not(:disabled) { background: rgba(232, 193, 90, 0.25); border-color: var(--gold); }
.bank-custom { display: flex; gap: 8px; }
.bank-custom input {
  flex: 1; min-width: 0; font: inherit; padding: 8px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.3); color: var(--text);
}
.bank hr { width: 100%; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.15); margin: 2px 0; }
.reset-btn { border-color: #ff9a8a66; }
.bank-close { align-self: flex-end; }

/* ---------- Effets ---------- */
.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 50; }

.fx-banner {
  position: fixed; left: 50%; top: 38%; z-index: 60; pointer-events: none;
  transform: translate(-50%, -50%); text-align: center;
  animation: banner 2.9s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
.fx-banner-title {
  font-size: clamp(2.6rem, 9vw, 5rem); font-weight: 900; letter-spacing: 0.04em; color: #ffe9a8;
  text-shadow: 0 0 10px var(--gold), 0 0 30px #e8c15a, 0 4px 0 #8a6414, 0 8px 20px #000;
}
.fx-banner-sub { font-size: clamp(1.2rem, 4vw, 1.8rem); font-weight: 800; color: #7dff9e; text-shadow: 0 2px 8px #000; }
.fx-banner.big .fx-banner-title {
  background: linear-gradient(90deg, #ffe9a8, #ff5b4a, #ffe9a8, #7dff9e, #ffe9a8);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbow 1s linear infinite;
  text-shadow: none; filter: drop-shadow(0 0 12px #e8c15a) drop-shadow(0 6px 10px #000);
}
@keyframes rainbow { to { background-position: 300% 0; } }
@keyframes banner {
  0% { transform: translate(-50%, -50%) scale(0.2); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(0.9); opacity: 0; }
}

body.shake main { animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(4px, -2px); }
  30%, 50%, 70% { transform: translate(-7px, 3px); }
  40%, 60% { transform: translate(7px, -3px); }
}

.fx-toasts {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: flex; flex-direction: column; gap: 8px; max-width: min(320px, calc(100vw - 32px));
}
.fx-toast {
  padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 0.9rem;
  background: rgba(20, 12, 0, 0.92); border: 1px solid var(--gold); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  animation: toast 4.5s ease forwards;
}
@keyframes toast {
  0% { transform: translateX(120%); }
  8%, 88% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, .topbar h1, .bulb, .timer.urgent { animation: none !important; }
}

/* ---------- Aide ---------- */
.help { margin-top: 20px; }
.help summary { cursor: pointer; font-weight: 700; color: var(--gold); }
.help table { border-collapse: collapse; margin: 10px 0; }
.help th, .help td { border: 1px solid rgba(255, 255, 255, 0.2); padding: 4px 10px; text-align: left; }

@media (max-width: 600px) {
  .topbar h1 span { display: none; }
  .stats { gap: 12px; }
  .stat .value { font-size: 1.05rem; }
  .wheel-wrap { width: 280px; }
  .result { width: 72px; height: 72px; font-size: 2rem; }
  .chip-btn { width: 44px; height: 44px; font-size: 0.75rem; }
  .controls { justify-content: center; }
  .name-field input { width: 110px; }
  .players { flex-basis: 100%; min-width: 0; }
  .player-list { max-height: 160px; }
  .feed { height: 140px; }
  .bank-btn { padding: 8px 10px; }
}

/* ---------- Jetons : pose plus vivante ---------- */
.chip.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 50% { transform: translate(-50%, -50%) scale(1.25); } }
.chip.ghost {
  left: 0; top: 0; z-index: 5; opacity: 0; pointer-events: none;
  transition: opacity 0.12s; animation: none; outline: none;
}
.chip.ghost.on { opacity: 0.7; }
.table.locked .chip.ghost { display: none; }
@media (hover: hover) { .table:not(.locked) .cell, .table:not(.locked) .hotspot { cursor: copy; } }

kbd {
  display: inline-block; padding: 1px 6px; border-radius: 4px; font: 700 0.75em system-ui, sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(0, 0, 0, 0.35); color: inherit;
}

/* ---------- Annonces à la française ---------- */
.announces { margin-top: 18px; padding: 12px; border: 1px solid rgba(232, 193, 90, 0.3); border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.announces.locked { opacity: 0.6; pointer-events: none; }
.announces-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.announces-head h2 { margin: 0; font-size: 1rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; }
.announces-head small { text-transform: none; font-weight: 400; color: var(--text); opacity: 0.7; letter-spacing: 0; }
.announces-hint { font-size: 0.8rem; opacity: 0.7; }
.table-scroll + .announces { overflow-x: auto; }
.racetrack {
  display: grid; grid-template-columns: repeat(19, minmax(30px, 1fr)); grid-template-rows: 36px 44px 36px;
  min-width: 640px; padding: 6px; border: 3px solid var(--gold); border-radius: 60px;
  background: var(--felt); box-shadow: inset 0 0 30px var(--felt-dark);
}
.rt-num {
  padding: 0; border-radius: 0; border: 1px solid rgba(255, 255, 255, 0.6); margin: -0.5px;
  font-weight: 800; font-size: 0.85rem; color: #fff;
}
.rt-num.red { background: var(--red); }
.rt-num.black { background: var(--black); }
.rt-num.green { background: var(--green); border-radius: 0 50px 50px 0; font-size: 1.1rem; }
.rt-num:hover:not(:disabled), .rt-num.highlight { filter: brightness(1.45); box-shadow: inset 0 0 0 3px var(--gold); background-image: none; }
.rt-num.red:hover, .rt-num.red.highlight { background: #e0503f; }
.rt-num.black:hover, .rt-num.black.highlight { background: #444; }
.racetrack > .rt-num:nth-child(35) { border-radius: 40px 0 0 0; }  /* 5, en haut à gauche */
.racetrack > .rt-num:nth-child(36) { border-radius: 0 0 0 40px; }  /* 10, en bas à gauche */
.rt-end { border-left: 1px solid rgba(255, 255, 255, 0.6); }
.rt-zone {
  border-radius: 0; margin: 0 -0.5px; border: 1px solid rgba(255, 255, 255, 0.6); border-width: 0 1px;
  background: rgba(0, 0, 0, 0.12); font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.rt-zone:hover:not(:disabled) { background: rgba(232, 193, 90, 0.35); }
.announce-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin-top: 10px; }
.announce-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.announce-btn { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 12px; line-height: 1.2; }
.announce-btn small { opacity: 0.7; font-size: 0.72rem; }
.announce-btn:hover:not(:disabled) { border-color: var(--gold); background: rgba(232, 193, 90, 0.2); }
.finales { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.finales > span { opacity: 0.8; }
.finale-list { display: flex; gap: 3px; }
.finale-btn { width: 32px; height: 32px; padding: 0; border-radius: 50%; font-weight: 800; }
.finale-btn:hover:not(:disabled) { border-color: var(--gold); background: rgba(232, 193, 90, 0.25); }

/* ---------- Deux modes ---------- */
.mode-switch {
  display: flex; padding: 3px; gap: 2px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(232, 193, 90, 0.45);
}
.mode-switch button { padding: 6px 12px; border: 0; border-radius: 7px; background: none; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.mode-switch button[aria-pressed="true"] { background: linear-gradient(#f0cf6e, #c99a2e); color: #2a1c00; font-weight: 800; }
.mode-switch button[aria-pressed="true"]:hover { background: linear-gradient(#ffe08a, #d8a838); }

body.mode-game { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.mode-game .topbar, body.mode-game .game-nav { flex: none; }
body.mode-game .game-view {
  flex: 1; min-height: 0; overflow-y: auto; max-width: none; width: 100%;
  padding: 12px max(16px, calc((100% - 1080px) / 2)) 16px;
}

/* Barre des jeux : onglets (accès direct) ou retour à la salle (salle de jeu) */
.game-nav {
  position: sticky; top: 0; z-index: 8; display: flex; align-items: center; gap: 12px;
  padding: 8px max(16px, calc((100% - 1080px) / 2));
  background: rgba(5, 14, 9, 0.92); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(232, 193, 90, 0.3);
}
.leave-btn { font-weight: 700; border-color: rgba(232, 193, 90, 0.6); }
.game-title { font-weight: 800; color: var(--gold); letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.9rem; }
.game-tabs { display: flex; gap: 4px; overflow-x: auto; }
.game-tabs button { border-radius: 8px 8px 0 0; border-width: 0 0 3px; border-color: transparent; background: none; font-weight: 700; white-space: nowrap; }
.game-tabs button[aria-selected="true"] { border-color: var(--gold); color: #ffe9a8; background: rgba(232, 193, 90, 0.12); }

/* Accès rapides dans la salle */
.quick-travel {
  position: absolute; top: 12px; right: 12px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px;
  max-width: calc(100% - 24px);
}
.quick-travel span { font-size: 0.75rem; text-transform: uppercase; opacity: 0.8; text-shadow: 0 1px 3px #000; }
.quick-travel button {
  padding: 7px 12px; font-size: 0.85rem; font-weight: 700; border-color: rgba(232, 193, 90, 0.5);
  background: rgba(6, 18, 11, 0.85); backdrop-filter: blur(4px);
}
.quick-travel button:hover:not(:disabled) { background: rgba(232, 193, 90, 0.25); }

/* Hall du casino */
.stage { position: relative; z-index: 1; flex: 1; min-height: 0; overflow: hidden; background: #050a07; }
#world { display: block; width: 100%; height: 100%; touch-action: none; outline: none; cursor: pointer; }
.prompt {
  position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 3;
  padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 1rem;
  background: linear-gradient(#f0cf6e, #c99a2e); color: #2a1c00; border-color: #8a6a1c;
  box-shadow: 0 0 20px rgba(232, 193, 90, 0.6); animation: prompt-in 0.25s ease-out;
}
.prompt:hover:not(:disabled) { background: linear-gradient(#ffe08a, #d8a838); }
.prompt kbd { border-color: rgba(0, 0, 0, 0.4); background: rgba(0, 0, 0, 0.12); }
@keyframes prompt-in { from { transform: translate(-50%, 12px); opacity: 0; } }
.controls-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2;
  font-size: 0.8rem; opacity: 0.75; white-space: nowrap; pointer-events: none;
  padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.5);
}
@media (hover: none) { .controls-hint { display: none; } }

/* Salon : dans la colonne des joueurs à table, flottant dans le hall */
.lounge-title {
  display: flex; align-items: center; gap: 6px; width: 100%; margin: 14px 0 8px; padding: 0;
  border: 0; background: none; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; opacity: 0.8; cursor: default;
}
.lounge-title:hover:not(:disabled) { background: none; }
.unread { background: #e74c3c; color: #fff; border-radius: 999px; padding: 0 6px; font-size: 0.7rem; }
.salon.floating {
  position: absolute; left: 12px; bottom: 12px; z-index: 4; width: min(310px, calc(100% - 24px));
  padding: 8px 10px; border-radius: 12px; background: rgba(6, 18, 11, 0.88); backdrop-filter: blur(6px);
  border: 1px solid rgba(232, 193, 90, 0.4); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.salon.floating .lounge-title { margin: 0 0 6px; cursor: pointer; opacity: 1; }
.salon.floating .feed { height: 150px; }
.salon.floating.collapsed .salon-body { display: none; }
.salon.floating.collapsed .lounge-title { margin: 0; }

/* Écran d'accueil */
.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(24, 64, 42, 0.92), rgba(5, 10, 7, 0.97));
}
.splash-card { width: min(560px, 100%); text-align: center; display: flex; flex-direction: column; gap: 16px; }
.splash-title {
  font: 900 clamp(2.6rem, 10vw, 4.4rem) "Brush Script MT", "Segoe Script", cursive, system-ui;
  color: #ffe9a8; text-shadow: 0 0 10px var(--gold), 0 0 30px #c0392b, 0 4px 0 #8a6414;
  animation: neon 7s infinite;
}
.splash-sub { margin: -8px 0 0; opacity: 0.8; }
.splash-name { display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 0.85rem; text-transform: uppercase; opacity: 0.9; }
.splash-name input {
  font: inherit; font-size: 1.1rem; text-transform: none; text-align: center; width: min(260px, 100%);
  padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(232, 193, 90, 0.6); background: rgba(0, 0, 0, 0.35); color: var(--text);
}
.splash-name input:focus { outline: 2px solid var(--gold); }
.splash-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.splash-mode {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px; border-radius: 14px;
  border: 2px solid rgba(232, 193, 90, 0.4); background: rgba(0, 0, 0, 0.35); transition: transform 0.15s, border-color 0.15s;
}
.splash-mode:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--gold); background: rgba(232, 193, 90, 0.15); }
.splash-mode.last { border-color: var(--gold); box-shadow: 0 0 18px rgba(232, 193, 90, 0.35); }
.splash-mode b { font-size: 1.15rem; color: var(--gold); }
.splash-mode small { opacity: 0.75; font-size: 0.82rem; line-height: 1.3; }
@media (max-width: 480px) { .splash-modes { grid-template-columns: 1fr; } }

@media (max-width: 600px) {
  body.mode-game .topbar { gap: 6px 10px; padding: 8px 12px; }
  body.mode-game .topbar h1 { font-size: 1.1rem; }
  body.mode-game .name-field, body.mode-game .stat:nth-child(3), body.mode-game .conn { display: none; }
  body.mode-game .toggle { padding: 5px 7px; }
  body.mode-game .bank-btn { padding: 7px 10px; font-size: 0.9rem; }
  .mode-switch button { padding: 5px 9px; font-size: 0.82rem; }
  .game-nav { gap: 8px; padding: 6px 12px; }
  .leave-btn { padding: 7px 10px; font-size: 0.9rem; }
  .leave-btn kbd { display: none; }
  .quick-travel { top: auto; bottom: 10px; left: 10px; right: 10px; justify-content: center; max-width: none; }
  .quick-travel span { display: none; }
  .quick-travel button { padding: 6px 9px; font-size: 0.8rem; }
  .salon.floating { top: 10px; bottom: auto; left: 10px; }
  .salon.floating .feed { height: 120px; }
  .prompt { bottom: 56px; }
}
.salon.floating.collapsed { width: auto; }

/* ---------- Jeux à une colonne + panneau latéral (salon) ---------- */
.game-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.game-main { flex: 1 1 560px; min-width: 0; }
.side-panel:not(.players) {
  flex: 0 1 260px; min-width: 220px; padding: 10px 12px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(232, 193, 90, 0.35);
}
.side-panel:not(.players) .lounge-title { margin-top: 0; }
.small-btn { padding: 5px 10px; font-size: 0.82rem; }

/* ---------- Blackjack ---------- */
.bj-felt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 22px 16px 18px; border: 3px solid var(--gold); border-radius: 18px 18px 200px 200px / 18px 18px 60px 60px;
  background: radial-gradient(ellipse at 50% 35%, #138a45, var(--felt) 55%, var(--felt-dark));
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.5);
  min-height: 400px;
}
.bj-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bj-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; display: flex; align-items: center; gap: 8px; }
.bj-rules {
  font: italic 600 0.85rem Georgia, "Times New Roman", serif; color: #ffe9a8; opacity: 0.8; text-align: center;
  padding: 4px 18px; border-top: 1px solid rgba(232, 193, 90, 0.5); border-bottom: 1px solid rgba(232, 193, 90, 0.5);
}
.bj-hands { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; min-height: 150px; }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; border: 2px solid transparent; }
.bj-hand.active { border-color: rgba(232, 193, 90, 0.7); background: rgba(232, 193, 90, 0.08); }
.bj-hand-info { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: 0.85rem; }
.bj-hand-bet { opacity: 0.8; }
.bj-empty { align-self: center; opacity: 0.7; font-style: italic; }
.bj-score {
  display: inline-block; min-width: 28px; padding: 2px 9px; border-radius: 999px; text-align: center;
  background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.35); font-weight: 800; font-size: 0.85rem; text-transform: none; letter-spacing: 0;
}
.bj-score.bust, .bj-score.outcome.bust, .bj-score.outcome.lose { border-color: #ff9a8a; color: #ffb3a7; }
.bj-score.outcome.win, .bj-score.outcome.blackjack { border-color: #7dff9e; color: #7dff9e; background: rgba(20, 80, 40, 0.7); }
.bj-score.outcome.blackjack { border-color: var(--gold); color: #ffe9a8; box-shadow: 0 0 12px rgba(232, 193, 90, 0.6); }
.bj-message { text-align: center; min-height: 1.6em; }
.cards { display: flex; justify-content: center; min-height: 112px; padding-left: 34px; }
.card {
  position: relative; width: 78px; height: 112px; margin-left: -34px; border-radius: 8px;
  background: #fdfbf5; border: 1px solid #c9c2b0; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45);
  font-family: Georgia, "Times New Roman", serif; user-select: none;
}
.card.red { color: #c0392b; }
.card.black { color: #1a1a1a; }
.card .corner { position: absolute; top: 5px; left: 7px; font-size: 0.95rem; font-weight: 700; line-height: 1; }
.card .corner.bottom { top: auto; left: auto; bottom: 5px; right: 7px; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; }
.card.back {
  background: repeating-linear-gradient(45deg, #8e1b25 0 6px, #a8232f 6px 12px);
  border: 4px solid #fdfbf5; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 2px var(--gold);
}
.card.dealt { animation: deal 0.32s cubic-bezier(0.2, 0.8, 0.3, 1); }
.card.flip { animation: flip 0.4s ease-out; }
@keyframes deal { from { transform: translate(120px, -160px) rotate(-20deg); opacity: 0; } }
@keyframes flip { from { transform: rotateY(90deg); } }
.bj-controls { position: static; margin: 16px 0 12px; }
.bj-bet-zone { display: flex; flex-direction: column; gap: 8px; }
.bj-bet-line { display: flex; align-items: center; gap: 10px; }
.bj-bet-line .label { font-size: 0.75rem; text-transform: uppercase; opacity: 0.75; }
.bj-bet { font-size: 1.3rem; color: var(--gold); font-variant-numeric: tabular-nums; min-width: 60px; }
.bj-actions button { font-weight: 700; }
.bj-actions kbd, .slot-buttons kbd { margin-left: 4px; }

/* ---------- Machine à sous ---------- */
.slot-machine {
  --cell: 92px;
  display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 22px;
  background: linear-gradient(160deg, #5a0d14, #2a0509 60%, #4a0a12);
  border: 3px solid var(--gold); box-shadow: 0 0 30px rgba(232, 193, 90, 0.25), inset 0 0 30px rgba(0, 0, 0, 0.5);
}
.slot-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.slot-brand {
  font: 900 1.7rem "Brush Script MT", "Segoe Script", cursive, system-ui; color: #ffe9a8;
  text-shadow: 0 0 8px var(--gold), 0 0 22px #c0392b;
}
.slot-top { font-size: 0.85rem; font-weight: 700; color: #ffe9a8; text-transform: uppercase; letter-spacing: 0.06em; }
.slot-window {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 14px;
  background: #111; border: 3px solid #8a6414; box-shadow: inset 0 0 20px #000;
}
.slot-window.won { animation: slot-won 0.3s steps(1) 4; }
@keyframes slot-won { 50% { box-shadow: inset 0 0 20px #000, 0 0 0 4px #ffe066, 0 0 30px #ffe066; } }
.reel {
  position: relative; height: calc(var(--cell) * 3); overflow: hidden; border-radius: 8px;
  background: linear-gradient(#cfc8b8, #fffdf6 30%, #fffdf6 70%, #cfc8b8);
}
.reel::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0.45), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.45)); }
.strip { will-change: transform; }
.sym { height: var(--cell); display: grid; place-items: center; font-size: calc(var(--cell) * 0.55); line-height: 1; }
.sym-bar span {
  font: 900 calc(var(--cell) * 0.26) system-ui, sans-serif; color: #ffe9a8; letter-spacing: 0.04em;
  padding: 6px 10px; border-radius: 6px; background: #151515; border: 3px solid var(--gold);
}
.sym-seven span { font: italic 900 calc(var(--cell) * 0.7) Georgia, serif; color: #c0392b; text-shadow: 2px 2px 0 #7a1010, 0 0 2px #000; }
.sym.win span { animation: sym-win 0.5s ease-in-out 3; display: inline-block; }
@keyframes sym-win { 50% { transform: scale(1.18); filter: drop-shadow(0 0 10px #ffe066); } }
.payline {
  position: absolute; left: 4px; right: 4px; top: 50%; height: 0; border-top: 3px solid rgba(232, 60, 50, 0.85);
  box-shadow: 0 0 8px rgba(255, 80, 60, 0.9); pointer-events: none;
}
.slot-message { text-align: center; min-height: 1.5em; }
.slot-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.slot-bet { display: flex; flex-direction: column; gap: 6px; }
.slot-bet .label { font-size: 0.75rem; text-transform: uppercase; opacity: 0.75; }
.slot-bet .chip-btn { width: 44px; height: 44px; font-size: 0.75rem; }
.slot-bet .chip-btn.selected { transform: translateY(-4px) scale(1.06); outline: 3px solid var(--gold); outline-offset: 2px; }
.slot-buttons { display: flex; align-items: center; gap: 10px; }
.spin-btn { font-size: 1.15rem; padding: 14px 30px; border-radius: 999px; box-shadow: 0 0 18px rgba(232, 193, 90, 0.5); }
#slot-auto[aria-pressed="true"] { border-color: #ff9a8a; color: #ffb3a7; }
.paytable-note { margin: 6px 0; font-size: 0.85rem; opacity: 0.8; }
.paytable td { vertical-align: middle; }
.pay-combo { display: flex; gap: 6px; align-items: center; }
.sym.mini { --cell: 30px; width: 34px; height: 30px; font-size: 20px; }
.sym.mini.sym-bar span { padding: 1px 3px; border-width: 1px; font-size: 9px; }
.sym.mini.sym-seven span { font-size: 22px; text-shadow: 1px 1px 0 #7a1010; }
.sym-any { width: 34px; text-align: center; font-size: 0.7rem; opacity: 0.6; }
.pay-mult { font-weight: 800; color: var(--gold); text-align: right; }

@media (max-width: 600px) {
  .slot-machine { --cell: 70px; padding: 12px; }
  .card { width: 62px; height: 90px; margin-left: -28px; }
  .cards { min-height: 90px; padding-left: 28px; }
  .card .pip { font-size: 1.9rem; }
  .bj-felt { min-height: 360px; padding: 16px 10px; }
  .spin-btn { padding: 12px 22px; }
}
