/* =====================================================================
   Poker — Texas Hold'em (Frutiger Aero: vetro + tavolo verde lucido)
   ===================================================================== */
.app.poker { height: 100%; display: flex; flex-direction: column; color: #0b3a80; font-family: var(--font); user-select: none; }
.app.poker .pk-title small { font-weight: 500; opacity: 0.75; }

.app.poker .pk-main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px 10px; }

/* ---------- striscia storico ---------- */
.app.poker .pk-history-bar { flex: none; display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(210,235,255,0.5)); border: 1px solid rgba(255,255,255,0.8); font-size: 0.72rem; overflow: hidden; white-space: nowrap; }
.app.poker .pk-history-bar small { opacity: 0.65; flex: none; }
.app.poker .pk-hist-list { display: flex; gap: 10px; overflow: hidden; text-overflow: ellipsis; }
.app.poker .pk-hist-list span { white-space: nowrap; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: rgba(120,210,255,0.35); }
.app.poker .pk-hist-list em { opacity: 0.6; font-style: normal; }

/* ---------- tavolo ---------- */
.app.poker .pk-table {
  position: relative; flex: 1; min-height: 0; border-radius: 200px / 120px; padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(190,225,255,0.55) 55%, rgba(150,200,250,0.5) 100%);
  border: 1px solid rgba(255,255,255,0.95);
  box-shadow: 0 14px 34px rgba(0,40,120,0.35), 0 1px 0 rgba(255,255,255,0.9) inset;
}
.app.poker .pk-felt {
  position: absolute; inset: 16px; border-radius: 190px / 110px;
  background: radial-gradient(ellipse at 50% 36%, #52c862 0%, #2f9c46 42%, #1c7431 78%, #0f4f20 100%);
  box-shadow: inset 0 0 70px rgba(0,25,10,0.55), inset 0 0 0 7px rgba(255,255,255,0.14);
}

/* ---------- piatto & board ---------- */
.app.poker .pk-pot { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); text-align: center; z-index: 3; }
.app.poker .pk-pot small { display: block; font-size: 0.68rem; color: #eaffea; opacity: 0.85; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.app.poker .pk-pot-val { font: 700 1.5rem var(--font-display); color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.4); }
.app.poker .pk-board { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); display: flex; gap: 6px; z-index: 3; }
.app.poker .pk-bcard { width: 52px; height: 74px; border-radius: 6px; background: rgba(255,255,255,0.15); border: 1.5px dashed rgba(255,255,255,0.4); overflow: hidden; box-shadow: none; opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.2s; }
.app.poker .pk-bcard.show { opacity: 1; transform: scale(1); border-style: solid; border-color: rgba(255,255,255,0.9); background: #fff; box-shadow: 0 3px 8px rgba(0,20,60,0.4); }
.app.poker .pk-bcard img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app.poker .pk-bcard.pk-deal-in { animation: pk-cardpop 0.3s ease-out both; }
.app.poker .pk-street-msg { position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%); z-index: 3; text-align: center; font: 600 0.85rem var(--font); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.5); max-width: 70%; }
.app.poker .pk-street-msg.good { color: #dfffb0; }
.app.poker .pk-street-msg.lose { color: #ffd7c7; }
.app.poker .pk-street-msg b { font-size: 1rem; }

@keyframes pk-cardpop { from { opacity: 0; transform: scale(0.4) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ---------- posti ---------- */
.app.poker .pk-seat { position: absolute; width: 152px; display: flex; flex-direction: column; align-items: center; z-index: 4; transition: opacity 0.15s; }
.app.poker .pk-seat-0 { left: 50%; bottom: 2%; transform: translateX(-50%); }
.app.poker .pk-seat-1 { left: 1%; top: 50%; transform: translateY(-50%); }
.app.poker .pk-seat-2 { left: 50%; top: 2%; transform: translateX(-50%); }
.app.poker .pk-seat-3 { right: 1%; top: 50%; transform: translateY(-50%); }
.app.poker .pk-seat.folded { opacity: 0.45; }
.app.poker .pk-seat.folded .pk-cards { visibility: hidden; }

.app.poker .pk-cards { display: flex; gap: 4px; height: 40px; margin-bottom: 2px; }
.app.poker .pk-card { width: 30px; height: 42px; border-radius: 4px; overflow: hidden; opacity: 0; transform: scale(0.5); box-shadow: 0 2px 5px rgba(0,20,60,0.4); background: #123; }
.app.poker .pk-card.dealt { opacity: 1; transform: scale(1); }
.app.poker .pk-card.pk-deal-in { animation: pk-cardpop 0.28s ease-out both; }
.app.poker .pk-card img { width: 100%; height: 100%; object-fit: contain; display: block; }
.app.poker .pk-seat-0 .pk-card { width: 40px; height: 56px; }
.app.poker .pk-seat-0 .pk-cards { height: 56px; }

.app.poker .pk-plate {
  position: relative; width: 100%; padding: 5px 8px 6px; border-radius: 12px; text-align: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(210,235,255,0.65));
  border: 1px solid rgba(255,255,255,0.95);
  box-shadow: 0 4px 10px rgba(0,30,100,0.3), 0 1px 0 rgba(255,255,255,0.9) inset;
}
.app.poker .pk-seat.acting .pk-plate { box-shadow: 0 0 0 2px #7ddc2b, 0 0 16px 3px rgba(125,220,43,0.75), 0 4px 10px rgba(0,30,100,0.3); }
.app.poker .pk-name { display: block; font: 700 0.85rem var(--font-display); line-height: 1.1; }
.app.poker .pk-stack { font-size: 0.72rem; opacity: 0.85; }
.app.poker .pk-stackval { font-weight: 700; }
.app.poker .pk-stack::before { content: "fiches "; opacity: 0.7; font-weight: 400; }

.app.poker .pk-badges { position: absolute; top: -10px; left: 4px; display: flex; gap: 3px; }
.app.poker .pk-dealer-badge, .app.poker .pk-blind-badge { display: none; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font: 700 0.62rem var(--font); }
.app.poker .pk-dealer-badge.show, .app.poker .pk-blind-badge.show { display: flex; }
.app.poker .pk-dealer-badge { background: linear-gradient(180deg, #fff, #cfe0ff); color: #0b3a80; border: 1px solid #7fa9d8; box-shadow: 0 2px 4px rgba(0,30,100,0.4); }
.app.poker .pk-blind-badge { background: linear-gradient(180deg, #ffe9a8, #f0b93a); color: #6a4600; border: 1px solid #cf9a1c; box-shadow: 0 2px 4px rgba(0,30,100,0.4); }

.app.poker .pk-rebuy-badge { display: none; font-size: 0.6rem; font-weight: 700; color: #0b7d2c; background: rgba(150,255,170,0.55); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }
.app.poker .pk-rebuy-badge.show { display: inline-block; }

.app.poker .pk-thinking { display: none; gap: 3px; justify-content: center; margin-top: 2px; height: 8px; }
.app.poker .pk-seat.thinking .pk-thinking { display: flex; }
.app.poker .pk-thinking i { width: 5px; height: 5px; border-radius: 50%; background: #0b5fd6; opacity: 0.25; animation: pk-dot 1s infinite; }
.app.poker .pk-thinking i:nth-child(2) { animation-delay: 0.15s; }
.app.poker .pk-thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pk-dot { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.app.poker .pk-betchip { position: absolute; display: none; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 999px; background: linear-gradient(180deg, #fff4b8, #e0a415); border: 1px solid #a86b00; box-shadow: 0 2px 5px rgba(0,20,60,0.5); font: 700 0.68rem var(--font); color: #4a2c00; }
.app.poker .pk-betchip.show { display: flex; }
.app.poker .pk-seat-0 .pk-betchip { left: 50%; top: -30px; transform: translateX(-50%); }
.app.poker .pk-seat-2 .pk-betchip { left: 50%; bottom: -30px; transform: translateX(-50%); }
.app.poker .pk-seat-1 .pk-betchip { left: 100%; top: 50%; transform: translateY(-50%) translateX(6px); }
.app.poker .pk-seat-3 .pk-betchip { right: 100%; top: 50%; transform: translateY(-50%) translateX(-6px); }

/* ---------- fiche animata verso il vincitore ---------- */
.app.poker .pk-chip-fly { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6cc, #e0a415 55%, #a86b00); box-shadow: 0 2px 6px rgba(0,20,60,0.5); transform: translate(-50%, -50%); transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1), opacity 0.6s; opacity: 1; z-index: 8; pointer-events: none; }
.app.poker .pk-chip-fly.go { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))); opacity: 0.1; }

.app.poker .pk-float { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); font: 700 0.82rem var(--font-display); color: #0b7d2c; text-shadow: 0 1px 0 #fff; animation: pk-float 1.4s ease-out both; pointer-events: none; }
@keyframes pk-float { 0% { opacity: 0; transform: translate(-50%, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px); } }

/* ---------- barra azioni ---------- */
.app.poker .pk-actionbar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(210,235,255,0.6)); border: 1px solid rgba(255,255,255,0.9); box-shadow: 0 4px 12px rgba(0,30,100,0.25); opacity: 0; pointer-events: none; transition: opacity 0.15s ease; }
.app.poker .pk-actionbar.show { opacity: 1; pointer-events: auto; }
.app.poker .pk-actionbar .aqua-btn { padding: 0.5em 1.1em; font-size: 0.85rem; white-space: nowrap; }
.app.poker .pk-raise-wrap { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.app.poker .pk-raise-wrap.hidden { visibility: hidden; }
.app.poker .pk-quick { display: flex; gap: 4px; flex: none; }
.app.poker .pk-quick .app-btn.small { height: 24px; padding: 0 9px; font-size: 0.7rem; }
.app.poker .pk-raise-slider { flex: 1; min-width: 60px; accent-color: #0b5fd6; }
.app.poker .pk-act-raise { flex: none; }

/* ---------- responsive minimo ---------- */
@media (max-width: 720px) {
  .app.poker .pk-seat { width: 118px; }
  .app.poker .pk-quick { display: none; }
}
