/* V45: tutti i posizionamenti sono calcolati sulle coordinate reali di .table-shell. */
body.pkr45-layout #game .table-shell {overflow:visible!important}
body.pkr45-layout #game .table-shell #seats {overflow:visible!important}
body.pkr45-layout #game .table-shell .pkr45-positioned {transform-origin:center center!important}
body.pkr45-layout #game .table-shell .pkr45-dealer-label {display:inline-flex;align-items:center;justify-content:center;
 background:linear-gradient(#fff3bf,#e6b966);color:#29210f;border:1px solid #8c671c;border-radius:50%;
 width:17px;height:17px;font:bold 12px/1 system-ui;vertical-align:middle;margin-left:4px;
 box-shadow:0 1px 5px #0009;pointer-events:none}

/* ================================================================
 * POKERANDO V50 - DUE CARTE A VENTAGLIO
 * Pure visual enhancement.  Does not touch server game logic, data,
 * saved editor positions, custom player boxes or winner calculations.
 * `rotate` and `translate` are independent CSS transform properties;
 * dealing/winning animations that animate `transform` stay intact.
 * ================================================================ */

/* Opponents: keep the two cards in the exact slot already chosen by Admin. */
body #game #seats .seat:not(.empty) .seat-mini {
  --pkr50-overlap: 12px;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  gap:0!important;
  overflow:visible!important;
  white-space:nowrap!important;
}
body #game #seats .seat:not(.empty) .seat-mini > .poker-card {
  position:relative!important;
  flex-shrink:0!important;
  transform-origin:50% 90%!important;
  will-change:rotate;
}
body #game #seats .seat:not(.empty) .seat-mini > .poker-card:first-child {
  rotate:-12deg!important;
  translate:2px 2px!important;
  z-index:3!important;
}
body #game #seats .seat:not(.empty) .seat-mini > .poker-card:nth-child(2) {
  margin-left:calc(-1 * var(--pkr50-overlap))!important;
  rotate:12deg!important;
  translate:-2px 2px!important;
  z-index:4!important;
}
/* Preserve normal blank card placeholders and winning glow. */
body #game #seats .seat:not(.empty) .seat-mini > .poker-card.empty {
  rotate:none!important;
  translate:none!important;
}

/* Your hole cards: same fan, slightly less overlap for readability. */
body #game #myCards.hero-cards {
  --pkr50-overlap-self: 15px;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:0!important;
  overflow:visible!important;
}
body #game #myCards.hero-cards > .poker-card {
  position:relative!important;
  flex-shrink:0!important;
  transform-origin:50% 92%!important;
}
body #game #myCards.hero-cards > .poker-card:first-child {
  rotate:-10deg!important;
  translate:3px 2px!important;
  z-index:3!important;
}
body #game #myCards.hero-cards > .poker-card:nth-child(2) {
  margin-left:calc(-1 * var(--pkr50-overlap-self))!important;
  rotate:10deg!important;
  translate:-3px 2px!important;
  z-index:4!important;
}
body #game #myCards.hero-cards > .poker-card.empty {
  rotate:none!important;
  translate:none!important;
}
/* Narrow mobile screen: compact overlap, don't cover adjacent player boxes. */
@media (max-width:760px) and (orientation:portrait){
  body #game #seats .seat:not(.empty) .seat-mini{--pkr50-overlap:7px}
  body #game #seats .seat:not(.empty) .seat-mini > .poker-card:first-child{rotate:-10deg!important;translate:1px 1px!important}
  body #game #seats .seat:not(.empty) .seat-mini > .poker-card:nth-child(2){rotate:10deg!important;translate:-1px 1px!important}
  body #game #myCards.hero-cards{--pkr50-overlap-self:10px}
}
@media (max-width:760px) and (orientation:landscape),
       (max-height:530px) and (orientation:landscape){
  body #game #seats .seat:not(.empty) .seat-mini{--pkr50-overlap:5px}
  body #game #seats .seat:not(.empty) .seat-mini > .poker-card:first-child{rotate:-9deg!important;translate:1px 1px!important}
  body #game #seats .seat:not(.empty) .seat-mini > .poker-card:nth-child(2){rotate:9deg!important;translate:-1px 1px!important}
  body #game #myCards.hero-cards{--pkr50-overlap-self:8px}
}
/* End Pokerando V50 fan */

/* Pokerando V51: fiches posizionabili indipendentemente dal totale piatto. */
body #game .table-shell #potChips.pkr51-chips-positioned{position:absolute!important;margin:0!important;right:auto!important;bottom:auto!important;transform-origin:center center!important;pointer-events:none!important;z-index:9!important}
/* Le carte originali rimangono nel DOM per il motore e le animazioni; una copia visiva segue le coordinate dell'Editor. */
body #game #seats .seat .seat-mini.pkr51-source-hidden,
body #game #myCards.pkr51-source-hidden{opacity:0!important}
body #game .table-shell .pkr51-card-overlay{position:absolute!important;inset:0!important;pointer-events:none!important;z-index:13!important}
body #game .table-shell .pkr51-float-cards{position:absolute!important;left:var(--pkr51-x)!important;top:var(--pkr51-y)!important;transform:translate(-50%,-50%) rotate(var(--pkr51-rotate)) scale(var(--pkr51-zoom))!important;transform-origin:center center;display:flex;align-items:center;justify-content:center;pointer-events:none!important}
body #game .table-shell .pkr51-float-cards .seat-mini{position:static!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;transform:none!important;display:flex!important;gap:0!important;align-items:center!important;justify-content:center!important;opacity:1!important;overflow:visible!important}
body #game .table-shell .pkr51-float-cards .poker-card{flex-shrink:0!important;position:relative!important;transform-origin:50% 90%!important}
body #game .table-shell .pkr51-float-cards .poker-card:first-child{rotate:calc(-1 * var(--pkr51-fan))!important;z-index:3!important}
body #game .table-shell .pkr51-float-cards .poker-card:nth-child(2){margin-left:calc(-1 * var(--pkr51-overlap))!important;rotate:var(--pkr51-fan)!important;z-index:4!important}
/* Illuminate SOLO le postazioni vincitrici indicate dal server, anche in caso di parita'. */
@keyframes pkr51-winner-pulse{0%,100%{filter:drop-shadow(0 0 5px #ffdf7d);box-shadow:0 0 0 2px #ffdc70,0 0 16px 5px #e1ad28a6,inset 0 0 13px #f0dc8855}50%{filter:drop-shadow(0 0 13px #fff3b0);box-shadow:0 0 0 4px #fff4a8,0 0 35px 15px #ffbc2eb0,inset 0 0 22px #f0dc8890}}
body #game #seats .seat.pkr51-winner-glow,
body #game #seats .seat.win-seat,
body #game .pkr28-own-label.pkr51-winner-glow{animation:pkr51-winner-pulse 1.25s ease-in-out infinite!important;border-color:#ffe79a!important;position:relative;z-index:19!important}
@media (prefers-reduced-motion:reduce){body #game #seats .seat.pkr51-winner-glow,body #game #seats .seat.win-seat,body #game .pkr28-own-label.pkr51-winner-glow{animation:none!important;box-shadow:0 0 0 4px #ffde81,0 0 20px 9px #f6ba4a99!important}}

/* V54: le carte galleggiano sulla stessa superficie che contiene i giocatori,
   non sul shell ridimensionato separatamente dall'editor mobile. */
body #game #seats{overflow:visible!important}
body #game #seats>.pkr51-card-overlay{position:absolute!important;inset:0!important;pointer-events:none!important;z-index:9!important;overflow:visible!important}
body #game #seats>.pkr51-card-overlay .pkr51-float-cards{position:absolute!important;left:var(--pkr51-x)!important;top:var(--pkr51-y)!important;transform:translate(-50%,-50%) rotate(var(--pkr51-rotate)) scale(var(--pkr51-zoom))!important;transform-origin:center center!important;pointer-events:none!important}


body #game .seat .seatname.pkr54-custom-name,body #game .pkr28-own-name.pkr54-custom-name{line-height:1.08!important;overflow:visible!important;white-space:nowrap!important;max-width:none!important}

/* V56 - Mantieni l'ingrandimento anche con le precedenti skin iPhone. */
body #game #seats>.pkr51-card-overlay .pkr51-float-cards .seat-mini>.poker-card{overflow:visible!important;transform-origin:50% 80%!important;}
body #game #myCards>.poker-card{transform-origin:50% 75%!important;}
body #game #seats>.pkr51-card-overlay .pkr51-float-cards{overflow:visible!important;}

/* V58: applicazione solo alle carte personalizzate, mai al tavolo predefinito. */
body #game #seats>.pkr58-card-overlay{z-index:9!important;isolation:auto!important;pointer-events:none!important;overflow:visible!important}
body #game #seats>.pkr58-card-overlay>.pkr58-managed{pointer-events:none!important;visibility:visible!important;overflow:visible!important;max-width:none!important}
body #game #seats>.pkr58-card-overlay>.pkr58-managed>.seat-mini{display:flex!important;opacity:1!important;visibility:visible!important;width:max-content!important;max-width:none!important;overflow:visible!important}
body #game #seats>.pkr58-card-overlay>.pkr58-managed>.seat-mini>.poker-card{position:relative!important;flex-shrink:0!important;overflow:hidden!important;max-width:none!important;visibility:visible!important;opacity:1!important}

/* V59: gli overlay precedenti non devono mai mostrare una seconda coppia. */
body #game #seats .pkr51-card-overlay{display:none!important}
body #game #seats .seat .seat-mini.pkr59-card-managed{overflow:visible!important;transform-origin:center center!important}
body #game #seats .seat .seat-mini.pkr59-card-managed>.poker-card{transform-origin:center center!important}
body #pkr59-fit-host{position:relative!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;overflow:visible!important}
body #pkr59-fit-host>.table-shell{position:relative;transform-origin:top left!important}

/* V60: un solo riferimento geometrico per tavolo, carte e posti. */
body #game .table-outer.pkr60-fitted{
  transform-origin:top center!important;
  margin-left:auto!important;
  margin-right:auto!important;
  overflow:visible!important;
}
