/* games/planning-poker.css — Tout le design de l'écran de jeu Planning Poker.
   Classes 100% indépendantes d'Undercover (préfixe pp-), rien n'est
   partagé, pour pouvoir faire évoluer ce jeu sans jamais toucher l'autre.
   Identité visuelle volontairement différente : vert tapis + doré, plutôt
   que le bleu nuit + teal d'Undercover. À affiner si tu as un design précis
   en tête. */

body.theme-planning-poker {
  background: radial-gradient(circle at top, #16352b 0%, #0a1410 75%);
  align-items: flex-start;
}

/* Jeu pensé pour le PC uniquement : pas de carte centrée, l'écran de jeu
   prend toute la largeur disponible plutôt que d'être contraint en mobile. */
body.theme-planning-poker #app {
  max-width: 1200px;
  padding: 40px 48px;
}

/* --- Écran de jeu --- */

.pp-screen {
  width: 100%;
}

.pp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

.pp-title {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.pp-pill {
  background: rgba(245, 166, 35, 0.14);
  border: 1px solid #f5a623;
  color: #f5a623;
  font-size: 0.75rem;
  padding: 5px 14px;
  border-radius: 100px;
  font-weight: bold;
  white-space: nowrap;
}

/* Plus de card encadrée : le contenu repose directement sur le fond de la page */
.pp-body {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* --- Table de poker : joueurs assis tout autour, story sur le tapis --- */

.pp-table-wrap {
  margin-bottom: 28px;
}

.pp-seats-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 10px;
}

.pp-table {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 2.4 / 1;
  margin: 10px auto;
  padding: 16px 40px;
  background: radial-gradient(ellipse at center, #1c5c43 0%, #0d2b1f 85%);
  border: 8px solid #4a3420;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 12px 32px rgba(0, 0, 0, 0.45);
}

.pp-table-story {
  color: #f5d580;
  font-weight: bold;
  font-size: 1.3rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.pp-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 84px;
}

.pp-seat .avatar {
  width: 64px;
  height: 64px;
  border: 2px solid #24382f;
}

.pp-seat-name {
  font-size: 0.8rem;
  font-weight: bold;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Jeton posé devant le joueur : vide en attente, ✓ une fois voté, valeur une fois révélé */
.pp-chip {
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border-radius: 50%;
  background: #132920;
  border: 2px solid #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: bold;
  color: #666;
}

.pp-chip.voted {
  border-color: #f5a623;
  color: #f5a623;
}

.pp-chip.revealed {
  background: #f5a623;
  border-color: #f5d580;
  color: #0d2b1f;
  font-size: 0.8rem;
}

/* --- Deck de cartes à choisir (Fibonacci) --- */

.pp-deck {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 84px));
  justify-content: center;
  gap: 10px;
  max-width: 960px;
  margin: 0 auto 24px;
}

.pp-card {
  width: 100%;
  aspect-ratio: 2 / 3;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #132920;
  border: 2px solid #24382f;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #eaeaea;
  transition: border-color 0.15s, transform 0.15s;
}

.pp-card:hover {
  border-color: #f5a623;
  transform: translateY(-2px);
  opacity: 1;
}

.pp-card.selected {
  border-color: #f5a623;
  background: rgba(245, 166, 35, 0.15);
  color: #f5a623;
}

/* --- Barre d'action contextuelle, en bas de l'écran --- */

.pp-composer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto;
}

.pp-composer input {
  flex: 1;
  margin-bottom: 0;
}

.pp-composer button {
  width: auto;
  margin-bottom: 0;
  padding: 12px 18px;
  background: #f5a623;
}

.pp-composer .waiting {
  width: 100%;
  margin: 4px 0;
}

/* Bouton de révélation et texte d'attente : centrés, pas étalés sur toute la largeur */
#revealBtn,
.pp-body > .waiting {
  max-width: 320px;
  margin: 0 auto 16px;
}

.pp-body > .waiting {
  width: 100%;
}

#endPlanningPokerBtn {
  max-width: 260px;
  margin: 24px auto 0;
  display: block;
}

/* --- Historique des stories déjà estimées (menu déroulant) --- */

.pp-history {
  max-width: 640px;
  margin: 16px auto 0;
  font-size: 0.85rem;
  border-top: 1px solid #24382f;
  padding-top: 10px;
}

.pp-history summary {
  cursor: pointer;
  list-style: none;
  color: #f5a623;
  font-weight: bold;
  user-select: none;
}

.pp-history summary::-webkit-details-marker {
  display: none;
}

.pp-history summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s;
}

.pp-history[open] summary::before {
  transform: rotate(90deg);
}

.pp-history ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.pp-history li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 2px;
  border-bottom: 1px solid #24382f;
  color: #888;
}

.pp-history li span:first-child {
  color: #eaeaea;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-history li span:last-child {
  flex-shrink: 0;
  color: #f5a623;
  font-weight: bold;
}

/* --- Modal de config (première story), propre à Planning Poker --- */

.pp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.pp-modal {
  width: 100%;
  max-width: 360px;
  background: #0f1f18;
  border: 1px solid #24382f;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.pp-modal h2 {
  margin: 0 0 16px;
  text-align: center;
  font-size: 1.2rem;
}

.pp-modal-field {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 12px;
}

.pp-modal-field input {
  margin-top: 4px;
  margin-bottom: 0;
}

.pp-modal button:not(.secondary) {
  background: #f5a623;
}
