/* ========================================================
   ESTILOS DA MESA CENTRAL (TABLET / SMARTPHONE / TV)
   KS Studio - Mesa Digital
   ======================================================== */

.table-container {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: radial-gradient(circle at 50% 50%, #115e3b 0%, #083420 55%, #03140c 100%);
  border: 10px solid #271406;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .table-container {
    border: 4px solid #271406;
  }
}

/* Moldura de madeira nobre ao redor */
.table-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid #5a3818;
  pointer-events: none;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.6);
}

/* Barra Superior da Mesa */
.table-header {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 50;
  flex-wrap: wrap;
  gap: 8px;
}

.table-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
}

.table-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Área Central de Jogo (Onde a corrente de pedras se desenrola) */
.table-board-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}

/* Corrente de Dominós */
.domino-chain-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 20px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  min-height: 90px;
  max-width: 98%;
  flex-wrap: wrap;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Indicadores de pontas abertas */
.end-indicator {
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid #f59e0b;
  color: #fbbf24;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  animation: pulse-end 1.8s infinite alternate;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 20;
}

@keyframes pulse-end {
  0% { transform: scale(0.96); box-shadow: 0 0 0 rgba(245, 158, 11, 0); }
  100% { transform: scale(1.04); box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
}

/* Jogadores ao redor da mesa */
.players-dock {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 40;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px 12px;
  transition: all 0.25s ease;
  min-width: 130px;
  flex-shrink: 0;
}

.player-card.active-turn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.2) 100%);
  border: 2px solid #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.player-avatar {
  width: 36px;
  height: 36px;
  background: #1e293b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.player-info-meta {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}

.player-score-hand {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Modal de Lobby (QR Code Inicial) */
.lobby-overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 14, 8, 0.94);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lobby-box {
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 20px;
  padding: 20px 16px;
  max-width: 520px;
  width: 100%;
  max-height: 94dvh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.qr-wrapper {
  background: white;
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.room-badge {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 6px 16px;
  font-size: 1.3rem;
  font-weight: 900;
  color: #fbbf24;
  letter-spacing: 1.5px;
}

.player-slots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.slot-item {
  background: #1e293b;
  border: 1px dashed #475569;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.slot-item.filled {
  background: #1e3a8a;
  border: 1px solid #3b82f6;
  color: white;
  font-weight: 700;
}
