/* ============================================================
   LA TABLE — Feuille de styles
   ============================================================ */

/* ------------------------------------------------------------
   1. Variables & Reset
   ------------------------------------------------------------ */

:root {
  --ink: #e9f3ec;
  --muted: #91a69a;
  --line: #284137;
  --bg: #07110e;
  --panel: #0d1c17;
  --felt: #164d3b;
  --gold: #e5b76a;
  --coral: #f07167;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }

/* ⚠️ Règle critique : l'attribut hidden doit TOUJOURS cacher */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 15%, #17342a 0, #07110e 45%);
}

button, input { font: inherit; }

/* ------------------------------------------------------------
   2. Topbar (barre du haut)
   ------------------------------------------------------------ */

.topbar {
  height: 70px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 clamp(18px, 4vw, 64px);
  gap: 24px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .15em;
  font-size: 15px;
}

.brand span {
  color: var(--gold);
  font-size: 23px;
  vertical-align: -2px;
  margin-right: 5px;
}

.room-code {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
}

.room-code strong {
  color: var(--ink);
  letter-spacing: .08em;
  margin-left: 5px;
}

.live-dot,
.turn-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #56d99b;
  margin-right: 7px;
  box-shadow: 0 0 8px #56d99b;
}

/* ------------------------------------------------------------
   3. Boutons Discord / Auth
   ------------------------------------------------------------ */

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discord-button,
.share-discord {
  border: 0;
  background: #5865f2;
  color: #fff;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.discord-button span { padding-left: 5px; }

.logout-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: .18s;
}

.logout-button:hover {
  color: var(--ink);
  border-color: #a9824e;
}

.user-balance {
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(229, 183, 106, 0.1);
  border: 1px solid rgba(229, 183, 106, 0.3);
  letter-spacing: 0.02em;
}

/* ------------------------------------------------------------
   4. Hub (page d'accueil)
   ------------------------------------------------------------ */

.hub {
  max-width: 1060px;
  margin: 0 auto;
  padding: 70px clamp(18px, 4vw, 64px) 34px;
}

.hub-hero {
  text-align: center;
  max-width: 630px;
  margin: 0 auto 55px;
}

.hub-hero h1 { font-size: clamp(34px, 6vw, 58px); }

.hub-hero > p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
  margin: 15px auto 23px;
  max-width: 470px;
}

.create-room {
  background: var(--gold);
  border: 0;
  color: #19251e;
  font-weight: 800;
  border-radius: 8px;
  padding: 12px 17px;
  cursor: pointer;
}

.hub-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 16px;
}

.hub-heading h2 { font-size: 19px; margin: 0 0 4px; }
.hub-heading p  { font-size: 13px; color: var(--muted); margin: 0; }

.online-count { font-size: 12px; color: #b8d5c4; }

.online-count i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5bdc9b;
  margin-right: 5px;
}

.room-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.room-tile {
  position: relative;
  text-align: left;
  background: #10251d;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 17px;
  min-height: 170px;
  cursor: pointer;
  color: var(--ink);
  transition: transform .18s, border-color .18s;
}

.room-tile:hover {
  transform: translateY(-3px);
  border-color: #a9824e;
}

.tile-icon {
  width: 33px;
  height: 33px;
  border-radius: 8px;
  background: #245840;
  display: grid;
  place-items: center;
  color: var(--gold);
  margin-bottom: 21px;
}

.room-tile h3 { font-size: 16px; margin: 0 0 5px; }
.room-tile p  { font-size: 12px; color: var(--muted); margin: 0; }

.room-meta {
  position: absolute;
  bottom: 15px;
  left: 17px;
  right: 17px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #c6dcce;
}

.room-meta strong { color: #62d99b; }

.empty-room {
  border-style: dashed;
  background: transparent;
  display: grid;
  place-items: center;
  text-align: center;
  color: #a3c5b1;
}

.empty-room .tile-icon { margin: 0 0 8px; }

.how-it-works {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: #9dbbaa;
  font-size: 12px;
  margin: 50px 0 0;
}

.how-it-works b { color: var(--gold); }

/* ------------------------------------------------------------
   5. Lobby (écran avant la partie)
   ------------------------------------------------------------ */

.lobby {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 70px);
  padding: 40px 20px;
}

.lobby-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.lobby-card h1 { font-size: 26px; margin: 8px 0; }

.lobby-room-code {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.lobby-room-code strong { color: var(--gold); letter-spacing: .08em; }

.lobby-players {
  text-align: left;
  background: #07130f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 24px;
}

.lobby-players h3 {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .11em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

.lobby-players ul { list-style: none; padding: 0; margin: 0; }

.lobby-players li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink);
}

.lobby-players li::before {
  content: "●";
  color: #5bdc9b;
  font-size: 10px;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-actions .create-room { padding: 14px 20px; font-size: 14px; cursor: pointer; }
.lobby-actions .logout-button { padding: 12px; cursor: pointer; }

.lobby-hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 22px;
  line-height: 1.5;
}

/* ------------------------------------------------------------
   6. Game (table de poker)
   ------------------------------------------------------------ */

main {
  max-width: 1440px;
  margin: auto;
  padding: 28px clamp(18px, 4vw, 64px) 18px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: .14em;
  margin: 0 0 7px;
}

h1 { font-size: 26px; margin: 0; letter-spacing: -.03em; }

.header-actions { display: flex; gap: 8px; }

.ghost-button,
.icon-button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
}

.icon-button { font-size: 18px; padding: 5px 10px; }

.table-layout {
  display: grid;
  grid-template-columns: 190px minmax(500px, 1fr) 245px;
  gap: 18px;
}

.left-panel,
.right-panel {
  background: rgba(13, 28, 23, .86);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px;
  height: fit-content;
}

.panel-title {
  font-size: 11px;
  letter-spacing: .11em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* --- Liste des joueurs --- */

.player-list { display: grid; gap: 9px; }

.player {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border-radius: 8px;
}

.player.is-turn { background: #18392d; }
.player.folded  { opacity: 0.45; }

.player div:nth-child(2) { min-width: 0; flex: 1; }

.player b,
.player small { display: block; font-size: 12px; }
.player small { font-size: 11px; color: var(--muted); margin-top: 2px; }

.player .bet { color: var(--gold); font-weight: 600; }
.player .folded-label { color: var(--coral); font-style: italic; }

.avatar,
.empty-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex: none;
  overflow: hidden;   /* 🆕 pour que l'image ne dépasse pas */
  position: relative;   /* 🆕 pour le positionnement de l'image */

}

.green  { background: #2ca66a; }
.orange { background: #ce7844; }
.purple { background: #8066cb; }
.blue   { background: #4682bd; }

.status-dot {
  width: 6px;
  height: 6px;
  background: #5bdc9b;
  border-radius: 50%;
}

.invite-button {
  width: 100%;
  border: 1px dashed #466556;
  color: #a5c7b4;
  background: transparent;
  border-radius: 7px;
  padding: 9px;
  margin-top: 14px;
  cursor: pointer;
}

/* --- Table --- */

.poker-table { min-width: 0; }

.felt {
  height: 500px;
  border: 13px solid #7c5532;
  border-radius: 46%;
  position: relative;
  background: radial-gradient(ellipse at center, #24684e, #123e30);
  box-shadow: inset 0 0 0 5px #a2784c, inset 0 0 65px #061e16, 0 14px 40px #0008;
}

.felt:after {
  content: "";
  position: absolute;
  inset: 17px;
  border: 1px solid #75a18c55;
  border-radius: 44%;
  pointer-events: none;
}

.table-logo {
  position: absolute;
  top: 31%;
  left: 0;
  right: 0;
  text-align: center;
  color: #d7eadc50;
  letter-spacing: .23em;
}

.table-logo span { font-size: 43px; display: block; line-height: .8; }
.table-logo small { font-size: 10px; }

.round-label {
  position: absolute;
  top: 43%;
  left: 0;
  right: 0;
  text-align: center;
  color: #a4cbb6;
  font-size: 10px;
  letter-spacing: .15em;
}

.community-cards {
  position: absolute;
  z-index: 1;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 7px;
}

.card {
  height: 62px;
  width: 43px;
  background: #f8f6ed;
  border-radius: 5px;
  color: #18221d;
  padding: 4px;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: bold;
  box-shadow: 0 2px 5px #0008;
}

.card.red { color: #c94740; }
.card.blank { background: #d7e0d8; }

.pot {
  position: absolute;
  top: 62%;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--gold);
}

.pot small { font-size: 9px; letter-spacing: .14em; display: block; color: #b8cfbf; }
.pot strong { font-size: 18px; margin-right: 4px; }
.pot span { font-size: 11px; }

/* --- Sièges --- */

.seat {
  z-index: 2;
  position: absolute;
  text-align: center;
  min-width: 78px;
  color: white;
}

.seat .avatar { margin: 0 auto 4px; border: 2px solid #bad7c4; }
.seat b, .seat small { display: block; font-size: 12px; }
.seat small { color: #d3e7dc; font-size: 11px; margin-top: 2px; }
.seat em { font-style: normal; color: #d4ae64; font-size: 9px; }

.seat i {
  display: block;
  background: #e4b568;
  color: #19271f;
  font-weight: bold;
  font-style: normal;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 9px;
  margin-top: 5px;
}

.seat-top          { top: 7%; left: 50%; transform: translateX(-50%); }
.seat-right        { right: 7%; top: 34%; }
.seat-bottom-right { right: 17%; bottom: 7%; }
.seat-bottom       { bottom: 1%; left: 50%; transform: translateX(-50%); }
.seat-bottom-left  { left: 17%; bottom: 7%; }
.seat-left         { left: 7%; top: 34%; }

.empty { color: #aac4b4; }

.empty-avatar {
  margin: auto;
  border: 1px dashed #799989;
  color: #aac4b4;
  background: #0e392b;
}

/* --- Main / Chat --- */

.hand-card {
  background: #10271f;
  border-radius: 9px;
  padding: 14px;
}

.private-cards { display: flex; gap: 7px; margin-bottom: 10px; }
.hand-card p { font-size: 13px; margin: 0 0 2px; }
.hand-card small { font-size: 11px; color: var(--muted); }

.chat-heading { margin-top: 25px; }

.messages {
  min-height: 145px;
  max-height: 210px;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 12px;
  line-height: 1.45;
  padding-right: 4px;
}

.messages p { margin: 0 0 9px; color: #c5d8cc; }
.messages b { color: var(--gold); margin-right: 4px; }

.chat-form {
  display: flex;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.chat-form input {
  min-width: 0;
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ink);
  outline: 0;
  font-size: 12px;
}

.chat-form button {
  border: 0;
  background: #285541;
  color: #ceead9;
  border-radius: 5px;
  width: 28px;
  cursor: pointer;
}

/* ------------------------------------------------------------
   7. Barre d'action (boutons de jeu)
   ------------------------------------------------------------ */

.action-bar {
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.turn-info { font-size: 13px; color: #c5d8cc; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.actions button {
  padding: 10px 15px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  color: white;
}

.actions button:disabled { opacity: 0.4; cursor: not-allowed; }

.fold   { background: #332522; border-color: #593a34 !important; color: #e4b6ae !important; }
.call   { background: #276548; }
.check  { background: #2d4a3d; color: white; }
.raise  { background: var(--gold); color: #182218 !important; font-weight: bold; }
.allin  { background: #6b2c2c; color: #f5c6c6; }

.raise-panel {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  background: #0a1a15;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.raise-panel label {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.raise-panel input {
  background: #07130f;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  width: 100px;
}

.raise-panel button {
  background: var(--gold);
  border: 0;
  color: #182218;
  font-weight: 700;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

.raise-panel button#btn-raise-cancel {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------
   8. Toast (notifications)
   ------------------------------------------------------------ */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  background: #e8f4eb;
  color: #183224;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 13px;
  transition: .25s;
  pointer-events: none;
  z-index: 1000;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ------------------------------------------------------------
   9. Dialogues (modals)
   ------------------------------------------------------------ */

dialog {
  width: min(390px, calc(100vw - 34px));
  border: 1px solid #416351;
  border-radius: 14px;
  background: #10221b;
  color: var(--ink);
  text-align: center;
  padding: 30px;
  box-shadow: 0 16px 80px #000;
}

dialog::backdrop { background: #000a; }

.dialog-icon { font-size: 40px; color: var(--gold); }
dialog h2 { margin: 8px 0; font-size: 21px; }
dialog p { color: var(--muted); font-size: 13px; }

.close-dialog {
  position: absolute;
  right: 12px;
  top: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

.invite-link {
  display: flex;
  background: #07130f;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px;
  align-items: center;
  margin: 17px 0;
}

.invite-link code {
  font-size: 12px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invite-link button {
  background: #315d46;
  border: 0;
  border-radius: 5px;
  color: #e2f3e8;
  padding: 7px;
  cursor: pointer;
}

.share-discord { width: 100%; }

/* ------------------------------------------------------------
   10. Formulaires
   ------------------------------------------------------------ */

.create-form {
  text-align: left;
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.create-form label {
  font-size: 12px;
  color: #b5cbbb;
  display: grid;
  gap: 6px;
}

.create-form input,
.create-form select {
  background: #07130f;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  outline: 0;
}

/* ------------------------------------------------------------
   11. Responsive
   ------------------------------------------------------------ */

@media (max-width: 980px) {
  .table-layout { grid-template-columns: 150px minmax(430px, 1fr); }
  .right-panel { display: none; }
  .felt { height: 460px; }
}

@media (max-width: 680px) {
  .topbar { height: 58px; padding: 0 14px; }
  .brand { font-size: 12px; }
  .room-code { display: none; }
  .discord-button { font-size: 12px; padding: 8px 10px; margin-left: auto; }

  main { padding: 18px 12px 12px; }
  .game-header { margin-bottom: 15px; }
  .eyebrow { font-size: 9px; }
  h1 { font-size: 21px; }
  .ghost-button { font-size: 11px; padding: 8px; }
  .icon-button { display: none; }

  .table-layout { display: block; }
  .left-panel { display: none; }

  .felt {
    height: min(108vw, 440px);
    border-width: 9px;
    border-radius: 42%;
    min-height: 355px;
  }

  .seat { transform: scale(.82); transform-origin: center; }
  .seat-top { top: 0; transform: translateX(-50%) scale(.82); }
  .seat-right { right: -3%; top: 31%; }
  .seat-left { left: -3%; top: 31%; }
  .seat-bottom-right { right: 8%; bottom: 3%; }
  .seat-bottom-left { left: 8%; bottom: 3%; }
  .seat-bottom { bottom: -4%; transform: translateX(-50%) scale(.82); }

  .community-cards { gap: 4px; }
  .card { width: 34px; height: 50px; font-size: 14px; }

  .action-bar {
    position: sticky;
    bottom: 7px;
    margin-top: 12px;
    display: block;
    padding: 10px;
  }

  .turn-info { font-size: 11px; margin-bottom: 9px; }
  .actions { gap: 5px; }
  .actions button { flex: 1; padding: 10px 5px; font-size: 11px; }
  .actions b { display: block; }

  .round-label { top: 40%; }
  .pot { top: 65%; }

  .hub { padding: 48px 16px 24px; }
  .hub-hero { margin-bottom: 38px; }
  .hub-heading { align-items: start; gap: 10px; }
  .online-count { white-space: nowrap; padding-top: 4px; }
  .room-grid { grid-template-columns: 1fr; gap: 10px; }
  .room-tile { min-height: 135px; }
  .tile-icon { margin-bottom: 10px; }
  .how-it-works { margin-top: 34px; gap: 8px; flex-wrap: wrap; }
  .how-it-works b { display: none; }
}

/* Cartes révélées au showdown */
.revealed-cards {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
  animation: fadeInCards 0.3s ease-in;
}

.revealed-cards .card {
  height: 40px;
  width: 28px;
  font-size: 11px;
  padding: 2px;
}

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

/* Panneau "Prêt" sur la table */
.ready-overlay {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(44, 166, 106, 0.15), rgba(44, 166, 106, 0.05));
  border: 1px solid rgba(44, 166, 106, 0.4);
  border-radius: 10px;
  animation: fadeInCards 0.3s ease-in;
}

.ready-overlay .create-room {
  padding: 10px 18px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s;
}

.ready-overlay .create-room.is-ready {
  background: #2ca66a;
  color: white;
  cursor: default;
}

.ready-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}

/* Événements de jeu dans le chat */
.messages .event {
  margin: 0 0 6px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-style: italic;
  color: #a8c5b6;
  background: rgba(22, 77, 59, 0.25);
  border-left: 2px solid #2ca66a;
}

.messages .event-win {
  background: rgba(229, 183, 106, 0.15);
  border-left-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
  font-style: normal;
}

.messages .event-action {
  background: rgba(240, 113, 103, 0.15);
  border-left-color: var(--coral);
  color: #e4b6ae;
  font-style: normal;
}

.messages .event-street {
  background: rgba(88, 101, 242, 0.15);
  border-left-color: #5865f2;
  color: #b5bbf5;
  text-align: center;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.08em;
}

/* Boutons sur les tuiles de salle */
.room-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  position: relative;
  z-index: 2;
}

.room-action-btn {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(7, 19, 15, 0.6);
  color: var(--ink);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.room-action-btn:hover {
  background: rgba(44, 166, 106, 0.2);
  border-color: #2ca66a;
}

.room-action-btn.play-btn:hover {
  background: rgba(229, 183, 106, 0.2);
  border-color: var(--gold);
}

.room-action-btn.admin-btn:hover {
  background: rgba(229, 183, 106, 0.25);
  border-color: var(--gold);
}

.room-action-btn.delete-btn {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}

.room-action-btn.delete-btn:hover {
  background: rgba(240, 113, 103, 0.2);
  border-color: var(--coral);
}

/* Bandeau spectateur */
.spectator-banner {
  background: linear-gradient(90deg, rgba(88, 101, 242, 0.2), rgba(88, 101, 242, 0.05));
  border: 1px solid rgba(88, 101, 242, 0.5);
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  color: #b5bbf5;
  letter-spacing: 0.05em;
}

.spectator-banner.admin {
  background: linear-gradient(90deg, rgba(229, 183, 106, 0.2), rgba(229, 183, 106, 0.05));
  border-color: rgba(229, 183, 106, 0.5);
  color: var(--gold);
}

.spectator-icon {
  font-size: 18px;
  margin-right: 8px;
  vertical-align: middle;
}

.quit-table-btn {
  border-color: #593a34;
  color: #e4b6ae;
}
.quit-table-btn:hover {
  background: rgba(240, 113, 103, 0.15);
  border-color: var(--coral);
}

/* Tuile Mode entraînement */
.training-tile {
  border-color: rgba(229, 183, 106, 0.4);
  background: linear-gradient(135deg, rgba(229, 183, 106, 0.08), transparent);
}

.training-tile:hover {
  border-color: var(--gold);
}

/* 🆕 Tuile Salle de test (admins) */
.admin-test-tile {
  border-color: rgba(240, 113, 103, 0.4);
  background: linear-gradient(135deg, rgba(240, 113, 103, 0.08), transparent);
}

.admin-test-tile:hover {
  border-color: var(--coral);
}

.admin-test-tile .tile-icon {
  background: #5c2e2a;
  color: #f5c6c6;
}

/* Scrollbar universelle pour tout le site */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #2a4d3d;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a6650;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #2a4d3d transparent;
}

/* ============================================================
   SHOWDOWN — Mise en avant du gagnant
   ============================================================ */

.seat.winner {
  animation: winnerPulse 1.5s ease-in-out infinite;
  z-index: 10;
}

.seat.winner .avatar {
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold), 0 0 40px rgba(229, 183, 106, 0.5);
}

@keyframes winnerPulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px var(--gold));
  }
  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 25px var(--gold));
  }
}

.seat .winner-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #e5b76a, #c9963f);
  color: #19251e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(229, 183, 106, 0.6);
  animation: badgePop 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  z-index: 20;
}

@keyframes badgePop {
  0% { transform: translateX(-50%) scale(0); }
  60% { transform: translateX(-50%) scale(1.15); }
  100% { transform: translateX(-50%) scale(1); }
}

.card.winning {
  border: 2px solid var(--gold);
  box-shadow: 0 0 12px var(--gold), 0 2px 6px #0008;
  animation: cardGlow 1.2s ease-in-out infinite alternate;
}

@keyframes cardGlow {
  from { box-shadow: 0 0 8px var(--gold); }
  to   { box-shadow: 0 0 18px var(--gold), 0 0 30px rgba(229, 183, 106, 0.4); }
}

.felt.winner-felt {
  box-shadow: inset 0 0 0 5px #a2784c, inset 0 0 65px #061e16, 0 0 40px rgba(229, 183, 106, 0.4);
  transition: box-shadow 0.5s;
}

/* ============================================================
   BANDEAU GAGNANT — EN HAUT (ne cache plus les cartes)
   ============================================================ */

.winner-banner {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, #e5b76a, #c9963f);
  color: #19251e;
  padding: 12px 26px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 30px rgba(229, 183, 106, 0.7);
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  white-space: nowrap;
}

.winner-banner.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 680px) {
  .winner-banner {
    top: 70px;
    font-size: 13px;
    padding: 10px 18px;
    max-width: 90vw;
    white-space: normal;
    text-align: center;
  }
}

/* ============================================================
   🎴 MAIN DU JOUEUR EN MOBILE
   ============================================================ */

.mobile-hand {
  display: none;
}

@media (max-width: 980px) {
  .mobile-hand {
    display: block;
    background: #10271f;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    text-align: center;
  }

  .mobile-hand .private-cards {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 6px;
  }

  .mobile-hand .private-cards .card {
    height: 55px;
    width: 38px;
    font-size: 15px;
  }

  .mobile-hand p {
    font-size: 12px;
    color: var(--gold);
    margin: 0;
    font-weight: 600;
  }
}
/* ============================================================
   SIÈGES DYNAMIQUES — positions selon le nombre de joueurs
   ============================================================ */

.seat[data-seat] {
  display: none;
}

.seat[data-seat].visible {
  display: block;
}

/* ---------- 2 joueurs : toi en bas, l'autre en haut ---------- */
.table-2-players .seat-pos-3 { top: auto; bottom: 1%; left: 50%; transform: translateX(-50%); right: auto; }
.table-2-players .seat-pos-0 { top: 7%; left: 50%; transform: translateX(-50%); right: auto; bottom: auto; }

/* ---------- 4 joueurs : haut, droite, bas, gauche ---------- */
.table-4-players .seat-pos-3 { top: auto; bottom: 1%; left: 50%; transform: translateX(-50%); right: auto; }
.table-4-players .seat-pos-0 { top: 7%; left: 50%; transform: translateX(-50%); right: auto; bottom: auto; }
.table-4-players .seat-pos-1 { top: 34%; right: 7%; left: auto; bottom: auto; transform: none; }
.table-4-players .seat-pos-5 { top: 34%; left: 7%; right: auto; bottom: auto; transform: none; }

/* ---------- 6 joueurs : cercle complet ---------- */
.table-6-players .seat-pos-3 { top: auto; bottom: 1%; left: 50%; transform: translateX(-50%); right: auto; }
.table-6-players .seat-pos-0 { top: 7%; left: 50%; transform: translateX(-50%); right: auto; bottom: auto; }
.table-6-players .seat-pos-1 { top: 34%; right: 7%; left: auto; bottom: auto; transform: none; }
.table-6-players .seat-pos-2 { bottom: 7%; right: 17%; left: auto; top: auto; transform: none; }
.table-6-players .seat-pos-4 { bottom: 7%; left: 17%; right: auto; top: auto; transform: none; }
.table-6-players .seat-pos-5 { top: 34%; left: 7%; right: auto; bottom: auto; transform: none; }

/* ---------- 8 joueurs : 2 de chaque côté ---------- */
.table-8-players .seat-pos-3 { top: auto; bottom: 1%; left: 50%; transform: translateX(-50%); right: auto; }
.table-8-players .seat-pos-0 { top: 7%; left: 50%; transform: translateX(-50%); right: auto; bottom: auto; }
.table-8-players .seat-pos-1 { top: 22%; right: 7%; left: auto; bottom: auto; transform: none; }
.table-8-players .seat-pos-2 { bottom: 22%; right: 7%; left: auto; top: auto; transform: none; }
.table-8-players .seat-pos-4 { bottom: 22%; left: 7%; right: auto; top: auto; transform: none; }
.table-8-players .seat-pos-5 { top: 22%; left: 7%; right: auto; bottom: auto; transform: none; }
.table-8-players .seat-pos-6 { top: 45%; right: 3%; left: auto; bottom: auto; transform: none; }
.table-8-players .seat-pos-7 { top: 45%; left: 3%; right: auto; bottom: auto; transform: none; }

@media (max-width: 680px) {
  .table-4-players .seat-pos-0,
  .table-6-players .seat-pos-0,
  .table-8-players .seat-pos-0 { top: 0; }
  .table-4-players .seat-pos-1,
  .table-6-players .seat-pos-1,
  .table-8-players .seat-pos-1 { top: 31%; right: -3%; }
  .table-4-players .seat-pos-5,
  .table-6-players .seat-pos-5,
  .table-8-players .seat-pos-5 { top: 31%; left: -3%; }
  .table-6-players .seat-pos-2,
  .table-8-players .seat-pos-2 { bottom: 3%; right: 8%; }
  .table-6-players .seat-pos-4,
  .table-8-players .seat-pos-4 { bottom: 3%; left: 8%; }
  .table-8-players .seat-pos-6 { top: 45%; right: -5%; }
  .table-8-players .seat-pos-7 { top: 45%; left: -5%; }
}

.spectator-banner.broke {
  background: linear-gradient(90deg, rgba(240, 113, 103, 0.25), rgba(240, 113, 103, 0.05));
  border-color: rgba(240, 113, 103, 0.5);
  color: #f5c6c6;
}
/* ============================================================
   INDICATEUR DE TOUR
   ============================================================ */

.turn-indicator {
  position: absolute;
  top: 33%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(44, 166, 106, 0.95), rgba(37, 88, 64, 0.95));
  border: 1px solid #5bdc9b;
  border-radius: 20px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(44, 166, 106, 0.5);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  z-index: 5;
  animation: turnIndicatorPulse 1.5s ease-in-out infinite;
  white-space: nowrap;
}

.turn-indicator.is-you {
  background: linear-gradient(135deg, rgba(229, 183, 106, 0.95), rgba(201, 150, 63, 0.95));
  border-color: var(--gold);
  box-shadow: 0 4px 20px rgba(229, 183, 106, 0.6);
}

.turn-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #fff;
  animation: turnIndicatorDot 1s ease-in-out infinite;
}

@keyframes turnIndicatorPulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.04); }
}

@keyframes turnIndicatorDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(0.8); }
}

@media (max-width: 680px) {
  .turn-indicator {
    font-size: 11px;
    padding: 6px 12px;
    top: 30%;
  }
}

/* ============================================================
   DEALER BUTTON
   ============================================================ */

.seat .dealer-button {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f8f6ed;
  color: #18221d;
  font-weight: 900;
  font-size: 13px;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 2px #e5b76a;
  z-index: 15;
  animation: dealerPulse 2s ease-in-out infinite;
}

@keyframes dealerPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 2px #e5b76a; }
  50%      { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(229, 183, 106, 0.4); }
}

/* Mobile */
@media (max-width: 680px) {
  .seat .dealer-button {
    width: 18px;
    height: 18px;
    font-size: 10px;
    top: -6px;
    right: -6px;
  }
}

/* ============================================================
   CLASSEMENT DES JOUEURS (par stack)
   ============================================================ */

/* 🥇 Rang 1 : halo doré */
.player.rank-gold {
  background: linear-gradient(90deg, rgba(229, 183, 106, 0.15), transparent);
  border-left: 3px solid #e5b76a;
}

/* 🥈 Rang 2 : halo argenté */
.player.rank-silver {
  background: linear-gradient(90deg, rgba(192, 192, 192, 0.10), transparent);
  border-left: 3px solid #c0c0c0;
}

/* 🥉 Rang 3 : halo bronze */
.player.rank-bronze {
  background: linear-gradient(90deg, rgba(205, 127, 50, 0.10), transparent);
  border-left: 3px solid #cd7f32;
}

/* ⚠️ IMPORTANT : le joueur "en train de jouer" doit primer sur le rang */
.player.is-turn {
  background: #18392d !important;
  border-left: 3px solid #5bdc9b !important;
}

/* ============================================================
   MISE DU JOUEUR SUR LE SIÈGE
   ============================================================ */

.seat .seat-bet {
  display: inline-block;
  background: linear-gradient(135deg, rgba(229, 183, 106, 0.9), rgba(201, 150, 63, 0.9));
  color: #19271f;
  font-weight: 700;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 4px;
  box-shadow: 0 2px 6px rgba(229, 183, 106, 0.4);
  animation: betPop 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  white-space: nowrap;
}

/* 🆕 Mise importante (> 50% du tapis) : rouge */
.seat .seat-bet.big-bet {
  background: linear-gradient(135deg, #f07167, #c94a40);
  color: #fff;
  box-shadow: 0 2px 6px rgba(240, 113, 103, 0.5);
}

@keyframes betPop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* Mobile : plus compact */
@media (max-width: 680px) {
  .seat .seat-bet {
    font-size: 9px;
    padding: 1px 5px;
    margin-top: 2px;
  }
}
/* ============================================================
   FEEDBACK VISUEL DES BOUTONS D'ACTION
   ============================================================ */

/* État "en attente" : boutons grisés avec opacité réduite */
.actions button.pending {
  opacity: 0.5;
  cursor: wait !important;
  position: relative;
}

/* Spinner subtil sur les boutons en attente */
.actions button.pending::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Bouton cliqué : pulsation rapide */
.actions button.clicked {
  animation: btnPulse 0.4s ease-out;
}

@keyframes btnPulse {
  0%   { box-shadow: 0 0 0 0 rgba(229, 183, 106, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(229, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 183, 106, 0); }
}

/* Mobile : spinner plus petit */
@media (max-width: 680px) {
  .actions button.pending::after {
    width: 8px;
    height: 8px;
    right: 3px;
  }
}