/* Seat width variables and responsive sizing */
:root{
  /* + ~10–15% sur la largeur */
  --pk-seat-min: 240px;
  --pk-seat-w:   280px;
  --pk-seat-max: 360px;
  --pk-seat-min-h: 124px;
  /* Décalage vertical des holecards à l'intérieur des seatcards (ajustable) */
  --pk-holecards-shift: 24px; /* décale juste sous la ligne Capital */

  /* marges de sécurité (confort) */
  --pk-safe-top: 72px;
  --pk-safe-bot: 110px; /* évite de mordre la barre d'actions */
  --pk-safe-left: 20px;
  --pk-safe-right: 20px;
}

.seatcard{
  min-width: var(--pk-seat-min);
  max-width: var(--pk-seat-max);
  width: clamp(var(--pk-seat-min), var(--pk-seat-w), var(--pk-seat-max));
  min-height: var(--pk-seat-min-h); /* applique la hauteur mini */
  margin: 2px; /* mini tampon visuel pour limiter les touches au pixel près */
  z-index: 10; /* ensure above table bg and within overlay */
  transition: filter .15s ease, opacity .15s ease, box-shadow .15s ease;
}

/* Augmenter l'entête (nom joueur / icônes) */
.seatcard header,
.seatcard .seat-header {
  min-height: 42px;       /* +10px par rapport à ~32px */
  padding-top: 6px;
  padding-bottom: 6px;
  align-items: center;
}

/* Ensure the seats layer sits above the table oval */
#seats_layer{ z-index: 22; }

/* Visual focus for seat to act: halo active, grey others */
.seatcard.active{
  filter:none;
  opacity:1;
  box-shadow:0 0 0 2px rgba(59,130,246,.55), 0 6px 18px rgba(0,0,0,.35);
}
.seatcard.inactive{
  filter: grayscale(35%) brightness(0.95);
  opacity:.65;
}

/* Guard against horizontal overflow on small screens */
html, body{ overflow-x:hidden; }

/* Make long seat names safe inside cards */
.seatcard .seat-name{
  max-width: 18ch;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Ensure action buttons never cause card overflow */
.seatcard .seat-actions{ max-width:100%; flex-wrap:wrap; }

/* ===== Final override: ensure generous seat sizes ===== */
:root{
  --pk-seat-min:   280px; /* +large */
  --pk-seat-w:     320px;
  --pk-seat-max:   420px;
  --pk-seat-min-h: 158px; /* +haut (+10px) */
}

/* === PK — Correctif siège : entête + boutons latéraux + anti‑rognage === */

/* Laisser dépasser les pastilles et étiquettes si besoin */
#seats_layer,
.seatcard{
  overflow: visible !important;
}

/* Annule tout display:none qui a été posé plus haut */
.seatcard .seat-actions,
.seatcard .seat-ctrls,
.seatcard .btn-ctrl,
.seatcard .btn-stand,
.seatcard .btn-sit{
  display: flex !important;
}

/* Piloter la pile au‑dessus du contenu de la carte */
.seatcard .badge,
.seatcard .label,
.seatcard .seat-name,
.seatcard .seat-actions,
.seatcard .seat-ctrls{
  position: relative;
  z-index: 5;
}

/* Ensure textual lines (last action, committed, capital) sit above hole cards */
.seatcard .seat-last,
.seatcard .seat-commit{
  position: relative;
  z-index: 6;
}
.seatcard .seat-capital{
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hole cards layout: below capital, never overlap text */
.seatcard .holecards{
  display: flex;
  gap: 6px;
  margin-top: 0 !important; /* géré par transform ci-dessous */
  align-items: center;
  flex-wrap: nowrap;
  position: relative;
  z-index: 4; /* under text rows */
  transform: translateY(var(--pk-holecards-shift));
}

/* Slightly reduce small cards to avoid crowding on compact seats */
.seatcard .holecards .pk-playcard.small{ transform: scale(0.95); transform-origin: left center; }

/* Boutons latéraux intégrés à la carte → visibles partout, ne débordent plus */
:root{ --seat-ctrl-gap: 6px; }
.seatcard .seat-ctrls{
  position: absolute;
  top: 8px;
  right: 8px;              /* colonne à droite de la carte */
  flex-direction: column;
  gap: var(--seat-ctrl-gap);
  align-items: flex-end;
}
.seatcard .seat-actions{
  position: absolute;      /* variante si .seat-actions est utilisée */
  top: 8px;
  right: 8px;
  flex-direction: column;
  gap: var(--seat-ctrl-gap);
}

/* Flip à gauche si collé au bord gauche */
.seatcard.edge-left .seat-ctrls,
.seatcard.edge-left .seat-actions{
  left: 8px;
  right: auto;
  align-items: flex-start;
}

/* L’étiquette “Joueur n” ne doit jamais être coupée */
.seatcard .badge,
.seatcard .label{
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

/* Un peu d’air pour l'entête */
.seatcard{
  padding-top: max(16px, var(--seat-pad-top, 16px)) !important;
  padding-bottom: max(18px, var(--seat-pad-bot, 18px)) !important;
}

/* Taille de carte raisonnable pour qu’elle rentre partout */
:root{
  /* ajuste si besoin, mais évite d’aller < 200px de min */
  --pk-seat-min: 220px;
  --pk-seat-w:   260px;
  --pk-seat-max: 300px;
}
.seatcard{
  min-width: var(--pk-seat-min) !important;
  max-width: var(--pk-seat-max) !important;
  width: clamp(var(--pk-seat-min), var(--pk-seat-w), var(--pk-seat-max)) !important;
}
