/**
 * ITOCCHIGAMES — STILI EMOTE DINAMICHE & REAZIONI INTERATTIVE
 */

/* ==========================================================================
   1. VASSOIO EMOTE TRAY POPUP AL TAVOLO
   ========================================================================== */
.emotes-tray-container {
  position: fixed;
  bottom: 85px;
  right: 20px;
  z-index: 9999;
  animation: slideUpEmote 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.emotes-tray-container.hidden {
  display: none !important;
}

@keyframes slideUpEmote {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.emotes-tray-box {
  width: 380px;
  max-width: 92vw;
  max-height: 500px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 215, 0, 0.4);
  border-radius: 22px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85), 0 0 30px rgba(255, 215, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.emotes-tray-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.6);
}

.emotes-tab-buttons {
  display: flex;
  gap: 6px;
}

.em-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 7px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.em-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.em-tab-btn.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25), rgba(245, 158, 11, 0.3));
  border-color: rgba(255, 215, 0, 0.6);
  color: #ffd700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.25);
}

.btn-close-emotes {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-close-emotes:hover {
  background: #ef4444;
  color: #fff;
}

.emotes-tray-content {
  padding: 12px;
  overflow-y: auto;
  max-height: 420px;
}

.emotes-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #f1f5f9;
}

.emotes-badge-free {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.emotes-badge-vip {
  background: linear-gradient(135deg, #ffd700, #f59e0b);
  color: #000;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 2px 10px;
  border-radius: 99px;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Griglia Emotes Dinamiche */
.emotes-grid-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.emotes-grid-list.vip-grid {
  grid-template-columns: repeat(5, 1fr);
}

.emote-btn-item {
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.emote-btn-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: 0.5s;
}

.emote-btn-item:hover::before {
  left: 100%;
}

.emote-btn-item:hover {
  transform: translateY(-4px) scale(1.1);
  border-color: #ffd700;
  background: rgba(51, 65, 85, 0.95);
  box-shadow: 0 8px 18px rgba(255, 215, 0, 0.35);
}

.emote-btn-item.vip-item {
  border-color: rgba(255, 215, 0, 0.3);
}

/* Icona Emote Dinamica */
.emote-icon-emoji {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 4px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.emote-btn-item:hover .emote-icon-emoji {
  animation: emoteWiggle 0.6s infinite ease-in-out;
}

@keyframes emoteWiggle {
  0%, 100% { transform: rotate(0deg) scale(1.1); }
  25% { transform: rotate(-10deg) scale(1.18); }
  75% { transform: rotate(10deg) scale(1.18); }
}

.emote-name-label {
  font-size: 0.62rem;
  font-weight: 800;
  color: #cbd5e1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Box Blocco VIP */
.emotes-locked-vip-box {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(245, 158, 11, 0.3));
  border: 1.5px dashed #ffd700;
  border-radius: 18px;
  padding: 18px;
  text-align: center;
  margin-bottom: 14px;
}

.btn-unlock-vip-emotes {
  background: linear-gradient(135deg, #ffd700, #f59e0b);
  border: none;
  color: #000;
  font-weight: 900;
  font-size: 0.88rem;
  padding: 9px 24px;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
  transition: all 0.2s;
}

.btn-unlock-vip-emotes:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.7);
}

.emote-btn-item.is-locked {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  cursor: not-allowed;
}

.emote-lock-icon {
  position: absolute;
  font-size: 0.75rem;
  top: 4px;
  right: 4px;
}

/* Pacchetti PRO */
.pro-packs-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pro-pack-card {
  background: rgba(30, 41, 59, 0.75);
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pro-pack-card.is-unlocked {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(20, 83, 45, 0.25);
}

.pro-pack-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.pro-pack-badge {
  background: rgba(168, 85, 247, 0.3);
  color: #c084fc;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.pro-pack-emotes-preview {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.emote-preview-mini {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 1.4rem;
  padding: 6px 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.emote-preview-mini.playable:hover {
  transform: scale(1.25) rotate(-6deg);
  border-color: #ffd700;
  background: rgba(51, 65, 85, 0.95);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.btn-buy-pack {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  font-weight: 900;
  font-size: 0.82rem;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}

.btn-buy-pack:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}

.badge-owned {
  color: #4ade80;
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
  display: block;
}

/* ==========================================================================
   2. FUMETTO FLUTTUANTE ANIMATO & DINAMICO (SOPRA L'AVATAR AL TAVOLO)
   ========================================================================== */
.floating-emote-bubble {
  position: absolute;
  top: -65px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.96);
  border: 2px solid #ffd700;
  border-radius: 99px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(255, 215, 0, 0.6);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
}

/* Micro-animazioni Dinamiche dell'Icona Emote */
.floating-emote-bubble .bubble-icon {
  font-size: 2.2rem;
  line-height: 1;
  display: inline-block;
  transform-origin: center center;
}

/* 1. Animazione Battito / Esplosione */
.floating-emote-bubble.dyn-burst .bubble-icon {
  animation: dynPopBurst 0.6s cubic-bezier(0.16, 1, 0.3, 1) infinite alternate;
}
@keyframes dynPopBurst {
  0% { transform: scale(0.9) rotate(-6deg); }
  100% { transform: scale(1.3) rotate(6deg); }
}

/* 2. Animazione Fiamma / Elettrica */
.floating-emote-bubble.dyn-fire .bubble-icon {
  animation: dynFirePulse 0.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px #f59e0b) drop-shadow(0 0 20px #ef4444);
}
@keyframes dynFirePulse {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.25) translateY(-4px); }
}

/* 3. Animazione Oro / Shimmer */
.floating-emote-bubble.dyn-gold .bubble-icon {
  animation: dynGoldSpin 1.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  filter: drop-shadow(0 0 12px #ffd700);
}
@keyframes dynGoldSpin {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.28) rotate(12deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* 4. Animazione Applauso / Battimani */
.floating-emote-bubble.dyn-clap .bubble-icon {
  animation: dynClapBeat 0.35s ease-in-out infinite alternate;
}
@keyframes dynClapBeat {
  0% { transform: scale(0.9) rotate(-12deg); }
  100% { transform: scale(1.25) rotate(12deg); }
}

/* 5. Animazione Risata / Dondolio */
.floating-emote-bubble.dyn-laugh .bubble-icon {
  animation: dynLaughTears 0.45s ease-in-out infinite alternate;
}
@keyframes dynLaughTears {
  0% { transform: rotate(-15deg) scale(1.05); }
  100% { transform: rotate(15deg) scale(1.25); }
}

.floating-emote-bubble .bubble-caption {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0,0,0,0.9);
}

.animate-pop-float {
  animation: dynamicPopAndFloat 3.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dynamicPopAndFloat {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.2) translateY(30px);
  }
  12% {
    opacity: 1;
    transform: translateX(-50%) scale(1.2) translateY(-8px);
  }
  22% {
    transform: translateX(-50%) scale(1) translateY(0);
  }
  75% {
    opacity: 1;
    transform: translateX(-50%) translateY(-14px);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-55px) scale(0.85);
  }
}

/* ==========================================================================
   3. PARTICELLE DINAMICHE SPRAY SUL PANNO DEL TAVOLO
   ========================================================================== */
.table-particle-canvas-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9998;
}

/* Pulsante Reazioni al Tavolo */
.btn-table-emotes {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.45));
  border: 1.5px solid #f59e0b;
  border-radius: 99px;
  color: #fef08a;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.btn-table-emotes:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.7);
  transform: translateY(-2px);
}
