.game-container {
  background: linear-gradient(135deg, #fff3c6, #ffe699); /* fond jaune doux */
  padding: 20px;
  border-radius: 20px;
  max-width: 1200px;
  margin: 20px auto;
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
  box-sizing: border-box;
}

.info-bar {
  margin-bottom: 15px; /* espace entre info et table */
  position: relative;
  padding: 15px 20px;
  border-radius: 12px;
  border: 2px solid #f2d380;
  text-align: center;
}



/* Info-bar et table – responsive */
.info-bar, #game-table {
  width: 95%;
  max-width: 1200px;
  margin: 20px auto;
  border-radius: 15px;
  box-sizing: border-box; /* 🔹 pour padding + largeur correct */
}


/* Salle */
.room-name {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 6px;
}

/* Nombre de joueurs */
.player-count {
  font-size: 1rem;
  color: #666;
  margin-bottom: 8px;
}

/* Liste des joueurs en ligne */
.player-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.player-list div {
  background: #fff3c6;   
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid #f2d380;
  font-weight: bold;
  font-size: 1rem;
  color: #b35900;
}


/* ========================= TABLE DE JEU ========================= */
#game-table {
  position: relative;
  width: 90%;
  max-width: 1000px;
  height: 400px;
  margin: 20px auto;
  border-radius: 20px;
  background: linear-gradient(135deg, #e6f2ff, #cce0ff);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border: 2px solid #99c2ff;
}

/* --- Slots joueurs --- */
.player-slot {
  position: absolute;
  width: 140px;
  height: 45px;
  line-height: 45px;
  text-align: center;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #666;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Position des slots */
.top { top: 10px; left: 50%; transform: translateX(-50%); }
.bottom { bottom: 10px; left: 50%; transform: translateX(-50%); }
.left { top: 50%; left: 10px; transform: translateY(-50%); }
.right { top: 50%; right: 10px; transform: translateY(-50%); }

/* Joueur actif */
.active-player {
  background: #4caf50;
  color: white;
  animation: glow 1s infinite alternate;
  border-color: #3e8e41;
}
@keyframes glow { 0% { box-shadow: 0 0 5px #4caf50; } 100% { box-shadow: 0 0 20px #4caf50; } }

/* Pioche */
.draw-center {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 55px;
  height: 80px;
  font-size: 1.5rem;
  background-color: #2196f3;
  color: white;
  border: 2px solid #333;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 20;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* ========================= MAIN DU JOUEUR ========================= */
#player-hand-container {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1000px;
  text-align: center;
  pointer-events: none;
  z-index: 100;
}

.hand {
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
}

.card {
  width: 150px;
  aspect-ratio: 3/4;
  border-radius: 12px;
  border: 2px solid #333;
  overflow: hidden;
  cursor: pointer;
}
.card img { width: 100%; height: 100%; object-fit: cover; }

/* ========================= VAINQUEUR ========================= */
#winner-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 25px 50px;
  background: linear-gradient(135deg, #fff3b0, #ffd700, #ffec8b);
  border: 4px solid #ffdf00;
  border-radius: 20px;
  color: #b35900;
  font-size: 3rem;
  font-weight: bold;
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ========================= MESSAGES CENTRAUX ========================= */
#center-message {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.9);
  padding: 15px 25px;
  border-radius: 12px;
  border: 2px solid #999;
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
}

/* ========================= FAMILLES À CÔTÉ DES JOUEURS ========================= */
.player-families {
  position: absolute;
  display: flex;
  gap: 5px;
  pointer-events: none;
  z-index: 10;
}
.top .player-families { top: 100%; left: 50%; transform: translateX(-50%); flex-direction: row; }
.bottom .player-families { bottom: 100%; left: 50%; transform: translateX(-50%); flex-direction: row; }
.left .player-families { top: 50%; left: 100%; transform: translateY(-50%); flex-direction: column; }
.right .player-families { top: 50%; right: 100%; transform: translateY(-50%); flex-direction: column; }

/* FAMILLES CARDS */
.family-complete-on-table {
  width: 60px;
  height: 80px;
  border: 2px solid #4caf50;
  border-radius: 8px;
  background-color: #e8f5e9;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.family-complete-on-table img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

#restart-game {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  border-radius: 50%;
  padding: 0;
}
#restart-game:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}
#game-help {
  position: fixed;       /* reste visible même si tu scroll */
  top: 10px;             /* distance du haut */
  right: 10px;           /* distance de la droite */
  background: rgba(255,255,255,0.9); /* légèrement transparent */
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px;
  z-index: 1000;         /* au-dessus de tout */
  max-width: 250px;      /* pour pas que ça déborde */
}
#game-help button {
  cursor: pointer;
  padding: 5px 10px;
  font-size: 18px;
}
#help-toggle {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 24px;
  cursor: pointer;
}

#help-content {
  display: none;       /* fermé par défaut */
  position: absolute;
  top: 100%;           /* ouvre en dessous du bouton */
  right: 0;
  background: white;
  border: 1px solid #aaa;
  padding: 10px;
  width: 220px;
  max-height: 60vh;    /* hauteur maximale pour rester responsive */
  overflow-y: auto;    /* scroll si le contenu dépasse */
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  border-radius: 5px;
}

#help-content ul {
  padding-left: 15px;
  margin: 0;
}

#help-content li {
  margin-bottom: 6px;
}

#help-content {
  display: none;  /* caché par défaut */
  max-height: 300px; /* facultatif, pour scroll si beaucoup de contenu */
  overflow-y: auto;
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 10px;
  margin-top: 5px;
  border-radius: 5px;
    overflow-y: auto;  
}

/* ========================= RESPONSIVE ========================= *//* ========================= MAIN DU JOUEUR (responsive mobile/tablette) ========================= */
@media (max-width: 600px) {
  #game-table {
    width: 95vw;           /* largeur adaptée à l’écran */
    max-width: 100%;       /* jamais dépasser */
    margin: 10px auto;     /* centré horizontalement */
    padding: 0;            /* pas de padding à l'intérieur */
    display: block;
    box-sizing: border-box; 
    height: 220px;         /* 🔹 hauteur un peu plus grande que 200px */
    border-radius: 12px; 
    background: linear-gradient(135deg, #e6f2ff, #cce0ff); /* fond bleu léger */
  }
  .game-container {
    padding: 15px;
    width: 95vw; /* prend presque toute la largeur */
  }
  .info-bar {
    width: 100%;
    padding: 10px;
  }

  /* Slots joueurs */
  .player-slot {
    width: 70px;
    height: 30px;
    line-height: 30px;
    font-size: 0.7rem;
  }

  .top { top: 5px; left: 50%; transform: translateX(-50%); }
  .bottom { bottom: 5px; left: 50%; transform: translateX(-50%); }
  .left { top: 50%; left: 5px; transform: translateY(-50%); }
  .right { top: 50%; right: 5px; transform: translateY(-50%); }

  .active-player { font-size: 0.7rem; }

  /* Pioche */
  #draw-pile {
    width: 40px;
    height: 60px;
    font-size: 1.2rem;
  }

  .draw-center {
    width: 42px;
    height: 62px;
    font-size: 1.2rem;
    top: 8px;
    left: 8px;
  }
  /* Preview carte */
  #card-preview {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #card-preview img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    pointer-events: none;
  }

  #help-content {
    max-height: 200px;
    font-size: 14px;
  }
  #help-toggle {
    font-size: 16px;
    padding: 5px 10px;
  }


  /* Familles */
  .player-families {
    gap: 3px;
  }

  .family-complete-on-table {
    width: 45px;
    height: 65px;
  }

  /* ========================= */
/* MAIN DU JOUEUR – MOBILE */
/* ========================= */

#player-hand-container {
  position: relative;
  left: 0;
  transform: none;
  width: 100%;
  margin: 8px auto 16px auto;
}

#cards {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;

  width: 92%;
  max-width: 420px;
  margin: 0 auto;
}

/* Cartes petites */
#cards .card {
  width: 100%;
  aspect-ratio: 3 / 4;   /* 🔥 proportions parfaites */
  height: auto;
  border-radius: 8px;
  border: 2px solid #333;
}


/* Images bien contenues */
#cards .card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
  #restart-game {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    font-size: 1.5rem; /* adapte si besoin */
  }
    #game-help {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
  }
}
