:root {
  --bg: #0d0d0f;
  --bg-card: #17171b;
  --border: #2a2a30;
  --text: #e8e8ea;
  --muted: #8a8a92;
  --accent: #e0393e;
  --accent-hover: #ff4b50;
  --accent-glow: rgba(224, 57, 62, 0.35);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 14px 32px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

@keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  animation: pageFadeIn 0.35s var(--ease);
}

/* --- Header --- */

header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  background: rgba(13, 13, 15, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow 0.3s var(--ease);
}

header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow) 50%, transparent);
}

header.scrolled { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }

header .logo {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
}

header .logo-mark { flex-shrink: 0; filter: drop-shadow(0 0 6px var(--accent-glow)); }
header .logo span { color: var(--accent); transition: text-shadow 0.25s var(--ease); }
header .logo:hover span { text-shadow: 0 0 14px var(--accent-glow); }

.nav-center { justify-self: center; display: flex; align-items: center; gap: 32px; }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 24px; }

.nav-center a, .nav-right a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 2px;
  transition: color 0.2s var(--ease);
}

.nav-center a::after, .nav-right a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.nav-center a:hover, .nav-right a:hover { color: var(--text); }
.nav-center a:hover::after, .nav-right a:hover::after { transform: scaleX(1); }

.nav-center a.active { color: var(--text); font-weight: 600; }
.nav-center a.active::after { transform: scaleX(1); }

main { max-width: 1100px; margin: 0 auto; padding: 32px; }

h1 { font-size: 1.6rem; margin-bottom: 24px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.grid.posters {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.grid.room-cards {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.row-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  mask-image: linear-gradient(90deg, transparent, black 24px, black calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 24px, black calc(100% - 24px), transparent);
}

.row-scroll .card { width: 150px; flex-shrink: 0; scroll-snap-align: start; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: block;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.4s var(--ease);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.card:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.06s; }
.card:nth-child(4) { animation-delay: 0.08s; }
.card:nth-child(5) { animation-delay: 0.1s; }
.card:nth-child(6) { animation-delay: 0.12s; }
.card:nth-child(7) { animation-delay: 0.14s; }
.card:nth-child(8) { animation-delay: 0.16s; }
.card:nth-child(9) { animation-delay: 0.18s; }
.card:nth-child(10) { animation-delay: 0.2s; }
.card:nth-child(11) { animation-delay: 0.22s; }
.card:nth-child(12) { animation-delay: 0.24s; }

.card .poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: #0a0a0c;
  display: block;
  transition: transform 0.35s var(--ease);
}

.card:hover .poster { transform: scale(1.06); }

.card .body { padding: 12px 14px; }

.card .title { font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; line-height: 1.3; }

.card .meta { font-size: 0.78rem; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }

.card .rating { color: #f0c96b; font-weight: 600; }

/* Bouton retirer (watchlist / historique) : discret, visible au survol de la carte. */
.card-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(13, 13, 15, 0.8);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.card:hover .card-remove { opacity: 1; transform: scale(1); }
.card-remove:hover { background: var(--accent); border-color: var(--accent); }
.card-remove:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Squelettes de chargement --- */

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skel-shimmer {
  background: linear-gradient(100deg, var(--bg-card) 30%, #26262c 50%, var(--bg-card) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.card.skeleton { pointer-events: none; animation: fadeInUp 0.3s var(--ease); }
.card.skeleton .poster { background: none; }
.card.skeleton .skel-line { height: 10px; border-radius: 4px; margin-bottom: 8px; }
.card.skeleton .skel-line:last-child { width: 40%; margin-bottom: 0; }

.empty { color: var(--muted); padding: 40px 0; text-align: center; }

.player-wrap {
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

video { width: 100%; display: block; max-height: 70vh; background: #000; }

.player-wrap iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  border: 0;
  background: #000;
}

/* Page Chaines : onglets categories + grille de chaines + lecteur inline. */
.channel-tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }

.channel-tabs button {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
}

.channel-tabs button:hover { background: var(--bg-card); box-shadow: none; color: var(--text); }
.channel-tabs button.active { background: rgba(255, 255, 255, 0.04); border-color: var(--accent); color: var(--accent); }

.channel-card {
  background: linear-gradient(160deg, var(--bg-card), #101013 120%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 118px;
  text-align: center;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: fadeInUp 0.4s var(--ease) backwards;
}

.channel-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.channel-card:hover .channel-icon { background: var(--accent-glow); transform: scale(1.08); }

.channel-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.channel-card .channel-title { font-weight: 600; font-size: 0.88rem; line-height: 1.3; }

.channel-player { position: sticky; top: 76px; z-index: 5; margin-bottom: 24px; }
.channel-player .player-wrap { margin-bottom: 12px; }

/* Page Matchs : cartes match (equipes/tournoi) + lecteur video natif (HLS.js, pas d'iframe). */
.live-match-card {
  background: linear-gradient(160deg, var(--bg-card), #101013 130%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: fadeInUp 0.4s var(--ease) backwards;
}

.live-match-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.live-match-card:hover .sport-badge { background: var(--accent-glow); transform: scale(1.08); }

.live-match-card .live-match-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.live-match-card .meta-left { display: flex; align-items: center; gap: 8px; }

.sport-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.live-match-card .sport-name { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

.live-match-card .live-badge { color: var(--accent); font-weight: 700; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 5px; }
.live-match-card .live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); animation: pulseLive 1.6s ease-in-out infinite; }

@keyframes pulseLive {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-glow); }
  50% { box-shadow: 0 0 0 5px transparent; }
}

.live-match-card .live-match-tournament { font-size: 0.76rem; color: var(--muted); margin-bottom: 10px; text-align: center; }
.live-match-card .live-match-teams { font-weight: 700; font-size: 1rem; text-align: center; line-height: 1.4; }
.live-match-card .live-match-teams .vs {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  margin: 0 8px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  vertical-align: middle;
}

.live-match-card .live-match-score {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent);
}
.live-match-card .live-match-clock { font-weight: 500; font-size: 0.72rem; color: var(--muted); }

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.back-link:hover { color: var(--text); }

form.stack { display: flex; flex-direction: column; gap: 12px; max-width: 480px; }

label { font-size: 0.85rem; color: var(--muted); }

input[type="text"], input[type="password"], input[type="url"] {
  background: #0a0a0c;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s var(--ease), transform 0.1s var(--ease), box-shadow 0.2s var(--ease);
}

button:hover { background: var(--accent-hover); }
button:not(.secondary):not(:disabled):hover { box-shadow: 0 0 16px var(--accent-glow); }
button:active:not(:disabled) { transform: scale(0.97); }

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

button.secondary:hover { color: var(--text); border-color: var(--text); }

button:disabled { opacity: 0.5; cursor: not-allowed; }

button.danger {
  background: transparent;
  border: 1px solid #7a2c2c;
  color: #e07070;
  box-shadow: none;
}
button.danger:hover { background: rgba(200, 60, 60, 0.12); border-color: #e07070; color: #fff; box-shadow: none; }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

@keyframes slideFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.msg.error { background: #3a1418; color: #ff8a8f; border: 1px solid #5a2027; animation: shake 0.4s var(--ease); }
.msg.ok { background: #12321c; color: #7ee2a0; border: 1px solid #1e4a2c; animation: slideFadeIn 0.3s var(--ease); }

table { width: 100%; border-collapse: collapse; margin-top: 24px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
th { color: var(--muted); font-weight: 600; }

.badge { padding: 2px 8px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; }
.badge.ok { background: #12321c; color: #7ee2a0; }
.badge.error { background: #3a1418; color: #ff8a8f; }
.badge.pending { background: #332a12; color: #f0c96b; }

.row-actions button { padding: 5px 10px; font-size: 0.8rem; margin-right: 6px; }

.avatar-picker { display: flex; flex-wrap: wrap; gap: 10px; }

.avatar-opt {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.avatar-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-opt:hover { border-color: var(--text); transform: scale(1.06); }
.avatar-opt.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.nav-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 6px;
  transition: box-shadow 0.2s var(--ease);
}

a:hover .nav-avatar { box-shadow: 0 0 0 2px var(--accent); }

.login-box {
  max-width: 360px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
}

/* --- Recherche centrale (accueil) --- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 70px 32px 40px;
  text-align: center;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse 60% 60% at 50% 20%, rgba(224, 57, 62, 0.18), transparent 70%);
  animation: pulseGlow 6s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.hero p.tagline {
  color: var(--muted);
  margin-bottom: 28px;
}

.search-box {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.05rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }

section.block { margin-bottom: 40px; }

section.block h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

section.block h2::before {
  content: "";
  width: 4px;
  height: 15px;
  background: var(--accent);
  flex-shrink: 0;
}

.see-all {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}

.see-all:hover { color: var(--accent); }

/* --- Fiche film / serie --- */

.movie-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 320px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-end;
}

@keyframes kenBurns {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.movie-hero .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  z-index: 0;
  animation: kenBurns 20s ease-in-out infinite alternate;
}

.movie-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(13, 13, 15, 0.25) 0%, rgba(13, 13, 15, 0.97) 100%);
}

.movie-hero .inner {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 24px;
  padding: 28px;
  align-items: flex-end;
  width: 100%;
}

.movie-hero .poster-lg {
  width: 140px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  flex-shrink: 0;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: #0a0a0c;
}

.movie-hero .info h1 { font-size: 1.8rem; margin: 0 0 8px; }

.movie-hero .info .sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.movie-hero .info .rating { color: #f0c96b; font-weight: 700; }

.genre-tag {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.78rem;
  color: var(--muted);
}

.overview { max-width: 720px; line-height: 1.6; color: var(--text); margin-bottom: 28px; }

.cast-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.cast-item { flex-shrink: 0; width: 100px; text-align: center; }

.cast-item img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card);
  margin-bottom: 6px;
  transition: transform 0.25s var(--ease);
}

.cast-item:hover img { transform: scale(1.08); }

.cast-item .name { font-size: 0.8rem; font-weight: 600; }
.cast-item .character { font-size: 0.75rem; color: var(--muted); }

.action-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  max-width: 480px;
  margin-bottom: 32px;
}

.action-box p { color: var(--muted); font-size: 0.9rem; margin-top: 0; }

/* --- Page Casino : lobby, table de jeu, classement --- */

.casino-room-card {
  background: linear-gradient(160deg, var(--bg-card), #101013 130%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
  animation: fadeInUp 0.4s var(--ease) backwards;
}

.casino-room-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.casino-room-card .room-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.casino-room-card .room-name { font-weight: 700; font-size: 1rem; }
.casino-room-card .room-lock { color: var(--muted); }
.casino-room-card .room-host { color: var(--muted); font-size: 0.8rem; margin-bottom: 10px; }
.casino-room-card .room-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--border); }
.casino-room-card .room-players { font-weight: 700; color: var(--accent); }

.wallet-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th, .leaderboard-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.leaderboard-table th { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; }
.leaderboard-table tr:hover td { background: rgba(255, 255, 255, 0.02); }
.leaderboard-table .lb-rank { color: var(--muted); font-weight: 700; width: 40px; }
.leaderboard-table .lb-balance { color: var(--accent); font-weight: 700; text-align: right; }
.leaderboard-table .lb-player { display: flex; align-items: center; gap: 10px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeInUp 0.15s var(--ease);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 320px;
  box-shadow: var(--shadow-lift);
}

.modal h3 { margin: 0 0 14px; font-size: 1.05rem; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .modal-actions button { flex: 1; }


/* Modale "Creer un salon" */
.modal.modal-wide { width: 420px; max-width: calc(100vw - 40px); }

.room-form { display: flex; flex-direction: column; gap: 16px; }
.room-form label { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--muted); }
.room-form input[type="text"] { flex: 1; max-width: 220px; }

/* Cartes de salon (nouveau design) */
.room-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 30%, rgba(224, 167, 45, 0.2), rgba(224, 167, 45, 0.04));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.room-icon svg { width: 32px; height: 32px; }

.room-card-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.room-card-info { flex: 1; min-width: 0; padding-top: 4px; }
.room-card-info .room-name { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.room-status { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #4ade80; margin-bottom: 8px; }
.room-status .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 6px #4ade80; }
.room-players-line { font-size: 0.82rem; color: var(--muted); }

.room-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.room-host-line { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-card-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.room-card-actions .danger { padding: 9px 18px; font-size: 0.85rem; }
.join-btn {
  padding: 10px 22px;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  box-shadow: none;
}
.join-btn:hover { background: var(--accent); color: #1a1204; box-shadow: none; }

.casino-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  animation: fadeInUp 0.4s var(--ease);
}
.casino-empty-state .room-icon { width: 72px; height: 72px; margin: 0 auto 20px; }
.casino-empty-state .room-icon svg { width: 36px; height: 36px; }
.casino-empty-state h3 { color: var(--text); font-size: 1.15rem; margin: 0 0 8px; }
.casino-empty-state p { font-size: 0.88rem; margin: 0 0 20px; }

/* ===== Table de blackjack (casino-table.html) ===== */
body.bj-page main { max-width: 1560px; padding: 18px 32px 32px; }

.bj-header-center { justify-self: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bj-title { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.2px; }
.bj-mode-pill { background: rgba(224, 167, 45, 0.12); color: var(--accent); border-radius: 999px; padding: 3px 16px; font-size: 0.85rem; font-weight: 700; }
.bj-header-right { justify-self: end; display: flex; align-items: center; gap: 12px; }
.bj-header-right button.danger { padding: 10px 18px; font-size: 0.85rem; border-radius: var(--radius-md); }
.bj-quit {
  display: inline-flex;
  align-items: center;
  background: #1c1c20;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s var(--ease);
}
.bj-quit:hover { background: #26262b; }

.bj-layout { display: flex; flex-direction: column; gap: 18px; max-width: 1200px; margin: 0 auto; }
.bj-stage { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.bj-table {
  position: relative;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 38%, #1c1c20 0%, #121214 58%, #0c0c0e 100%);
  border: 1px solid #2e2b25;
  box-shadow: inset 0 0 0 12px #111113, inset 0 0 0 13px rgba(224, 167, 45, 0.16), 0 30px 60px rgba(0, 0, 0, 0.5);
  padding: 26px 56px 30px;
}

/* Croupier */
.bj-dealer { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bj-dealer-head { display: flex; align-items: center; gap: 18px; }
.bj-dealer-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: radial-gradient(circle at 50% 35%, #2a2a2e, #141416);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 22px rgba(224, 167, 45, 0.18);
}
.bj-dealer-avatar svg { width: 66px; height: 66px; }
.bj-dealer-name { font-size: 1.25rem; font-weight: 700; }
.bj-dealer-total { color: var(--accent); font-weight: 700; font-size: 1.15rem; margin-top: 6px; }
.bj-rule { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.92rem; margin-top: 2px; }
.bj-rule::before, .bj-rule::after { content: ""; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
.bj-rule::after { transform: scaleX(-1); }

/* Cartes */
.bj-cards { display: flex; justify-content: center; gap: 6px; }
.bj-dealer .bj-cards { gap: 12px; min-height: 110px; }
.bj-cards.stacked .bj-card + .bj-card { margin-left: -30px; }
.bj-card {
  position: relative;
  width: 58px;
  height: 84px;
  border-radius: 7px;
  background: #fbfbfc;
  color: #16161a;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}
.bj-card.red { color: #d32f2f; }
.bj-card .c-corner { position: absolute; top: 5px; left: 6px; display: flex; flex-direction: column; align-items: center; line-height: 1; font-weight: 800; font-size: 0.9rem; }
.bj-card .c-corner small { font-size: 0.78rem; margin-top: 1px; }
.bj-card .c-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; padding-top: 12px; }
.bj-card .c-center.face { font-family: Georgia, serif; font-weight: 700; font-size: 1.7rem; }
.bj-card.back { background: #141416; border: 2px solid var(--accent); }
.bj-card.back .c-back { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.bj-card.back .c-back span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.bj-dealer .bj-card { width: 76px; height: 110px; border-radius: 9px; }
.bj-dealer .bj-card .c-corner { font-size: 1.15rem; top: 7px; left: 8px; }
.bj-dealer .bj-card .c-corner small { font-size: 1rem; }
.bj-dealer .bj-card .c-center { font-size: 2.5rem; }
.bj-dealer .bj-card .c-center.face { font-size: 2.4rem; }

/* Places */
.bj-seats { display: flex; justify-content: safe center; gap: 6px; margin-top: 18px; padding: 0 4px 4px; }
.bj-seat {
  flex: 0 0 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 16px;
  border-radius: 24px;
  position: relative;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.bj-seat.turn { background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)); box-shadow: 0 0 0 1px rgba(224, 167, 45, 0.28); }
.bj-seat-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.bj-seat-name { font-size: 1.05rem; font-weight: 700; max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bj-seat.empty .bj-seat-name { font-weight: 500; color: #cfcfd3; }
.bj-seat-name .off { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.bj-seat-total { color: var(--accent); font-size: 1.6rem; font-weight: 800; line-height: 1; min-height: 1.6rem; }
.bj-seat-total.bust, .bj-hand-total.bust { color: #ff6b6b; }
.bj-seat-waiting { color: var(--muted); font-size: 0.82rem; min-height: 88px; display: flex; align-items: center; text-align: center; }
.bj-hands { display: flex; gap: 10px; }
.bj-hand { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 3px; border-radius: 10px; }
.bj-hand.active { box-shadow: 0 0 0 2px var(--accent); }
.bj-hand-total { color: var(--accent); font-weight: 800; font-size: 0.95rem; }
.bj-hands.multi .bj-card { width: 44px; height: 64px; }
.bj-hands.multi .bj-card .c-center { font-size: 1.4rem; }

button.bj-join {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid rgba(224, 167, 45, 0.7);
  background: transparent;
  color: var(--accent);
  font-weight: 700;
  font-size: 1rem;
  padding: 0;
  margin: 6px 0;
}
button.bj-join:not(:disabled):hover { background: rgba(224, 167, 45, 0.08); box-shadow: 0 0 22px var(--accent-glow); }
button.bj-join:disabled { opacity: 0.35; cursor: default; }
.bj-behind { font-size: 0.75rem; color: var(--muted); text-align: center; }
.bj-behind b { color: var(--accent); }
button.bj-link { background: none; border: none; padding: 2px 4px; color: var(--muted); font-size: 0.78rem; text-decoration: underline; text-underline-offset: 3px; }
button.bj-link:not(:disabled):hover { background: none; color: var(--accent); box-shadow: none; }

/* Jetons */
.bj-chip {
  --chip-c: var(--accent);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle, #19191c 0 56%, transparent 57%),
    repeating-conic-gradient(var(--chip-c) 0 15deg, #19191c 15deg 30deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(0, 0, 0, 0.35);
  color: var(--chip-c);
  font-weight: 800;
  font-size: 0.72rem;
  transition: transform 0.15s var(--ease);
}
.bj-chip::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1.5px solid var(--chip-c); opacity: 0.8; }
.bj-chip .star { font-size: 0.95rem; line-height: 1; }
.bj-chip.muted { --chip-c: #55555c; }
.bj-chip.lg { width: 58px; height: 58px; font-size: 0.85rem; }
.bj-chip.lg::before { inset: 10px; }
button.bj-chip-btn { background: none; border: none; padding: 0; box-shadow: none; border-radius: 50%; }
button.bj-chip-btn:not(:disabled):hover { background: none; box-shadow: none; }
button.bj-chip-btn:not(:disabled):hover .bj-chip { transform: translateY(-5px); }
button.bj-chip-btn:disabled { opacity: 0.3; }

/* Barre d'actions */
.bj-actions { display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; min-height: 80px; }
button.bj-btn { display: inline-flex; align-items: center; gap: 12px; padding: 20px 44px; font-size: 1.25rem; font-weight: 700; border-radius: 14px; }
button.bj-btn svg { width: 26px; height: 26px; }
button.bj-btn.gold { background: var(--accent); color: #17120a; }
button.bj-btn.gold:not(:disabled):hover { background: var(--accent-hover); }
button.bj-btn.dark { background: #1c1c20; color: var(--text); border: 1px solid var(--border); }
button.bj-btn.dark:not(:disabled):hover { background: #26262b; box-shadow: none; }
button.bj-btn.small { padding: 14px 24px; font-size: 1.05rem; }
.bj-x2 { width: 28px; height: 28px; border-radius: 50%; background: #f4f4f6; color: #111; font-size: 0.78rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.bj-status { color: var(--muted); font-size: 1rem; background: #141417; border: 1px solid var(--border); border-radius: 999px; padding: 14px 28px; }
.bj-status b { color: var(--accent); }

/* Mises (phase de mises / assurance) */
.bj-betbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; width: 100%; }
.bj-rail { display: flex; gap: 8px; align-items: center; padding: 8px 14px; background: #101013; border: 1px solid var(--border); border-radius: 999px; flex-wrap: wrap; justify-content: center; }
.bj-bet-actions { display: flex; gap: 10px; }
.bj-bet-actions [data-place], .bj-bet-actions [data-confirm] { min-width: 170px; justify-content: center; }

/* Popover "parier derriere" */
.bj-pop {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  width: 280px;
  background: #151518;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.bj-pop.fresh { animation: fadeInUp 0.15s var(--ease); }
.bj-pop .pop-title { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.bj-pop .pop-total { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.bj-pop .bj-rail { padding: 8px 12px; gap: 8px; border-radius: 16px; }
.bj-pop .bj-chip { width: 38px; height: 38px; font-size: 0.64rem; }
.bj-pop .bj-chip::before { inset: 6px; }
.bj-pop-actions { display: flex; gap: 8px; width: 100%; }
.bj-pop-actions button { flex: 1; padding: 9px 12px; font-size: 0.88rem; }

.bj-toasts { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.bj-toasts .msg { box-shadow: var(--shadow-lift); font-weight: 600; padding: 12px 20px; }

@media (max-width: 760px) {
  body.bj-page main { padding: 16px 12px 32px; }
  .bj-table { border-radius: 36px; padding: 24px 12px 30px; }
  .bj-seats { flex-wrap: wrap; }
  .bj-seat { flex-basis: 112px; }
  button.bj-join { width: 84px; height: 84px; font-size: 0.9rem; }
  button.bj-btn { padding: 16px 26px; font-size: 1.05rem; }
  .bj-header-right .danger { display: none; }
}

/* Cases de mise sur le tapis (Mise / PP / 21+3) */
.bj-felt-spots { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 2px; }
.bj-fspot {
  border-radius: 50%;
  border: 1.5px dashed rgba(224, 167, 45, 0.35);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(224, 167, 45, 0.55);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: background 0.15s var(--ease), box-shadow 0.15s var(--ease), border-color 0.15s var(--ease);
}
.bj-fspot.main { width: 58px; height: 58px; font-size: 0.68rem; }
.bj-fspot.side { width: 38px; height: 38px; }
.bj-fspot.filled { border-color: transparent; background: none; }
.bj-fspot.editable { cursor: pointer; border-color: rgba(224, 167, 45, 0.8); color: var(--accent); }
.bj-fspot.editable:hover { background: rgba(224, 167, 45, 0.1); box-shadow: 0 0 14px var(--accent-glow); }
.bj-fspot.editable.filled:hover { background: rgba(224, 167, 45, 0.08); }
.bj-fspot.main .bj-chip { width: 52px; height: 52px; font-size: 0.74rem; }
.bj-fspot.side .bj-chip { width: 34px; height: 34px; font-size: 0.56rem; }
.bj-fspot.side .bj-chip::before { inset: 5px; }
.bj-fspot.drop .bj-chip { animation: chipDrop 0.28s var(--ease); }
@keyframes chipDrop { 0% { transform: translateY(-18px) scale(1.15); opacity: 0.4; } 70% { transform: translateY(2px) scale(0.97); } 100% { transform: none; opacity: 1; } }

/* Jeton selectionne dans le rail */
button.bj-chip-btn.selected .bj-chip { transform: translateY(-6px); box-shadow: 0 0 0 3px #f4f4f6, 0 0 18px var(--accent-glow); }
button.bj-chip-btn.selected:not(:disabled):hover .bj-chip { transform: translateY(-6px); }

.bj-hint { width: 100%; text-align: center; color: var(--muted); font-size: 0.85rem; }
.bj-hint b { color: var(--accent); }
.bj-ins-row { display: flex; align-items: center; gap: 12px; }
.bj-ins-seat { color: var(--muted); font-weight: 700; min-width: 70px; }

/* Quitter une place */
button.bj-leave {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  background: #1c1c20;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
}
button.bj-leave:not(:disabled):hover { background: #3a1418; color: #ff8a8f; box-shadow: none; }

/* Plaque joueur sous la main */
.bj-nameplate {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 124px;
  margin-top: 4px;
  padding: 3px 10px 3px 3px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
}
.bj-nameplate.me { border-color: rgba(224, 167, 45, 0.6); }
.bj-nameplate.off { opacity: 0.5; }
.bj-nameplate img, .bj-nameplate .ini { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.bj-nameplate .ini { background: #26262b; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 800; }
.bj-nameplate .np-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.bj-nameplate .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bj-nameplate .bal { color: var(--accent); font-size: 0.72rem; font-weight: 700; }

/* Mise perdue : le jeton part vers le croupier */
.bj-fspot.lose .bj-chip { animation: chipAway 0.6s ease-in forwards; }
@keyframes chipAway {
  0% { transform: none; opacity: 1; }
  25% { transform: translateY(4px) scale(1.05); opacity: 1; }
  100% { transform: translateY(-90px) scale(0.5); opacity: 0; }
}

/* Mise gagnee : le jeton brille pendant que son montant monte */
.bj-fspot.win .bj-chip { animation: chipWin 1.1s ease-in-out infinite alternate; }
@keyframes chipWin {
  from { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), 0 0 0 0 rgba(224, 167, 45, 0); transform: scale(1); }
  to { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55), 0 0 18px 4px rgba(224, 167, 45, 0.55); transform: scale(1.08); }
}

/* Effets au-dessus de la table (blackjack) */
.bj-fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 15; overflow: visible; }
.bj-burst {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: #17120a;
  background: linear-gradient(135deg, #ffd978, var(--accent) 55%, #b77f14);
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 0 40px rgba(224, 167, 45, 0.7);
  animation: bjBurst 2.2s var(--ease) forwards;
}
@keyframes bjBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(-8deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(3deg); }
  24% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(0.9); }
}

/* Gros gain au centre de l'ecran */
#winOverlay { display: none; }
#winOverlay.show {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0) 60%);
  animation: winFade 3.2s ease forwards;
}
.bj-win-box { text-align: center; animation: winPop 0.6s var(--ease); }
.bj-win-box .lbl { color: #f4f4f6; font-size: 1.3rem; font-weight: 700; text-transform: uppercase; letter-spacing: 4px; }
.bj-win-box .amt {
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 900;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffe39a, var(--accent) 60%, #b77f14);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(224, 167, 45, 0.55));
  font-variant-numeric: tabular-nums;
}
@keyframes winPop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes winFade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* Distribution : la carte part du sabot et glisse jusqu'a sa place */
.bj-card.deal { position: relative; z-index: 20; animation: cardFly 450ms cubic-bezier(0.22, 0.8, 0.3, 1) both; }
@keyframes cardFly {
  0% { transform: translate(var(--fx, 0px), var(--fy, -260px)) rotate(-20deg) scale(0.7); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
/* Carte cachee du croupier qui se retourne */
.bj-card.flip { animation: cardFlip 450ms ease both; }
@keyframes cardFlip {
  0% { transform: perspective(700px) rotateY(90deg); }
  100% { transform: perspective(700px) rotateY(0deg); }
}

/* Sabot a cartes a droite du croupier */
.bj-shoe {
  position: absolute;
  top: 34px;
  left: calc(50% + 230px);
  width: 58px;
  height: 80px;
  border-radius: 8px;
  background: #141416;
  border: 2px solid var(--accent);
  transform: rotate(8deg);
  box-shadow: 3px 3px 0 #0c0c0e, 4px 4px 0 rgba(224, 167, 45, 0.5), 7px 7px 0 #0c0c0e, 8px 8px 0 rgba(224, 167, 45, 0.3), 0 10px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.bj-shoe::after {
  content: "★";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.2rem;
}
@media (max-width: 760px) { .bj-shoe { left: auto; right: 18px; top: 18px; transform: scale(0.8) rotate(8deg); } }

/* Phase de jeu au-dessus de la table */
.bj-phasebar {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #141417;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.95rem;
}
.bj-phasebar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.bj-phasebar.live .dot { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.bj-phasebar .timer { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Bas de table : solde + mise totale a gauche, actions au centre */
.bj-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.bj-mystats {
  justify-self: start;
  display: flex;
  gap: 22px;
  background: #141417;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 20px;
}
.bj-mystats .bj-stat .label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; white-space: nowrap; }
.bj-mystats .bj-stat .value { font-size: 1.25rem; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bj-mystats .bj-stat .value.accent { color: var(--accent); }
@media (max-width: 1100px) {
  .bj-bottom { grid-template-columns: 1fr; justify-items: center; }
  .bj-bottom > div:last-child { display: none; }
  .bj-mystats { justify-self: center; }
}

/* Piece du casino (coins) */
.coin {
  display: inline-block;
  width: 0.82em;
  height: 0.82em;
  margin-left: 0.22em;
  vertical-align: -0.08em;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1a6 0%, #f5c542 45%, #d39a17 75%, #a8740f 100%);
  box-shadow: inset 0 0 0 1.5px rgba(122, 82, 0, 0.55), inset 0 0 0 3px rgba(255, 230, 140, 0.35), 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Bouton son + volume (apparait au survol) */
.bj-sound { display: flex; align-items: center; flex-direction: row-reverse; gap: 0; }
button.bj-sound-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c1c20;
  border: 1px solid var(--border);
  color: var(--accent);
  box-shadow: none;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
button.bj-sound-btn svg { width: 20px; height: 20px; transition: transform 0.25s var(--ease); }
button.bj-sound-btn.muted { color: var(--muted); }
.bj-sound:hover button.bj-sound-btn { background: #26262b; border-color: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.bj-sound:hover button.bj-sound-btn svg { animation: speakerPulse 0.6s var(--ease); }
@keyframes speakerPulse { 0% { transform: scale(1); } 40% { transform: scale(1.22) rotate(-8deg); } 100% { transform: scale(1); } }

.bj-sound-slider {
  width: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: width 0.3s var(--ease), opacity 0.25s var(--ease), margin 0.3s var(--ease);
}
.bj-sound:hover .bj-sound-slider, .bj-sound:focus-within .bj-sound-slider { width: 120px; opacity: 1; margin-right: 10px; }
.bj-sound-slider input[type="range"] {
  --fill: 70%;
  width: 110px;
  margin: 0 5px;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill), #2e2e34 var(--fill));
  cursor: pointer;
  outline: none;
}
.bj-sound-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  transition: transform 0.15s var(--ease);
}
.bj-sound-slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.bj-sound-slider input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #f4f4f6;
  border: 2px solid var(--accent);
}

