/* ==========================================================================
   FREZZ — PREMIUM STYLE & ANIMATIONS
   Glassmorphism, particle effects, premium gradients, animations.
   ========================================================================== */

/* Particle system */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 50;
}
.particle.success {
  background: radial-gradient(circle at 30% 30%, rgba(56, 224, 139, 1), rgba(32, 181, 108, 0.8));
  box-shadow: 0 0 12px rgba(56, 224, 139, 0.6);
}
.particle.fail {
  background: radial-gradient(circle at 30% 30%, rgba(255, 107, 91, 1), rgba(217, 77, 71, 0.8));
  box-shadow: 0 0 12px rgba(255, 107, 91, 0.6);
}

/* Premium animation keyframes */
@keyframes particleBurst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

@keyframes shockwave {
  0% {
    box-shadow: 0 0 0 4px rgba(56, 224, 139, 0.5);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(56, 224, 139, 0);
  }
}

@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(100px) rotate(360deg) scale(0);
    opacity: 0;
  }
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardRise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toolbar (Hint / Auto) — outils payés en crédits Jouer partagés (CBWallet)
   ou, à défaut, une pub récompensée (CBAds.toolAd) : voir index.html. */
.toolbar {
  display: flex;
  gap: 8px;
  width: 100%;
}
.tool-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--cb-border-light);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border-radius: var(--cb-radius-md);
  padding: 8px 10px;
  color: var(--cb-text-primary);
  box-shadow: var(--cb-shadow-sm);
  transition: all var(--cb-duration-fast) var(--cb-easing-in-out);
}
.tool-btn:hover {
  border-color: var(--cb-accent);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.15), var(--cb-shadow-md);
}
.tool-btn:active { transform: scale(0.96); }
.tool-btn .ico { font-size: 1.1rem; }
.tool-btn .tmeta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.tool-btn .tname { font-weight: 800; font-size: 0.82rem; }
.tool-btn .tcost { font-size: 0.72rem; color: var(--cb-text-secondary); font-weight: 700; }

/* Boutique de thèmes cosmétiques (ov-shop / theme-grid) — visuel seul, financé
   par les crédits Jouer GAGNÉS (CBWallet.play), jamais achetés en argent réel. */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border: 1px solid var(--cb-border-light);
  border-radius: var(--cb-radius-md);
  cursor: pointer;
  font: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  transition: all var(--cb-duration-fast) var(--cb-easing-in-out);
  color: var(--cb-text-primary);
}
.theme-card:hover { border-color: var(--cb-accent); }
.theme-card.equipped { border-color: var(--cb-primary); box-shadow: 0 0 0 2px rgba(56, 224, 139, 0.25); }
.theme-card.locked { opacity: 0.6; }
.theme-card .swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: var(--cb-shadow-sm);
}
.theme-card .tlabel { font-size: 0.72rem; font-weight: 800; }
.theme-card .tstate { font-size: 0.65rem; font-weight: 700; color: var(--cb-text-secondary); }
.swatch.emerald { background: linear-gradient(135deg, #38e08b, #20b56c); }
.swatch.sapphire { background: linear-gradient(135deg, #5bb6f5, #2f7cc9); }
.swatch.ruby { background: linear-gradient(135deg, #ff6b6b, #c9302f); }
.swatch.amethyst { background: linear-gradient(135deg, #b48cf2, #7c4fd6); }
.swatch.amber { background: linear-gradient(135deg, #ffd166, #d4af37); }

/* Wallet display */
#wallet-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cb-accent);
  min-width: 120px;
  text-align: center;
}

/* Help tools panel */
#help-tools-panel {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(135deg, rgba(26, 32, 41, 0.95), rgba(20, 26, 35, 0.98));
  border: 1px solid rgba(56, 224, 139, 0.2);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--cb-shadow-xl);
  backdrop-filter: blur(16px);
  max-width: 200px;
  z-index: 40;
}
#help-tools-panel.show {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#help-tools-panel .tool-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--cb-text-primary);
  cursor: pointer;
  transition: all 0.15s ease-out;
  font-weight: 600;
}
#help-tools-panel .tool-btn:hover:not(:disabled) {
  background: rgba(56, 224, 139, 0.16);
  border-color: var(--cb-accent);
  transform: translateY(-1px);
}
#help-tools-panel .tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#help-tools-panel .tool-count {
  background: rgba(56, 224, 139, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--cb-accent);
}

@media (max-width: 480px) {
  #help-tools-panel {
    bottom: 100px;
    right: 10px;
    max-width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes particleBurst,
  @keyframes shockwave,
  @keyframes confetti,
  @keyframes slideDownFade,
  @keyframes cardRise {
    0%, 100% { opacity: 1; transform: none; }
  }
}
