/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD ADMIN V2 - Theme Builder (Mode 1)
   Styles for theme creation: uploads, collectibles, traps, missions
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   UPLOAD SYSTEM - Modern 2025
   ═══════════════════════════════════════════════════════════════════════ */

/* Input avec bouton upload */
.image-input-group {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
}

@media (max-width: 480px) {
  .image-input-group {
    flex-direction: column;
  }
  .image-input-group input,
  .image-input-group .btn-upload {
    width: 100%;
  }
}

.image-input-group input {
  flex: 1;
}

.btn-upload {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-sm);
}

.btn-upload:hover {
  box-shadow: var(--shadow-glow), var(--shadow-md);
  transform: translateY(-1px);
}

.btn-upload:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-upload.uploading {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  animation: uploadingPulse 1.5s ease-in-out infinite;
}

@keyframes uploadingPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* Preview d'image */
.image-preview-container {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.image-preview {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.image-preview:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.image-preview.loading {
  animation: skeleton-shimmer 1.5s ease infinite;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
}

.image-preview-error {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--danger);
  background: var(--danger-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--danger);
  text-align: center;
  padding: var(--space-2);
  flex-shrink: 0;
}

.image-preview-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.btn-preview-action {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-preview-action:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-preview-action.danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* Quota utilisateur */
.quota-bar {
  margin-top: var(--space-5);
  padding: var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.quota-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: 0.85rem;
}

.quota-bar-header span:first-child {
  font-weight: 500;
  color: var(--text-primary);
}

.quota-bar-header span:last-child {
  color: var(--text-muted);
}

.quota-bar-track {
  height: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

.quota-bar-fill.warning {
  background: linear-gradient(90deg, var(--warning), #F97316);
}

.quota-bar-fill.danger {
  background: linear-gradient(90deg, var(--danger), #DC2626);
}

/* Upload hidden input */
.upload-input-hidden {
  display: none;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone-icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.drop-zone-text {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.drop-zone-hint {
  color: var(--text-disabled);
  font-size: 0.8rem;
  margin-top: var(--space-2);
}

/* Gestionnaire d'images */
.images-manager {
  margin-top: var(--space-5);
  padding: var(--space-5);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.images-manager h4 {
  margin-bottom: var(--space-4);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: var(--space-3);
}

@media (min-width: 768px) {
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

.image-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: all var(--transition-fast);
  background: var(--bg-secondary);
}

.image-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.image-item:hover img {
  transform: scale(1.05);
}

.image-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: var(--space-3);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.image-item:hover .image-item-overlay {
  opacity: 1;
}

.image-item-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}

.image-item-btn {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border: none;
  color: white;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.image-item-btn:hover {
  background: var(--primary);
  transform: scale(1.05);
}

.image-item-btn.delete:hover {
  background: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════
   COLLECTIBLES & SHARED UTILITIES
   (V1 styles removed - see V2 styles below)
   ═══════════════════════════════════════════════════════════════════════ */

/* Drag handle - Shared utility */
.drag-handle {
  color: var(--text-muted);
  font-size: 1rem;
  cursor: grab;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
  padding: var(--space-1);
  margin-left: calc(-1 * var(--space-2));
}

.collectible-card:hover .drag-handle {
  opacity: 0.8;
}

.drag-handle:active {
  cursor: grabbing;
}

/* ═══════════════════════════════════════════════════════════════════════
   V1 STYLES REMOVED
   Collectibles V1, Traps V1, Missions V1 have been replaced by V2 styles
   See sections below: *-section-v2 classes
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   THEME LIBRARY - Sidebar
   ═══════════════════════════════════════════════════════════════════════ */

.theme-library {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.theme-library h4 {
  margin-bottom: var(--space-3);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.library-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.library-item-info {
  flex: 1;
  min-width: 0;
}

.library-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.library-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.visibility-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
}

.visibility-badge.public {
  background: rgba(87, 242, 135, 0.2);
  color: var(--success);
}

.visibility-badge.private {
  background: rgba(156, 89, 182, 0.2);
  color: var(--epic);
}

/* Library item actions */
.library-item-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-icon-action {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.btn-icon-action:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-color: var(--border);
}

.btn-delete:hover {
  color: var(--danger);
  background: var(--danger-light);
  border-color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════
   LOADERS - Modern 2025
   ═══════════════════════════════════════════════════════════════════════ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  z-index: var(--z-toast);
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  box-shadow: 0 0 20px var(--primary-glow);
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  animation: pulse 1.5s ease-in-out infinite;
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 1em;
  margin-bottom: var(--space-2);
}

.skeleton-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 100px;
  width: 100%;
}

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS - Modern 2025
   ═══════════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

@media (max-width: 767px) {
  .toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: 80px;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: toastSlideIn var(--transition-normal);
  min-width: 300px;
  max-width: 450px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--info); }

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.toast-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   EMPTY STATES & ACCESS DENIED
   ═══════════════════════════════════════════════════════════════════════ */

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state p {
  margin-bottom: var(--space-4);
  font-size: 1rem;
}

/* Empty state compact */
.empty-state.compact {
  padding: var(--space-6);
}

.empty-state.compact .empty-icon {
  font-size: 2rem;
}

.empty-state.compact p {
  font-size: 0.9rem;
}

/* Access denied message */
.access-denied {
  text-align: center;
  padding: var(--space-10) var(--space-5);
}

.access-denied-icon {
  font-size: 4rem;
  margin-bottom: var(--space-5);
  filter: grayscale(50%);
}

.access-denied h2 {
  color: var(--danger);
  margin-bottom: var(--space-4);
  font-size: 1.5rem;
}

.access-denied p {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 1.3 - Theme Selector Modal
   ═══════════════════════════════════════════════════════════════════════ */

.theme-selector-modal {
  max-width: 600px;
  width: 95%;
}

.theme-selector-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 500px) {
  .theme-selector-options {
    grid-template-columns: 1fr;
  }
}

.theme-selector-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.theme-selector-card:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.theme-selector-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.theme-selector-card-icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
  display: block;
}

.theme-selector-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.theme-selector-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Public themes list */
.public-themes-list {
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: var(--space-4);
}

.public-theme-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.public-theme-item:hover {
  background: var(--bg-card-hover);
}

.public-theme-item.selected {
  background: var(--primary-light);
  border-color: var(--primary);
}

.public-theme-item-name {
  font-weight: 500;
  color: var(--text-primary);
}

.public-theme-item-author {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.public-theme-item-stats {
  margin-left: auto;
  display: flex;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Theme Builder Header Actions */
.theme-builder-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.theme-builder-header-actions .examples-dropdown {
  margin: 0;
  padding: 0;
}

.theme-builder-header-actions .examples-dropdown select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  min-width: 200px;
}

@media (max-width: 600px) {
  .theme-builder-header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .theme-builder-header-actions .btn {
    width: 100%;
  }
  .theme-builder-header-actions .examples-dropdown select {
    width: 100%;
  }
}

/* Theme Selector Modal - Tabs */
.theme-selector-content {
  padding: var(--space-4);
}

.theme-selector-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-3);
}

.theme-selector-tab {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
}

.theme-selector-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.theme-selector-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Theme Selector Modal - Body */
.theme-selector-body {
  min-height: 200px;
}

.theme-selector-blank {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}

.theme-selector-blank .blank-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.theme-selector-blank h4 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.theme-selector-blank p {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

.theme-selector-loading {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.theme-selector-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.theme-selector-empty {
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  max-height: 300px;
  overflow-y: auto;
  padding: var(--space-2);
}

/* Override for theme selector grid cards */
.theme-selector-grid .theme-selector-card {
  text-align: left;
}

.theme-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.theme-card-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.featured-badge {
  font-size: 1.2rem;
}

.theme-card-meta {
  display: flex;
  gap: var(--space-3);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.theme-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.theme-selector-actions {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  text-align: center;
}

/* JSON Preview Actions */
.json-preview-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.json-preview-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin: var(--space-4);
  padding: var(--space-4);
  max-height: 60vh;
}

.json-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 1.3 - JSON Preview FAB (Floating Action Button)
   ═══════════════════════════════════════════════════════════════════════ */

.json-preview-fab {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg), 0 0 20px var(--primary-glow);
  transition: all var(--transition-normal);
  z-index: var(--z-sticky);
}

.json-preview-fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl), 0 0 30px var(--primary-glow);
}

.json-preview-fab:active {
  transform: scale(0.95);
}

/* Mobile: smaller FAB */
@media (max-width: 767px) {
  .json-preview-fab {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    bottom: 80px; /* Above mobile nav */
    right: var(--space-4);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 1.3 - JSON Preview Modal
   ═══════════════════════════════════════════════════════════════════════ */

.json-preview-modal {
  max-width: 800px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.json-preview-modal .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.json-preview-modal .json-preview-content {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin: var(--space-4);
  padding: var(--space-4);
}

.json-preview-modal pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}

.json-preview-modal .modal-footer {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  padding: var(--space-4);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 1.3 - Hide Preview Panel (replaced by FAB + Modal)
   ═══════════════════════════════════════════════════════════════════════ */

/* Hide the old fixed preview panel - now using FAB + Modal */
.preview-panel {
  display: none !important;
}

/* Adjust main layout without preview panel */
@media (min-width: 1200px) {
  .main-layout {
    grid-template-columns: 260px 1fr !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   LIBRARY SECTION - Refactorisé selon MASTER-PLAN V3
   Section Bibliothèque avec dual-mode (JSON / DB)
   ═══════════════════════════════════════════════════════════════════════ */

.library-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Header Bar avec titre et toggle */
.library-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.library-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.library-title .icon {
  font-size: 1.3rem;
}

/* Mode Toggle - Style MASTER-PLAN */
.mode-toggle {
  display: flex;
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.mode-btn {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  min-width: 160px;
}

.mode-btn .mode-icon {
  font-size: 1.2rem;
}

.mode-btn .mode-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mode-btn .mode-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.mode-btn.active .mode-text {
  color: var(--text-primary);
}

.mode-btn.active .mode-desc {
  color: var(--text-secondary);
}

.mode-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal);
}

.mode-slider.right {
  transform: translateX(100%);
}

@media (max-width: 600px) {
  .library-header-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-toggle {
    width: 100%;
  }

  .mode-btn {
    flex: 1;
    min-width: auto;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MODE DB - Contenu Serveur
   ═══════════════════════════════════════════════════════════════════════ */

.library-db-content,
.library-json-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Prompt sélection serveur */
.server-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-10);
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
}

.prompt-visual {
  position: relative;
  margin-bottom: var(--space-5);
}

.prompt-icon {
  font-size: 4rem;
}

.prompt-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: var(--primary-glow);
  animation: pulse 2s ease-out infinite;
  z-index: -1;
}

@keyframes pulse {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

.server-prompt h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.server-prompt p {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

/* Contenu Guild */
.guild-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Header Guild */
.guild-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.guild-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.guild-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border);
}

.guild-icon-placeholder {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

.guild-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guild-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.guild-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.guild-actions {
  display: flex;
  gap: var(--space-2);
}

/* Skeleton loading */
.guild-skeleton {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.skeleton-hero {
  height: 200px;
  background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--radius-lg);
}

.skeleton-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════════════════
   THÈME ACTIF - Card Hero
   ═══════════════════════════════════════════════════════════════════════ */

.active-theme-card {
  position: relative;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  overflow: hidden;
}

.active-theme-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--success), var(--primary));
  background-size: 200% 100%;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--success-light);
  color: var(--success);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: var(--radius-full);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.active-theme-card .theme-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-2);
}

.active-theme-card .theme-description {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
  font-size: 0.95rem;
}

/* Infos clés */
.theme-key-info {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
  padding: var(--space-4);
  background: var(--bg-input);
  border-radius: var(--radius-lg);
}

.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.info-icon {
  font-size: 1.2rem;
}

.info-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Stats éléments */
.theme-elements {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.element-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.element-stat .stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.element-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Actions */
.theme-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* No active theme */
.no-active-theme {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8);
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
}

.no-theme-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.no-active-theme h3 {
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.no-active-theme p {
  color: var(--text-muted);
  margin-bottom: var(--space-5);
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTRES THÈMES DU SERVEUR
   ═══════════════════════════════════════════════════════════════════════ */

.other-themes-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.section-header h4 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.section-header h4 .icon {
  font-size: 1.1rem;
}

.count-badge {
  background: var(--bg-input);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* Mini theme card */
.mini-theme-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: all var(--transition-fast);
}

.mini-theme-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.mini-theme-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-theme-stats {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mini-theme-actions {
  display: flex;
  gap: var(--space-2);
}

/* Onglets Déployés / Mes créations */
.theme-list-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-1);
  background: var(--bg-input);
  border-radius: var(--radius-md);
}

.theme-list-tabs .tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-list-tabs .tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.theme-list-tabs .tab-btn.active {
  background: var(--primary);
  color: white;
}

.theme-list-tabs .tab-icon {
  font-size: 1rem;
}

.theme-list-tabs .tab-count {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.theme-list-tabs .tab-btn.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
}

/* Empty tab message */
.empty-tab-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

.empty-tab-message .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
  opacity: 0.6;
}

.empty-tab-message p {
  margin: 0 0 var(--space-4);
  font-size: 0.9rem;
}

.btn-create-small {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-create-small:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* My Creation card variant */
.mini-theme-card.my-creation {
  border-color: var(--primary);
  border-style: dashed;
}

.mini-theme-card.my-creation:hover {
  border-style: solid;
  border-color: var(--primary);
}

/* Draft badge */
.draft-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(var(--warning-rgb), 0.15);
  color: var(--warning);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Empty stats text */
.empty-stats {
  font-style: italic;
  opacity: 0.7;
}

/* Deploy button */
.btn-deploy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, var(--success), #10b981);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-deploy:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Themes carousel */
.themes-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════════════════
   STATS SERVEUR
   ═══════════════════════════════════════════════════════════════════════ */

.guild-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

@media (max-width: 600px) {
  .guild-stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-box {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat-icon {
  font-size: 1.8rem;
}

.stat-content {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-name {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   MODE JSON - Nouveau Thème
   ═══════════════════════════════════════════════════════════════════════ */

/* Section titre */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
}

.section-title .icon {
  font-size: 1.2rem;
}

/* Création de thème */
.create-theme-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.create-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

@media (max-width: 768px) {
  .create-options {
    grid-template-columns: 1fr;
  }
}

.create-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.create-option:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.create-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.create-option input[type="radio"] {
  display: none;
}

.option-visual {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
}

.option-icon {
  font-size: 2rem;
}

.option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.option-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.option-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Action création */
.create-action {
  display: flex;
  justify-content: center;
}

/* Zone import */
.import-zone {
  width: 100%;
  max-width: 500px;
}

.import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6);
  background: var(--bg-input);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.import-dropzone:hover {
  border-color: var(--primary);
  background: var(--bg-card);
}

.dropzone-icon {
  font-size: 2.5rem;
}

.dropzone-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hidden-input {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   DESTINATION - Privé/Public
   ═══════════════════════════════════════════════════════════════════════ */

.destination-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.destination-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 600px) {
  .destination-options {
    grid-template-columns: 1fr;
  }
}

.destination-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.destination-option:hover {
  border-color: var(--primary);
}

.destination-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.destination-option input[type="radio"] {
  display: none;
}

.dest-icon {
  font-size: 1.8rem;
}

.dest-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dest-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.dest-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   THÈMES COMMUNAUTÉ
   ═══════════════════════════════════════════════════════════════════════ */

.community-themes-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}

.community-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.community-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-preview {
  position: relative;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-icon {
  font-size: 2rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.featured-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1rem;
}

.card-body {
  padding: var(--space-3);
}

.card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-author {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--border);
}

.visibility-tag {
  font-size: 0.9rem;
}

.see-more {
  text-align: center;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.see-more-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   BOUTONS UTILITAIRES
   ═══════════════════════════════════════════════════════════════════════ */

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-xs {
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: 1rem;
}

.btn-glow {
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-glow:hover {
  box-shadow: 0 0 25px var(--primary-glow);
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════════
   PRESET SELECTOR MODAL
   ═══════════════════════════════════════════════════════════════════════ */

.preset-selector-modal {
  max-width: 700px;
  width: 95%;
}

.preset-description {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  text-align: center;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.preset-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preset-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.preset-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: var(--space-3);
}

.preset-info {
  width: 100%;
}

.preset-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 var(--space-1) 0;
}

.preset-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-2) 0;
}

.preset-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.preset-stats span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════════════
   LIBRARY SECTION V4 - Modern & Dynamic Design
   ═══════════════════════════════════════════════════════════════════════ */

.library-section-v4 {
  animation: fadeIn 0.3s ease-out;
}

/* ═══════════════════════════════════════════════════════════════════
   MODE TOGGLE HERO - Glassmorphism Design
   ═══════════════════════════════════════════════════════════════════ */

.mode-toggle-hero {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
}

.toggle-container {
  display: flex;
  align-items: center;
  position: relative;
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 60px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.toggle-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  background: transparent;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
  min-width: 180px;
  justify-content: center;
}

.toggle-btn:hover {
  color: var(--text);
}

.toggle-btn.active {
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-icon {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.toggle-btn:hover .toggle-icon {
  transform: scale(1.15);
}

.toggle-glow {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toggle-btn.active .toggle-glow {
  opacity: 1;
  animation: pulse-glow 2s infinite;
}

.toggle-text {
  white-space: nowrap;
}

.toggle-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.toggle-divider {
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.2), transparent);
  margin: 0 var(--space-2);
}

.divider-dot {
  display: none;
}

.toggle-slider-bg {
  position: absolute;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  border-radius: 50px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 15px rgba(99, 102, 241, 0.4),
    0 0 30px rgba(139, 92, 246, 0.2);
  z-index: 1;
}

.toggle-slider-bg.right {
  transform: translateX(calc(100% + 6px));
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 0.3; }
}

/* ═══════════════════════════════════════════════════════════════════
   SERVER PROMPT - Selection Card
   ═══════════════════════════════════════════════════════════════════ */

.server-prompt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-2xl);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.server-prompt-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
  animation: rotate-bg 20s linear infinite;
}

@keyframes rotate-bg {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.prompt-animation {
  position: relative;
  width: 150px;
  height: 150px;
  margin-bottom: var(--space-6);
}

.floating-icons {
  position: absolute;
  inset: 0;
}

.float-icon {
  position: absolute;
  font-size: 1.5rem;
  animation: float-around 4s ease-in-out infinite;
  animation-delay: var(--delay);
}

.float-icon:nth-child(1) { top: 0; left: 50%; transform: translateX(-50%); }
.float-icon:nth-child(2) { top: 50%; right: 0; transform: translateY(-50%); }
.float-icon:nth-child(3) { bottom: 0; left: 50%; transform: translateX(-50%); }
.float-icon:nth-child(4) { top: 50%; left: 0; transform: translateY(-50%); }

@keyframes float-around {
  0%, 100% { transform: translate(-50%, 0) scale(1); opacity: 0.6; }
  50% { transform: translate(-50%, -10px) scale(1.1); opacity: 1; }
}

.prompt-icon-main {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.1); }
}

.prompt-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 var(--space-3) 0;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
}

.prompt-desc {
  color: var(--text-muted);
  margin: 0 0 var(--space-6) 0;
  font-size: 1rem;
  max-width: 400px;
  position: relative;
  z-index: 1;
}

/* Hero Buttons */
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.btn-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.btn-hero:hover::before {
  opacity: 1;
}

.btn-hero .btn-content,
.btn-hero .btn-icon {
  position: relative;
  z-index: 1;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ═══════════════════════════════════════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════════════════════════════════════ */

.loading-skeleton {
  padding: var(--space-6);
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.skeleton-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  background: var(--bg-tertiary);
}

.skeleton-lines {
  flex: 1;
}

.skeleton-line {
  height: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  margin-bottom: var(--space-2);
}

.skeleton-line.w70 { width: 70%; }
.skeleton-line.w50 { width: 50%; }

.skeleton-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.skeleton-card {
  height: 200px;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
}

.pulse {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══════════════════════════════════════════════════════════════════
   ACTIVE THEME HERO - Main Theme Card
   ═══════════════════════════════════════════════════════════════════ */

.active-theme-hero {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: var(--space-8);
  min-height: 400px;
}

.theme-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-particles .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: float-particle 8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.3s);
  left: calc(var(--i) * 5%);
  top: calc(var(--i) * 4%);
}

@keyframes float-particle {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-30px) scale(1.5);
    opacity: 1;
  }
}

.theme-hero-content {
  position: relative;
  z-index: 1;
  padding: var(--space-8);
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

.badge-text {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  margin: 0 0 var(--space-3) 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-desc {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin: 0 0 var(--space-6) 0;
  max-width: 600px;
}

/* Hero Stats - Animated Rings */
.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.stat-ring {
  position: relative;
  width: 70px;
  height: 70px;
  color: var(--color);
}

.stat-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.stat-ring circle {
  transition: stroke-dashoffset 1s ease-out;
}

.stat-ring .stat-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
}

.stat-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Hero Meta Tags */
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-icon {
  font-size: 1rem;
}

/* Hero Actions */
.hero-actions {
  display: flex;
  gap: var(--space-4);
}

.btn-primary-glow,
.btn-secondary-glow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-primary-glow {
  background: white;
  color: #1e293b;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 255, 255, 0.4);
}

.btn-secondary-glow {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary-glow:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-danger-glow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger-glow:hover {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════
   NO THEME CARD
   ═══════════════════════════════════════════════════════════════════ */

.no-theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12);
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-2xl);
  margin-bottom: var(--space-8);
}

.no-theme-visual {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-6);
}

.no-theme-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  z-index: 1;
}

.no-theme-rings {
  position: absolute;
  inset: 0;
}

.no-theme-rings .ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--border);
  border-radius: 50%;
  animation: expand-ring 3s ease-out infinite;
}

.no-theme-rings .ring:nth-child(1) { animation-delay: 0s; }
.no-theme-rings .ring:nth-child(2) { animation-delay: 1s; }
.no-theme-rings .ring:nth-child(3) { animation-delay: 2s; }

@keyframes expand-ring {
  0% { width: 60px; height: 60px; opacity: 1; }
  100% { width: 120px; height: 120px; opacity: 0; }
}

.no-theme-card h3 {
  font-size: 1.5rem;
  margin: 0 0 var(--space-3) 0;
  color: var(--text);
}

.no-theme-card p {
  color: var(--text-muted);
  margin: 0 0 var(--space-6) 0;
}

/* ═══════════════════════════════════════════════════════════════════
   OTHER THEMES SECTION
   ═══════════════════════════════════════════════════════════════════ */

.other-themes-section {
  margin-top: var(--space-8);
}

.section-header-fancy {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.header-icon {
  font-size: 1.5rem;
}

.section-header-fancy h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.header-count {
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.themes-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
}

.mini-theme-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all 0.3s ease;
}

.mini-theme-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.mini-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.mini-icon {
  font-size: 1.5rem;
}

.mini-card-header h5 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.mini-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mini-actions {
  display: flex;
  gap: var(--space-2);
}

.btn-activate {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-activate:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-edit {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-edit:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-delete {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-delete:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Toast action button styles */
.toast-action-btn.danger {
  background: #ef4444;
  color: white;
  border: none;
}

.toast-action-btn.danger:hover {
  background: #dc2626;
}

/* Theme List Tabs - Brouillons / Déployés */
.theme-list-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-1);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
}

.theme-list-tabs .tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-list-tabs .tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.theme-list-tabs .tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.theme-list-tabs .tab-icon {
  font-size: 1rem;
}

.theme-list-tabs .tab-count {
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.theme-list-tabs .tab-btn.active .tab-count {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

/* Draft Theme Card Styling */
.mini-theme-card.is-draft {
  border-style: dashed;
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.03);
}

.mini-theme-card.is-draft:hover {
  border-color: var(--warning);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.draft-badge {
  margin-left: auto;
  background: var(--warning);
  color: #1a1a2e;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* No themes filtered message */
.no-themes-filtered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--text-muted);
  text-align: center;
}

.no-themes-filtered .empty-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-3);
  opacity: 0.5;
}

.no-themes-filtered p {
  margin: 0;
  font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════════════
   NEW THEME MODE - Creation Options
   ═══════════════════════════════════════════════════════════════════ */

.new-theme-mode-content {
  animation: fadeIn 0.3s ease-out;
}

.creation-options-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.creation-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.creation-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.creation-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.creation-card:hover::before {
  opacity: 1;
}

.creation-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.creation-card.selected::before {
  opacity: 1;
}

/* Disabled Card (En développement) */
.creation-card.disabled-card {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
}

.creation-card.disabled-card:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.creation-card.disabled-card .card-visual {
  filter: grayscale(40%);
}

.creation-card.disabled-card .dev-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  z-index: 2;
}

/* Import Coming Soon Content */
.import-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  text-align: center;
  min-height: 300px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
}

.coming-soon-visual {
  margin-bottom: var(--space-6);
  position: relative;
}

.coming-soon-icon {
  font-size: 4rem;
  display: block;
  animation: bounce-slow 2s ease-in-out infinite;
}

@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.construction-bars {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: var(--space-3);
}

.construction-bars .bar {
  width: 8px;
  height: 24px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  border-radius: 4px;
  animation: bar-wave 1.2s ease-in-out infinite;
}

.construction-bars .bar:nth-child(2) { animation-delay: 0.2s; }
.construction-bars .bar:nth-child(3) { animation-delay: 0.4s; }

@keyframes bar-wave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

.import-coming-soon h4 {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.import-coming-soon p {
  color: var(--text-secondary);
  margin: 0 0 var(--space-4) 0;
}

.coming-soon-hint {
  font-size: 0.85rem;
  color: var(--primary);
  opacity: 0.8;
}

.card-visual {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xl);
}

.card-visual.blank { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.card-visual.community { background: linear-gradient(135deg, #10b981, #059669); }
.card-visual.import { background: linear-gradient(135deg, #f59e0b, #d97706); }

.visual-icon {
  font-size: 2.5rem;
  position: relative;
  z-index: 1;
}

.visual-particles {
  position: absolute;
  inset: 0;
}

.particle-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: orbit-particle 3s linear infinite;
}

.particle-dot:nth-child(1) { animation-delay: 0s; }
.particle-dot:nth-child(2) { animation-delay: 0.5s; }
.particle-dot:nth-child(3) { animation-delay: 1s; }
.particle-dot:nth-child(4) { animation-delay: 1.5s; }
.particle-dot:nth-child(5) { animation-delay: 2s; }
.particle-dot:nth-child(6) { animation-delay: 2.5s; }

@keyframes orbit-particle {
  0% { transform: rotate(0deg) translateX(35px); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: rotate(360deg) translateX(35px); opacity: 0; }
}

.card-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.card-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.card-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.card-check {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.creation-card.selected .card-check {
  opacity: 1;
  transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════
   BLANK THEME CONTENT
   ═══════════════════════════════════════════════════════════════════ */

.blank-content {
  animation: fadeIn 0.3s ease-out;
}

.blank-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-8);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.blank-illustration {
  width: 200px;
  height: 150px;
  margin-bottom: var(--space-6);
  position: relative;
}

.canvas-frame {
  position: absolute;
  inset: 0;
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.brush-stroke {
  position: absolute;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  animation: paint-stroke 2s ease-in-out infinite;
  animation-delay: var(--delay);
}

.brush-stroke:nth-child(1) { top: 30%; width: 0; left: 20%; }
.brush-stroke:nth-child(2) { top: 50%; width: 0; left: 30%; }
.brush-stroke:nth-child(3) { top: 70%; width: 0; left: 15%; }

@keyframes paint-stroke {
  0%, 100% { width: 0; opacity: 0; }
  50% { width: 60%; opacity: 1; }
}

.blank-hero h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--space-3) 0;
  color: var(--text);
}

.blank-hero p {
  color: var(--text-muted);
  margin: 0 0 var(--space-6) 0;
  max-width: 400px;
}

.btn-hero-gradient {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.btn-hero-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.btn-sparkle {
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(15deg); }
}

/* ═══════════════════════════════════════════════════════════════════
   COMMUNITY THEMES - Toolbar & Grid
   ═══════════════════════════════════════════════════════════════════ */

.community-content {
  animation: fadeIn 0.3s ease-out;
}

.community-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.clear-search {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.clear-search:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--primary-light);
  color: var(--text);
}

.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pill-icon {
  font-size: 0.9rem;
}

.difficulty-filter {
  min-width: 180px;
}

.diff-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.diff-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Presets Loading */
.presets-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
}

.loading-spinner-fancy {
  position: relative;
  width: 60px;
  height: 60px;
  margin-bottom: var(--space-4);
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) { animation-delay: -0.45s; }
.spinner-ring:nth-child(2) { animation-delay: -0.3s; inset: 8px; border-top-color: var(--primary-light); }
.spinner-ring:nth-child(3) { animation-delay: -0.15s; inset: 16px; border-top-color: #a855f7; }

@keyframes spin-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.presets-loading p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Presets Empty */
.presets-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-12);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
}

.presets-empty .empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.presets-empty h4 {
  font-size: 1.2rem;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.presets-empty p {
  color: var(--text-muted);
  margin: 0;
}

/* Presets Grid (Masonry-style) */
.presets-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.preset-card-fancy {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.preset-card-fancy:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
}

.preset-card-fancy .preset-cover {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.3));
}

/* Image de bannière dans les cards */
.preset-card-fancy .preset-cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Overlay sombre sur l'image pour meilleure lisibilité */
.preset-card-fancy .preset-cover:has(.preset-cover-image)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Badge au-dessus de l'image */
.preset-card-fancy .preset-cover .preset-difficulty-badge {
  z-index: 3;
}

.preset-icon-main {
  font-size: 3.5rem;
  position: relative;
  z-index: 2;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.preset-card-fancy:hover .preset-icon-main {
  transform: scale(1.15);
}

.cover-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 60%
  );
  background-size: 200% 200%;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.preset-difficulty-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  backdrop-filter: blur(10px);
  z-index: 3;
}

.preset-difficulty-badge.difficulty-easy {
  background: rgba(16, 185, 129, 0.9);
}

.preset-difficulty-badge.difficulty-medium {
  background: rgba(245, 158, 11, 0.9);
}

.preset-difficulty-badge.difficulty-hard {
  background: rgba(239, 68, 68, 0.9);
}

.preset-body {
  padding: var(--space-4);
}

.preset-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.preset-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-3) 0;
}

.author-icon {
  font-size: 0.85rem;
}

.preset-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-4) 0;
  line-height: 1.5;
}

.preset-stats-bar {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.stat-mini {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.stat-mini .stat-icon {
  font-size: 0.9rem;
}

.stat-mini .stat-val {
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════
   HOVER OVERLAY - Cards avec 2 boutons (Utiliser / Voir)
   ═══════════════════════════════════════════════════════════════════ */

.preset-hover-overlay,
.card-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 30, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  border-radius: inherit;
}

.preset-hover-overlay.visible,
.card-hover-overlay.visible {
  opacity: 1;
}

/* Container des 2 boutons */
.hover-actions-dual {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.preset-hover-overlay.visible .hover-actions-dual,
.card-hover-overlay.visible .hover-actions-dual {
  transform: scale(1);
}

/* Boutons hover - style commun */
.hover-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  min-width: 140px;
  justify-content: center;
}

.hover-btn .btn-icon {
  font-size: 1.1rem;
}

/* Bouton Utiliser - Accent (violet/indigo) */
.hover-btn-use {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.hover-btn-use:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

/* Bouton Voir - Glass/Ghost */
.hover-btn-view {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
}

.hover-btn-view:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Legacy support - ancien hover-action */
.hover-action {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  border: 2px solid white;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.preset-hover-overlay.visible .hover-action {
  transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════
   TRENDING LIST - Boutons d'action
   ═══════════════════════════════════════════════════════════════════ */

.trending-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.trending-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.trending-btn-use {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
}

.trending-btn-use:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  transform: translateY(-1px);
}

.trending-btn-view {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.trending-btn-view:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════════════
   FORK SYSTEM - Boutons et badges
   ═══════════════════════════════════════════════════════════════════ */

/* Bouton Fork - Style distinct (vert/teal) */
.hover-btn-fork {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
}

.hover-btn-fork:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.5);
}

.trending-btn-fork {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: white;
}

.trending-btn-fork:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  transform: translateY(-1px);
}

/* Mobile fork button */
.mobile-btn-fork {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: white !important;
}

.mobile-btn-fork:hover {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

/* Badge "Votre création" */
.own-badge, .own-badge-small {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: middle;
}

.own-badge-small {
  font-size: 0.65rem;
  padding: 1px 4px;
}

/* Badge Fork info */
.preset-fork-info, .featured-fork-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.fork-icon {
  opacity: 0.8;
}

.fork-badge-small {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  padding: 1px 6px;
  background: rgba(20, 184, 166, 0.15);
  color: #14b8a6;
  border-radius: 999px;
  font-weight: 500;
}

/* Triple hover actions (3 boutons) */
.hover-actions-triple {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE - Cards et boutons
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Overlay toujours visible sur mobile (pas de hover) */
  .preset-card-fancy .preset-hover-overlay,
  .featured-card .card-hover-overlay {
    opacity: 0;
    pointer-events: none;
  }

  /* Afficher boutons dans le body de la card sur mobile */
  .preset-card-fancy,
  .featured-card {
    position: relative;
  }

  /* Boutons en ligne sur mobile pour trending */
  .trending-actions {
    flex-direction: column;
    gap: 6px;
  }

  .trending-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* Mobile: Boutons toujours visibles en bas de card */
  .preset-body::after,
  .featured-body::after {
    content: '';
    display: block;
    height: 60px; /* Espace pour les boutons */
  }

  .preset-card-fancy .mobile-actions,
  .featured-card .mobile-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
  }
}

@media (max-width: 480px) {
  .hover-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    min-width: 120px;
  }

  .trending-actions {
    width: 100%;
    margin-top: 8px;
  }

  .trending-item {
    flex-wrap: wrap;
  }

  .trending-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE ACTIONS - Boutons visibles sur mobile
   ═══════════════════════════════════════════════════════════════════ */

/* Cachés par défaut sur desktop */
.card-mobile-actions {
  display: none;
}

/* Affichés sur mobile */
@media (max-width: 768px) {
  .card-mobile-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .mobile-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
  }

  .mobile-btn-use {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
  }

  .mobile-btn-use:hover,
  .mobile-btn-use:active {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  }

  .mobile-btn-view {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border);
  }

  .mobile-btn-view:hover,
  .mobile-btn-view:active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
  }
}

@media (max-width: 480px) {
  .card-mobile-actions {
    flex-direction: column;
    gap: 6px;
  }

  .mobile-btn {
    padding: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   IMPORT CONTENT - Dropzone
   ═══════════════════════════════════════════════════════════════════ */

.import-content {
  animation: fadeIn 0.3s ease-out;
}

.import-dropzone-fancy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  background: var(--bg-card);
  border: 3px dashed var(--border);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.import-dropzone-fancy:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.dropzone-visual {
  margin-bottom: var(--space-4);
}

.upload-animation {
  position: relative;
  width: 80px;
  height: 80px;
}

.upload-arrow {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: var(--primary);
  animation: bounce-up 1.5s ease-in-out infinite;
}

@keyframes bounce-up {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

.upload-cloud {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
}

.import-dropzone-fancy h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.import-dropzone-fancy p {
  color: var(--text-muted);
  margin: 0 0 var(--space-4) 0;
}

.file-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}

.hidden-input {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   DESTINATION SECTION
   ═══════════════════════════════════════════════════════════════════ */

.destination-section-fancy {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-top: var(--space-8);
}

.dest-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.dest-header .dest-icon {
  font-size: 1.5rem;
}

.dest-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.dest-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.dest-option {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.dest-option:hover {
  border-color: var(--primary-light);
  background: var(--bg-secondary);
}

.dest-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.dest-option input {
  display: none;
}

.dest-visual {
  width: 50px;
  height: 50px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dest-emoji {
  font-size: 1.5rem;
}

.dest-info {
  flex: 1;
}

.dest-name {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-1);
}

.dest-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dest-check {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.3s ease;
}

.dest-option.selected .dest-check {
  opacity: 1;
  transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .creation-options-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    flex-wrap: wrap;
    gap: var(--space-4);
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn-primary-glow,
  .btn-secondary-glow {
    width: 100%;
    justify-content: center;
  }

  .presets-masonry {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .community-toolbar {
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-pills {
    order: 2;
  }

  .difficulty-filter {
    order: 1;
    width: 100%;
  }
}

@media (max-width: 600px) {
  .toggle-container {
    flex-direction: column;
    border-radius: var(--radius-xl);
  }

  .toggle-btn {
    min-width: 100%;
    padding: var(--space-4);
  }

  .toggle-divider {
    width: 80%;
    height: 1px;
    margin: var(--space-1) 0;
  }

  .toggle-slider-bg {
    width: calc(100% - 12px);
    height: calc(50% - 3px);
  }

  .toggle-slider-bg.right {
    transform: translateY(calc(100% + 6px));
  }

  .dest-options {
    grid-template-columns: 1fr;
  }

  .themes-carousel {
    grid-template-columns: 1fr;
  }

  .skeleton-cards {
    grid-template-columns: 1fr;
  }

  .active-theme-hero {
    min-height: 350px;
  }

  .theme-hero-content {
    padding: var(--space-6);
    min-height: 350px;
  }

  .presets-masonry {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   DEPLOY MODAL - Confirmation with Activate Option
   ═══════════════════════════════════════════════════════════════════════ */

.deploy-modal {
  max-width: 480px;
  width: 95%;
}

.deploy-modal .modal-body {
  padding: var(--space-6);
}

.deploy-info {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-align: center;
}

.deploy-info strong {
  color: var(--primary);
}

.deploy-already-uptodate {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(147, 197, 253, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.deploy-already-uptodate .info-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

.deploy-details {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.deploy-details li {
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.deploy-option {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.deploy-option .checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  font-weight: 500;
}

.deploy-option .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.deploy-option .checkbox-text {
  color: var(--text-primary);
}

.deploy-option .option-hint {
  margin: var(--space-2) 0 0;
  padding-left: 31px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.deploy-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════
   THEME SECTION V2 - Modern Card-Based Design
   ═══════════════════════════════════════════════════════════════════════ */

.theme-section {
  background: transparent;
  padding: 0;
}

/* Section Header Fancy - Gradient avec glow */
.theme-section .section-header-fancy {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  animation: header-glow-pulse 4s ease-in-out infinite;
}

.theme-section .section-header-fancy::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.1), transparent);
  animation: header-shimmer 4s ease-in-out infinite;
}

@keyframes header-glow-pulse {
  0%, 100% {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
  }
  50% {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.2);
  }
}

@keyframes header-shimmer {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

.theme-section .header-visual {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.theme-section .header-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  line-height: 1;
  z-index: 2;
}

.theme-section .header-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.25) 100%);
  border-radius: 12px;
  z-index: 1;
}

.theme-section .header-content {
  flex: 1;
}

.theme-section .header-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--space-1) 0;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 3s ease-in-out infinite;
}

@keyframes shimmer-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.theme-section .header-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Active Theme Badge */
.theme-section .active-theme-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  margin-left: auto;
}

.theme-section .active-theme-badge .badge-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.theme-section .active-theme-badge .badge-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #10b981;
}

/* Days Remaining Display */
.theme-section .days-remaining-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.theme-section .days-remaining-display .days-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.theme-section .days-remaining-display .days-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════
   UNIFIED SECTION HEADER STYLES - All Builder Sections
   ═══════════════════════════════════════════════════════════════════════ */

/* Base styles for all section headers */
.builder-section .section-header-fancy {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(99, 102, 241, 0.3);
  position: relative;
  overflow: hidden;
  animation: header-glow-pulse 4s ease-in-out infinite;
}

.builder-section .section-header-fancy::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.1), transparent);
  animation: header-shimmer 4s ease-in-out infinite;
}

.builder-section .header-visual {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.builder-section .header-icon {
  font-size: 2.2rem;
  position: absolute;
  z-index: 2;
  bottom: 8px;
  right: 8px;
  animation: pulse-icon 2s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.builder-section .header-glow {
  position: absolute;
  width: 50px;
  height: 50px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, rgba(139, 92, 246, 0.3) 40%, transparent 70%);
  border-radius: 50%;
  animation: pulse-glow 2s ease-in-out infinite;
}

.builder-section .header-content {
  flex: 1;
}

.builder-section .header-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 var(--space-1) 0;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer-text 3s ease-in-out infinite;
}

.builder-section .header-desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Probabilités Section - Green/Blue gradient */
.probabilities-section-v2 .section-header-fancy {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(99, 102, 241, 0.08) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

.probabilities-section-v2 .section-header-fancy::before {
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
}

.probabilities-section-v2 .header-glow {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.5) 0%, rgba(99, 102, 241, 0.3) 40%, transparent 70%);
}

.probabilities-section-v2 .header-title {
  background: linear-gradient(135deg, #fff 0%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Mystery Box Section - Pink/Purple gradient */
.mysterybox-section-v2 .section-header-fancy {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(168, 85, 247, 0.08) 100%);
  border-color: rgba(236, 72, 153, 0.3);
}

.mysterybox-section-v2 .section-header-fancy::before {
  background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.1), transparent);
}

.mysterybox-section-v2 .header-glow {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.5) 0%, rgba(168, 85, 247, 0.3) 40%, transparent 70%);
}

.mysterybox-section-v2 .header-title {
  background: linear-gradient(135deg, #fff 0%, #f472b6 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Roles Section - Yellow/Orange gradient */
.roles-section-v2 .section-header-fancy {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15) 0%, rgba(249, 115, 22, 0.08) 100%);
  border-color: rgba(251, 191, 36, 0.3);
}

.roles-section-v2 .section-header-fancy::before {
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.1), transparent);
}

.roles-section-v2 .header-glow {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.5) 0%, rgba(249, 115, 22, 0.3) 40%, transparent 70%);
}

.roles-section-v2 .header-title {
  background: linear-gradient(135deg, #fff 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Collectibles Section - Blue/Cyan gradient */
.collectibles-section-v2 .section-header-fancy {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(6, 182, 212, 0.08) 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

.collectibles-section-v2 .section-header-fancy::before {
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
}

.collectibles-section-v2 .header-glow {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.5) 0%, rgba(6, 182, 212, 0.3) 40%, transparent 70%);
}

.collectibles-section-v2 .header-title {
  background: linear-gradient(135deg, #fff 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Traps Section - Red/Orange gradient */
.traps-section-v2 .section-header-fancy {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(249, 115, 22, 0.08) 100%);
  border-color: rgba(239, 68, 68, 0.3);
}

.traps-section-v2 .section-header-fancy::before {
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
}

.traps-section-v2 .header-glow {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.5) 0%, rgba(249, 115, 22, 0.3) 40%, transparent 70%);
}

.traps-section-v2 .header-title {
  background: linear-gradient(135deg, #fff 0%, #f87171 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Missions Section - Indigo/Purple gradient */
.missions-section-v2 .section-header-fancy {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.08) 100%);
  border-color: rgba(99, 102, 241, 0.3);
}

.missions-section-v2 .section-header-fancy::before {
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
}

.missions-section-v2 .header-glow {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.5) 0%, rgba(168, 85, 247, 0.3) 40%, transparent 70%);
}

.missions-section-v2 .header-title {
  background: linear-gradient(135deg, #fff 0%, #818cf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Theme Cards Grid */
.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .theme-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Meta Card V3 - Modern Glassmorphism */
.meta-card-v3 {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.meta-card-v3:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.meta-card-v3 .card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.meta-card-v3 .card-icon-wrap {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.meta-card-v3 .card-icon-wrap.name {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.meta-card-v3 .card-icon-wrap.duration {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.meta-card-v3 .card-icon-wrap.items {
  background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.meta-card-v3 .card-icon-wrap.role {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  box-shadow: 0 4px 12px rgba(234, 179, 8, 0.3);
}

.meta-card-v3 .card-icon-wrap.color {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.meta-card-v3 .card-icon {
  font-size: 1.3rem;
}

.meta-card-v3 .card-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.meta-card-v3 .card-input-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* Input avec action (génération auto) */
.input-with-action {
  display: flex;
  gap: var(--space-2);
}

.input-with-action .meta-input-v3 {
  flex: 1;
}

.btn-generate {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.btn-generate:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Meta Input V3 */
.meta-input-v3 {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.meta-input-v3:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.meta-input-v3::placeholder {
  color: var(--text-muted);
}

.meta-input-v3.number-input {
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Input Hint */
.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding-left: var(--space-1);
}

/* Number Input Fancy */
.number-input-fancy {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.num-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  color: var(--primary-light);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.num-btn:hover {
  background: rgba(99, 102, 241, 0.3);
  transform: scale(1.05);
}

.num-btn.minus {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.num-btn.minus:hover {
  background: rgba(239, 68, 68, 0.3);
}

.num-btn.plus {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.num-btn.plus:hover {
  background: rgba(34, 197, 94, 0.3);
}

.number-input-fancy .meta-input-v3 {
  flex: 1;
  max-width: 100px;
}

/* Items Progress Mini */
.items-progress-mini {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.progress-bar-mini {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-mini .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-bar-mini .progress-fill.complete {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.progress-text.complete {
  color: #10b981;
  font-weight: 600;
}

/* Section Separator - Modern Style */
.section-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-8) 0 var(--space-6);
  padding: var(--space-4) var(--space-6);
  position: relative;
}

.section-separator::before,
.section-separator::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(251, 191, 36, 0.4) 20%,
    rgba(251, 191, 36, 0.6) 50%,
    rgba(251, 191, 36, 0.4) 80%,
    transparent
  );
  border-radius: 2px;
}

.separator-icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5));
  animation: separator-glow 2s ease-in-out infinite;
}

@keyframes separator-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.5)); }
  50% { filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.8)); }
}

.separator-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(251, 191, 36, 0.9);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

/* Role Config Section */
.role-config-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Role Preview Card - Dynamic Color Banner */
.role-preview-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  /* Background dynamique basé sur borderColor (défini par rolePreviewStyle) */
  background: transparent;
  border: 2px solid;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Fond dégradé basé sur la couleur du rôle */
.role-preview-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    currentColor 0%,
    transparent 100%
  );
  opacity: 0.1;
  z-index: 0;
  transition: opacity 0.3s ease;
}

.role-preview-card:hover::after {
  opacity: 0.15;
}

.role-preview-card:hover {
  box-shadow: 0 0 25px currentColor;
  filter: brightness(1.05);
}

.role-preview-card .role-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 10px currentColor);
  position: relative;
  z-index: 1;
}

.role-preview-card .role-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.role-preview-card .role-name {
  font-size: 1.1rem;
  font-weight: 700;
  /* Hérite la couleur du parent (rolePreviewStyle) */
  color: inherit;
  text-shadow: 0 0 20px currentColor;
}

.role-preview-card .role-hint {
  font-size: 0.8rem;
  /* Couleur héritée avec opacité réduite */
  color: inherit;
  opacity: 0.75;
  font-weight: 500;
}

/* Role Config Grid */
.role-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Color Input Fancy - Modern Design */
.color-input-fancy {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.color-picker {
  width: 48px;
  height: 48px;
  padding: 4px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.color-picker:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.color-picker::-moz-color-swatch {
  border: none;
  border-radius: var(--radius-md);
}

/* Color Picker Trigger Button - replaces native input */
.color-picker-trigger {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 0 0 2px rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.color-picker-trigger::before {
  content: '🎨';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.color-picker-trigger:hover {
  transform: scale(1.08);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.4),
    inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.color-picker-trigger:hover::before {
  opacity: 1;
}

.color-picker-trigger:active {
  transform: scale(0.95);
}

.color-input-fancy .color-text {
  flex: 1;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.color-preview {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.color-preview:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════
   TRAPS SECTION V2 - Modern Card-Based Design
   ═══════════════════════════════════════════════════════════════════════ */

.traps-section-v2 {
  background: transparent;
  padding: 0;
}

/* Header avec glow warning */
.traps-section-v2 .section-header-fancy {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.traps-section-v2 .header-glow.warning {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.4) 0%, transparent 70%);
}

/* Bouton ajouter fancy */
.btn-add-fancy {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  margin-left: auto;
}

.btn-add-fancy:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-add-fancy .btn-icon {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Stats par type de piège */
.trap-type-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.trap-stat-chip-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  transition: all 0.3s ease;
}

.trap-stat-chip-v2.active {
  background: linear-gradient(135deg, rgba(var(--chip-color-rgb, 99, 102, 241), 0.2), rgba(var(--chip-color-rgb, 99, 102, 241), 0.1));
  border-color: var(--chip-color, var(--primary));
  box-shadow: 0 0 15px rgba(var(--chip-color-rgb, 99, 102, 241), 0.2);
}

.chip-emoji {
  font-size: 1.1rem;
}

.chip-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trap-stat-chip-v2.active .chip-label {
  color: var(--text);
}

.chip-count {
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chip-count.has-count {
  background: var(--chip-color, var(--primary));
  color: white;
}

/* Grille de pièges V2 */
.traps-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Card piège V2 */
.trap-card-v2 {
  position: relative;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s ease;
}

.trap-card-v2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--trap-color, var(--primary));
}

.trap-card-v2:hover {
  border-color: var(--trap-color, var(--primary));
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.trap-card-v2.inactive {
  opacity: 0.6;
  filter: grayscale(0.3);
}

.trap-card-v2.inactive::before {
  background: var(--text-muted);
}

/* Visual du piège */
.trap-visual {
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(var(--trap-color-rgb, 99, 102, 241), 0.1) 0%, transparent 100%);
}

.trap-image {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.trap-icon-placeholder {
  font-size: 3rem;
  opacity: 0.8;
}

.trap-status {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.9rem;
}

.trap-status.active {
  background: rgba(16, 185, 129, 0.2);
}

.trap-status.inactive {
  background: rgba(239, 68, 68, 0.2);
}

.trap-type-badge {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--trap-color, var(--primary));
  border-radius: var(--radius-md);
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Contenu du piège */
.trap-content {
  padding: var(--space-4);
}

.trap-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.trap-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.trap-type-label {
  font-size: 0.8rem;
  font-weight: 600;
}

.trap-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trap-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Actions du piège */
.trap-actions {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.2);
}

.btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  min-height: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.btn-action.edit:hover {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.btn-action.delete:hover {
  border-color: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Bouton Toggle Actif/Pause pour pièges - Style moderne */
.btn-action.toggle {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-action.toggle.active {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.3));
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow:
    0 0 15px rgba(34, 197, 94, 0.2),
    inset 0 0 20px rgba(34, 197, 94, 0.1);
}

.btn-action.toggle.active:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(16, 185, 129, 0.4));
  border-color: rgba(34, 197, 94, 0.7);
  box-shadow:
    0 0 20px rgba(34, 197, 94, 0.4),
    inset 0 0 25px rgba(34, 197, 94, 0.15);
  transform: scale(1.08);
}

.btn-action.toggle.paused {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.25));
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow:
    0 0 12px rgba(251, 191, 36, 0.15),
    inset 0 0 15px rgba(251, 191, 36, 0.08);
}

.btn-action.toggle.paused:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.35));
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow:
    0 0 18px rgba(251, 191, 36, 0.3),
    inset 0 0 20px rgba(251, 191, 36, 0.12);
  transform: scale(1.08);
}

/* Animation pulse subtile pour l'état actif */
.btn-action.toggle.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(34, 197, 94, 0.3) 0%, transparent 70%);
  opacity: 0;
  animation: toggle-pulse 2s ease-in-out infinite;
}

@keyframes toggle-pulse {
  0%, 100% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Empty State V2 */
.empty-state-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-10);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-2xl);
}

.empty-visual {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: var(--space-6);
}

.empty-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  z-index: 1;
}

.empty-rings {
  position: absolute;
  inset: 0;
}

.empty-rings .ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: expand-ring 3s ease-out infinite;
}

.empty-rings .ring:nth-child(1) { animation-delay: 0s; }
.empty-rings .ring:nth-child(2) { animation-delay: 1s; }
.empty-rings .ring:nth-child(3) { animation-delay: 2s; }

.empty-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 var(--space-2) 0;
  color: var(--text);
}

.empty-desc {
  color: var(--text-muted);
  margin: 0 0 var(--space-6) 0;
  font-size: 0.95rem;
}

.btn-hero-gradient {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-8);
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  background-size: 200% 200%;
  animation: gradient-shift 3s ease infinite;
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-hero-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ═══════════════════════════════════════════════════════════════════════
   COLLECTIBLES SECTION V2 - Modern Card-Based Design
   ═══════════════════════════════════════════════════════════════════════ */

.collectibles-section-v2 {
  padding: var(--space-2);
}

/* Rarity Stats V2 - Clickable Filter Chips */
.rarity-stats-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.rarity-chip-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
  opacity: 0.7;
}

.rarity-chip-v2:hover {
  opacity: 1;
  border-color: var(--rarity-color);
  transform: translateY(-2px);
}

.rarity-chip-v2.has-items {
  opacity: 1;
}

.chip-emoji {
  font-size: 1rem;
}

.chip-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.chip-count {
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chip-count.has-count {
  background: var(--rarity-color);
  color: white;
}

/* Checkmark pour filtre actif */
.chip-check {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--rarity-color);
  margin-left: 2px;
  animation: checkPop 0.2s ease;
}

@keyframes checkPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Chip sans items - style desactive */
.rarity-chip-v2.no-items {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.rarity-chip-v2.no-items:hover {
  transform: none;
  border-color: var(--glass-border);
}

/* Amelioration de l'etat actif */
.rarity-chip-v2.active {
  opacity: 1;
  background: linear-gradient(135deg, color-mix(in srgb, var(--rarity-color) 20%, transparent), color-mix(in srgb, var(--rarity-color) 8%, transparent));
  border-color: var(--rarity-color);
  box-shadow:
    0 4px 15px color-mix(in srgb, var(--rarity-color) 25%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.rarity-chip-v2.active .chip-label {
  color: var(--rarity-color);
  font-weight: 600;
}

/* Collectibles Toolbar V2 */
.collectibles-toolbar-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.search-wrapper-v2 {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.25s ease;
}

.search-wrapper-v2:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
  font-size: 1rem;
  opacity: 0.6;
}

.search-input-v2 {
  flex: 1;
  padding: var(--space-3) 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-input-v2:focus {
  outline: none;
}

.search-input-v2::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-clear-btn:hover {
  background: var(--danger);
  color: white;
}

.sort-buttons {
  display: flex;
  gap: var(--space-2);
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sort-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.sort-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.sort-dir {
  font-size: 0.8rem;
  font-weight: 600;
}

/* Filter Indicator */
.filter-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.filter-count {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--primary);
}

.filter-clear-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  color: var(--primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-clear-btn:hover {
  background: var(--primary);
  color: white;
}

/* Collectibles Grid V2 */
.collectibles-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Collectible Card V2 */
.collectible-card-v2 {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.collectible-card-v2:hover {
  transform: translateY(-4px);
  border-color: var(--rarity-color);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 0 20px color-mix(in srgb, var(--rarity-color) 20%, transparent);
}

.collectible-card-v2.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

/* Drag Handle */
.drag-handle {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.collectible-card-v2:hover .drag-handle {
  opacity: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Collectible Image V2 */
.collectible-image-v2 {
  position: relative;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rarity-color) 15%, transparent) 0%, color-mix(in srgb, var(--rarity-color) 5%, transparent) 100%);
  overflow: hidden;
}

.collectible-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.collectible-card-v2:hover .collectible-img {
  transform: scale(1.05);
}

.collectible-placeholder-v2 {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.5;
}

.rarity-badge-v2 {
  position: absolute;
  bottom: var(--space-2);
  right: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Collectible Info V2 */
.collectible-info-v2 {
  padding: var(--space-4);
  flex: 1;
}

.collectible-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 var(--space-1) 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.collectible-id-v2 {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Collectible Actions V2 */
.collectible-actions-v2 {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-4);
}

.collectible-actions-v2 .btn-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.collectible-actions-v2 .btn-action:hover {
  transform: translateY(-1px);
}

.collectible-actions-v2 .btn-action.edit:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.collectible-actions-v2 .btn-action.delete:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

/* Outline Fancy Button */
.btn-outline-fancy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-fancy:hover {
  background: var(--primary);
  color: white;
}

@media (max-width: 640px) {
  .collectibles-toolbar-v2 {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrapper-v2 {
    min-width: 100%;
  }

  .sort-buttons {
    justify-content: flex-end;
  }

  .collectibles-grid-v2 {
    grid-template-columns: 1fr;
  }

  .rarity-stats-v2 {
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MISSIONS SECTION V2 - Modern Card-Based Design
   ═══════════════════════════════════════════════════════════════════════ */

.missions-section-v2 {
  padding: var(--space-2);
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: var(--space-2);
}

.btn-add-fancy.keyword {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-add-fancy.keyword:hover {
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* Mission Glow */
.header-glow.mission {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Type Stats Chips */
.mission-type-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.type-chip-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.25s ease;
}

.type-chip-v2:hover {
  border-color: var(--type-color, var(--primary));
  transform: translateY(-2px);
}

.type-chip-v2.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--type-color, var(--primary)) 15%, transparent), color-mix(in srgb, var(--type-color, var(--primary)) 5%, transparent));
  border-color: var(--type-color, var(--primary));
  box-shadow: 0 4px 15px color-mix(in srgb, var(--type-color, var(--primary)) 25%, transparent);
}

/* Missions Content */
.missions-content-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Mission Category */
.mission-category-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.category-header-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.category-icon-wrap {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-size: 1.2rem;
}

.category-icon-wrap.quiz {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.category-icon-wrap.keyword {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.category-count {
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Missions Grid */
.missions-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-4);
}

/* Mission Card V2 */
.mission-card-v2 {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mission-card-v2:hover {
  transform: translateY(-4px);
  border-color: var(--mission-color);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 0 20px color-mix(in srgb, var(--mission-color) 15%, transparent);
}

/* Card Header V2 */
.card-header-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(180deg, color-mix(in srgb, var(--mission-color) 10%, transparent) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.type-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.type-badge.quiz {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: white;
}

.type-badge.keyword {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.difficulty-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
}

/* Card Body V2 */
.card-body-v2 {
  padding: var(--space-4);
  flex: 1;
}

.mission-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
}

.mission-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-3) 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mission-stats {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.mission-stats .stat-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mission-stats .stat-icon {
  font-size: 0.9rem;
}

.mission-stats .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.mission-stats .stat-label {
  color: var(--text-muted);
}

/* Keywords Preview V2 */
.keywords-preview-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.keyword-chip {
  padding: 4px 10px;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
}

.keyword-more {
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Card Footer V2 */
.card-footer-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border);
}

.reward-display-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.reward-display-v2 .reward-icon {
  font-size: 1rem;
}

.reward-display-v2 .reward-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.card-actions {
  display: flex;
  gap: var(--space-2);
}

.card-actions .btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.card-actions .btn-action:hover {
  transform: translateY(-1px);
}

.card-actions .btn-action.edit:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.card-actions .btn-action.delete:hover {
  background: var(--danger-light);
  border-color: var(--danger);
}

/* Empty State Compact */
.empty-state-v2.compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-6);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  text-align: center;
}

.empty-icon-mini {
  font-size: 2rem;
  margin-bottom: var(--space-3);
  opacity: 0.6;
}

.empty-state-v2.compact p {
  color: var(--text-muted);
  margin: 0 0 var(--space-4) 0;
}

/* Empty Actions */
.empty-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 768px) {
  .missions-grid-v2 {
    grid-template-columns: 1fr;
  }

  .header-actions {
    flex-wrap: wrap;
    width: 100%;
    margin-top: var(--space-3);
  }

  .header-actions .btn-add-fancy {
    flex: 1;
    min-width: 120px;
  }

  .mission-type-stats {
    justify-content: center;
  }

  .empty-actions {
    flex-direction: column;
    width: 100%;
  }

  .empty-actions button {
    width: 100%;
  }
}

/* ============================================
   PROBABILITIES SECTION V2
   Design moderne avec tabs et sliders visuels
   ============================================ */

.probabilities-section-v2 {
  /* Inherits from .builder-section */
}

/* Header Glow - Config variant */
.header-glow.config {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4), transparent 70%);
}

/* Navigation Tabs */
.prob-tabs-v2 {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.prob-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: fit-content;
  justify-content: center;
}

.prob-tab:hover {
  background: rgba(255, 255, 255, 0.05);
}

.prob-tab.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.tab-icon {
  font-size: 1.25rem;
}

.tab-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.prob-tab.active .tab-label {
  color: var(--text-primary);
}

.tab-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.tab-status.valid {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

/* Content Area */
.prob-content-v2 {
  animation: fadeIn 0.3s ease;
}

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

/* Section Card */
.prob-section-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
}

.prob-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.prob-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.title-icon {
  font-size: 1.25rem;
}

/* Total Indicator */
.total-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.total-indicator.valid {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

.total-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ef4444;
}

.total-indicator.valid .total-value {
  color: #10b981;
}

.total-message {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Probability Bar V2 */
.probability-bar-v2 {
  display: flex;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.prob-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.prob-segment::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent 50%);
}

.prob-segment:hover {
  filter: brightness(1.1);
  transform: scaleY(1.05);
}

.segment-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* Sliders Grid */
.prob-sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.prob-slider-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.prob-slider-card:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: color-mix(in srgb, var(--prob-color) 50%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--prob-color) 20%, transparent);
}

.slider-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.slider-emoji {
  font-size: 1.5rem;
}

.slider-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.slider-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--prob-color);
}

.slider-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slider-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slider-btn:hover {
  background: color-mix(in srgb, var(--prob-color) 30%, transparent);
  border-color: var(--prob-color);
  color: var(--prob-color);
}

.slider-btn.minus:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
  color: #ef4444;
}

.slider-btn.plus:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: #10b981;
  color: #10b981;
}

/* Range Slider */
.prob-range {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  outline: none;
}

.prob-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--prob-color);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.prob-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.prob-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--prob-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.slider-track-preview {
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  margin-top: 0.75rem;
  position: relative;
  overflow: hidden;
}

.slider-track-preview::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--fill-width);
  background: linear-gradient(90deg, var(--prob-color), color-mix(in srgb, var(--prob-color) 70%, white));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Rarity Cards Grid */
.rarity-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.rarity-config-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 1.25rem;
  border: 2px solid color-mix(in srgb, var(--rarity-color) 30%, transparent);
  text-align: center;
  transition: all 0.3s ease;
}

.rarity-config-card:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--rarity-color);
  box-shadow: 0 0 25px color-mix(in srgb, var(--rarity-color) 30%, transparent);
  transform: translateY(-2px);
}

.rarity-config-card.superbonus {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), color-mix(in srgb, var(--rarity-color) 5%, transparent));
}

.rarity-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.rarity-emoji {
  font-size: 2rem;
}

.rarity-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rarity-color);
}

.rarity-value-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.1rem;
  margin-bottom: 0.75rem;
}

.value-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.value-percent {
  font-size: 1rem;
  color: var(--text-muted);
}

.rarity-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rarity-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rarity-btn:hover {
  background: color-mix(in srgb, var(--rarity-color) 30%, transparent);
  border-color: var(--rarity-color);
  color: var(--rarity-color);
}

.rarity-input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.rarity-input:focus {
  outline: none;
  border-color: var(--rarity-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rarity-color) 20%, transparent);
}

/* Mystery Box Config V2 */
.mysterybox-config-v2 {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

.mysterybox-preview-card {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(249, 115, 22, 0.1));
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.preview-icon {
  font-size: 1.5rem;
}

.preview-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.preview-image-wrap {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.preview-image:hover {
  transform: scale(1.05);
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.placeholder-icon {
  font-size: 3rem;
  opacity: 0.5;
}

.placeholder-text {
  font-size: 0.85rem;
}

.preview-emojis {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.celebration-emoji {
  font-size: 1.5rem;
  animation: celebrateBounce 1s ease-in-out infinite;
}

@keyframes celebrateBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Config Cards */
.mysterybox-config-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.config-card-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 1.25rem;
}

.config-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.config-icon {
  font-size: 1.25rem;
}

.config-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.config-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-with-upload {
  display: flex;
  gap: 0.5rem;
}

.config-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.config-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.config-input::placeholder {
  color: var(--text-muted);
}

.btn-upload-v2 {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-upload-v2:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-upload-v2:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.upload-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.image-actions-v2 {
  display: flex;
  gap: 0.5rem;
}

.btn-action-small {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-small:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #6366f1;
}

.btn-action-small.remove:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ef4444;
}

.image-error-v2 {
  padding: 0.5rem 0.75rem;
  background: rgba(239, 68, 68, 0.15);
  border-radius: 8px;
  color: #ef4444;
  font-size: 0.85rem;
}

.config-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.emoji-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.emoji-chip {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.emoji-chip:hover {
  transform: scale(1.15);
  background: rgba(251, 191, 36, 0.25);
}

.emoji-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Responsive */
@media (max-width: 1024px) {
  .mysterybox-config-v2 {
    grid-template-columns: 1fr;
  }

  .mysterybox-preview-card {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .prob-tabs-v2 {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .prob-tabs-v2::-webkit-scrollbar {
    display: none;
  }

  .prob-tab {
    flex: 0 0 auto;
    padding: 0.6rem 1rem;
  }

  .tab-label {
    display: none;
  }

  .rarity-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .prob-sliders-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   MESSAGES SECTION V2
   Design moderne avec catégories et preview
   ============================================ */

.messages-section-v2 {
  /* Inherits from .builder-section */
}

/* Header Glow - Messages variant */
.header-glow.messages {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4), transparent 70%);
}

/* Category Chips */
.message-categories-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.category-chip-v2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-chip-v2:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: color-mix(in srgb, var(--cat-color) 50%, transparent);
}

.category-chip-v2.active {
  background: color-mix(in srgb, var(--cat-color) 20%, transparent);
  border-color: var(--cat-color);
  box-shadow: 0 4px 15px color-mix(in srgb, var(--cat-color) 30%, transparent);
}

.category-chip-v2 .chip-icon {
  font-size: 1.1rem;
}

.category-chip-v2 .chip-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.category-chip-v2.active .chip-label {
  color: var(--cat-color);
}

.chip-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
}

.chip-badge.filled {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

/* Messages Content */
.messages-content-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.messages-content-v2 .category-header-v2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.messages-content-v2 .category-icon-wrap {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--category-color) 20%, transparent);
  border: 2px solid var(--category-color);
  border-radius: 14px;
}

.messages-content-v2 .category-icon {
  font-size: 1.5rem;
}

.category-info {
  flex: 1;
}

.messages-content-v2 .category-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--category-color);
  margin: 0 0 0.25rem 0;
}

.category-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Fields Grid */
.message-fields-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-field-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  padding: 1rem;
  border: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.message-field-card:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: color-mix(in srgb, var(--category-color) 40%, transparent);
}

.field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-filled-badge {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

.field-input-wrap {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.message-input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.message-input:focus {
  outline: none;
  border-color: var(--category-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color) 20%, transparent);
}

.message-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.btn-clear-field {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-field:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

/* Field Preview/Default */
.field-preview,
.field-default {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.field-preview {
  background: color-mix(in srgb, var(--category-color) 10%, transparent);
  border: 1px dashed color-mix(in srgb, var(--category-color) 30%, transparent);
}

.field-default {
  background: rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--glass-border);
}

.preview-label,
.default-label {
  color: var(--text-muted);
  font-weight: 500;
}

.preview-text {
  color: var(--category-color);
  font-weight: 500;
}

.default-text {
  color: var(--text-muted);
  font-style: italic;
}

/* Quick Stats */
.messages-stats-v2 {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
}

.stat-mini-card {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  position: relative;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.stat-mini-card:hover {
  opacity: 1;
  transform: scale(1.1);
}

.stat-mini-card.complete {
  opacity: 1;
  background: color-mix(in srgb, var(--stat-color) 20%, transparent);
  box-shadow: 0 4px 15px color-mix(in srgb, var(--stat-color) 30%, transparent);
}

.stat-mini-card .stat-icon {
  font-size: 1.25rem;
  z-index: 1;
}

.stat-progress-ring {
  position: absolute;
  inset: 0;
  padding: 3px;
}

.stat-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 3;
}

.ring-fill {
  fill: none;
  stroke: var(--stat-color);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.5s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .message-categories-v2 {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  .message-categories-v2::-webkit-scrollbar {
    display: none;
  }

  .category-chip-v2 {
    flex: 0 0 auto;
  }

  .category-chip-v2 .chip-label {
    display: none;
  }

  .messages-stats-v2 {
    flex-wrap: wrap;
  }

  .stat-mini-card {
    width: 44px;
    height: 44px;
  }
}

/* ============================================
   TEMPLATES SECTION V2
   Design moderne avec accordion et preview
   ============================================ */

.templates-section-v2 {
  /* Inherits from .builder-section */
}

/* Header Glow - Templates variant */
.header-glow.templates {
  background: radial-gradient(circle, rgba(249, 115, 22, 0.4), transparent 70%);
}

/* Info Banner */
.templates-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 14px;
  margin-bottom: 1.5rem;
}

.templates-info-banner .info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.templates-info-banner .info-content {
  flex: 1;
}

.templates-info-banner .info-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.templates-info-banner .info-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Templates Tabs */
.templates-tabs-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.template-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: color-mix(in srgb, var(--tab-color) 50%, transparent);
}

.template-tab.active {
  background: color-mix(in srgb, var(--tab-color) 20%, transparent);
  border-color: var(--tab-color);
  box-shadow: 0 4px 15px color-mix(in srgb, var(--tab-color) 30%, transparent);
}

.template-tab .tab-icon {
  font-size: 1.1rem;
}

.template-tab .tab-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.template-tab.active .tab-label {
  color: var(--tab-color);
}

.tab-count {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
}

.tab-count.complete {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

/* Templates Content */
.templates-content-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
  margin-bottom: 1.5rem;
}

.category-intro {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.intro-icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--category-color) 20%, transparent);
  border: 2px solid var(--category-color);
  border-radius: 14px;
}

.intro-icon {
  font-size: 1.5rem;
}

.intro-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--category-color);
  margin: 0 0 0.25rem 0;
}

.intro-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Templates List */
.templates-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-card-v2 {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all 0.3s ease;
}

.template-card-v2:hover {
  border-color: color-mix(in srgb, var(--category-color) 40%, transparent);
}

.template-card-v2.expanded {
  border-color: var(--category-color);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--category-color) 20%, transparent);
}

.template-card-v2.filled {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), color-mix(in srgb, var(--category-color) 5%, transparent));
}

/* Card Header */
.template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.template-card-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.template-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.template-icon {
  font-size: 1.1rem;
}

.template-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.template-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
}

.status-badge.filled {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.expand-icon {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

/* Card Body */
.template-card-body {
  padding: 0 1rem 1rem 1rem;
  border-top: 1px solid var(--glass-border);
  animation: slideDown 0.3s ease;
}

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

.template-input-wrap {
  margin-top: 1rem;
  position: relative;
}

.input-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.template-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: all 0.2s ease;
}

.template-textarea:focus {
  outline: none;
  border-color: var(--category-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color) 20%, transparent);
}

.template-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.btn-reset-template {
  position: absolute;
  top: 1.5rem;
  right: 0.5rem;
  padding: 0.3rem 0.6rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-reset-template:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

/* Variables */
.template-variables-v2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.variables-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.variables-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.variable-chip {
  padding: 0.25rem 0.5rem;
  background: color-mix(in srgb, var(--category-color) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--category-color) 30%, transparent);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--category-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.variable-chip:hover {
  background: color-mix(in srgb, var(--category-color) 25%, transparent);
  border-color: var(--category-color);
  transform: scale(1.05);
}

/* Preview */
.template-preview-v2 {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 1px dashed var(--glass-border);
}

.template-preview-v2 .preview-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.preview-message {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Quick Preview (Collapsed) */
.template-quick-preview {
  padding: 0 1rem 0.875rem 1rem;
}

.quick-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Progress Summary */
.templates-progress-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 1.25rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.progress-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.progress-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.progress-bar-v2 {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill-v2 {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.progress-fill-v2.complete {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.progress-categories {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.category-progress-mini {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mini-icon {
  font-size: 1rem;
}

.mini-bar {
  width: 40px;
  height: 4px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  background: var(--cat-color);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .templates-tabs-v2 {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  .templates-tabs-v2::-webkit-scrollbar {
    display: none;
  }

  .template-tab {
    flex: 0 0 auto;
  }

  .template-tab .tab-label {
    display: none;
  }

  .template-card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .template-status {
    width: 100%;
    justify-content: flex-end;
  }

  .progress-categories {
    justify-content: flex-start;
  }
}

/* ============================================
   TEMPLATES SECTION V2 - Extended Fields
   Champs additionnels pour les templates
   ============================================ */

/* Input text standard pour templates */
.template-input {
  width: 100%;
  padding: 0.65rem 0.875rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.template-input:focus {
  outline: none;
  border-color: var(--category-color, #6366f1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color, #6366f1) 20%, transparent);
}

.template-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

/* Ligne à 2 colonnes */
.template-row-2cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .template-row-2cols {
    grid-template-columns: 1fr;
  }
}

/* Color input wrapper */
.color-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.template-color-input {
  width: 42px;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  flex-shrink: 0;
}

.template-color-input::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.template-color-input::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}

.template-input.color-text {
  flex: 1;
  font-family: monospace;
  text-transform: uppercase;
}

/* Color Preview Button (ouvre ColorPickerModal) */
.color-preview-btn {
  width: 42px;
  height: 42px;
  border: 2px solid var(--glass-border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-preview-btn:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-preview-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Image Input Wrapper (URL + upload button) */
.image-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.template-input.with-upload {
  flex: 1;
}

.upload-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.3));
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.upload-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.5));
  border-color: rgba(99, 102, 241, 0.6);
  transform: scale(1.05);
}

.upload-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Image Preview Mini */
.image-preview-mini {
  margin-top: 0.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

.image-preview-mini img {
  display: block;
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
}

.image-preview-mini.thumbnail img {
  max-height: 64px;
}

/* Template actions (bouton reset) */
.template-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--glass-border);
}

.template-actions .btn-reset-template {
  position: static;
}

/* Réduction des marges entre les champs */
.template-card-body .template-input-wrap:first-child {
  margin-top: 0;
}

.template-card-body .template-input-wrap + .template-input-wrap {
  margin-top: 0.75rem;
}

/* ============================================
   ROLES SECTION V2
   Rôles de Progression - Design glassmorphism
   ============================================ */

.roles-section-v2 {
  /* Inherits from .builder-section */
}

/* Header Glow - Roles variant */
.header-glow.roles {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.4), transparent 70%);
}

/* Info Banner */
.roles-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  margin-bottom: 1.5rem;
}

.roles-info-banner .info-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.roles-info-banner .info-content {
  flex: 1;
}

.roles-info-banner .info-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Timeline V2 */
.roles-timeline-v2 {
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-bottom: 1.5rem;
}

.timeline-track {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin: 1rem 0;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.5));
  border-radius: 4px;
}

.timeline-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.timeline-marker .marker-dot {
  width: 16px;
  height: 16px;
  background: var(--marker-color, #fbbf24);
  border: 3px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  display: block;
  box-shadow: 0 2px 8px var(--marker-color, rgba(251, 191, 36, 0.5));
  transition: all 0.3s ease;
}

.timeline-marker:hover .marker-dot {
  transform: scale(1.3);
  box-shadow: 0 4px 15px var(--marker-color, rgba(251, 191, 36, 0.7));
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ============================================
   MYSTERY BOX SECTION V2
   Configuration Mystery Box - Design moderne
   ============================================ */

.mysterybox-section-v2 {
  /* Inherits from .builder-section */
}

/* Header Glow - Mystery Box variant */
.header-glow.mysterybox {
  background: radial-gradient(circle, rgba(251, 191, 36, 0.4), transparent 70%);
}

/* Mystery Box Preview V2 */
.mysterybox-preview-v2 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(249, 115, 22, 0.1));
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.mysterybox-preview-v2 .preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.mysterybox-preview-v2 .preview-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #fbbf24;
  padding: 0.35rem 0.75rem;
  background: rgba(251, 191, 36, 0.2);
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mysterybox-preview-v2 .preview-emojis {
  display: flex;
  gap: 0.35rem;
}

.mysterybox-preview-v2 .celebration-emoji {
  font-size: 1.25rem;
  animation: celebrateBounce 1s ease-in-out infinite;
}

.mysterybox-preview-v2 .preview-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
}

.mysterybox-preview-v2 .preview-image-container {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(251, 191, 36, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mysterybox-preview-v2 .preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.mysterybox-preview-v2 .preview-image:hover {
  transform: scale(1.05);
}

.mysterybox-preview-v2 .preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.mysterybox-preview-v2 .placeholder-emoji {
  font-size: 3rem;
  opacity: 0.5;
}

.mysterybox-preview-v2 .placeholder-text {
  font-size: 0.75rem;
}

/* Embed Preview */
.mysterybox-preview-v2 .preview-embed {
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  border-left: 4px solid #fbbf24;
  border-radius: 8px;
}

.mysterybox-preview-v2 .embed-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.mysterybox-preview-v2 .embed-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.mysterybox-preview-v2 .embed-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Winner Message Preview */
.mysterybox-preview-v2 .winner-message-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.mysterybox-preview-v2 .message-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.5rem;
}

.mysterybox-preview-v2 .message-content {
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* Mystery Box Config Grid */
.mysterybox-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.mysterybox-config-grid .config-card-v2.full-width {
  grid-column: 1 / -1;
}

/* Config Card V2 (extends existing) */
.mysterybox-section-v2 .config-card-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 1.25rem;
  transition: all 0.3s ease;
}

.mysterybox-section-v2 .config-card-v2:hover {
  border-color: rgba(251, 191, 36, 0.3);
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.1);
}

.mysterybox-section-v2 .config-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mysterybox-section-v2 .config-icon {
  font-size: 1.25rem;
}

.mysterybox-section-v2 .config-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Config Textarea */
.config-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.config-textarea:focus {
  outline: none;
  border-color: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.config-textarea::placeholder {
  color: var(--text-muted);
}

/* Variable Hint */
.variable-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.variable-hint .hint-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.variable-hint .variable-tag {
  padding: 0.25rem 0.5rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  color: #6366f1;
  font-size: 0.75rem;
  font-family: monospace;
  cursor: pointer;
  transition: all 0.2s ease;
}

.variable-hint .variable-tag:hover {
  background: rgba(99, 102, 241, 0.3);
  transform: scale(1.05);
}

/* GIF Preview */
.gif-preview {
  margin-top: 0.75rem;
}

.gif-preview .gif-thumbnail {
  max-width: 100%;
  max-height: 150px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

/* Toggle Wrap */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 26px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Responsive Mystery Box */
@media (max-width: 768px) {
  .mysterybox-preview-v2 .preview-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .mysterybox-preview-v2 .preview-image-container {
    margin: 0 auto;
  }

  .mysterybox-config-grid {
    grid-template-columns: 1fr;
  }

  .mysterybox-config-grid .config-card-v2.full-width {
    grid-column: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGES SECTION V4 - Grid-based design with expandable Discord preview
   ═══════════════════════════════════════════════════════════════════════ */

.messages-section-v4 {
  /* Inherits from .builder-section */
}

/* Header Glow - Messages variant */
.messages-section-v4 .header-glow.messages {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4), transparent 70%);
}

/* Messages Grid */
.messages-grid-v4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* Message Card V4 */
.message-card-v4 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all 0.3s ease;
}

.message-card-v4:hover {
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.1);
}

.message-card-v4.expanded {
  border-color: var(--primary);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.2);
}

.message-card-v4.filled {
  background: linear-gradient(135deg, var(--glass-bg), rgba(99, 102, 241, 0.05));
}

/* Card Header */
.message-card-v4 .message-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.message-card-v4 .message-card-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.message-card-v4 .header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-card-v4 .field-icon {
  font-size: 1.1rem;
}

.message-card-v4 .field-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.message-card-v4 .header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-card-v4 .filled-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-radius: 50%;
  font-size: 0.7rem;
}

.message-card-v4 .expand-icon {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.message-card-v4 .expand-icon.rotated {
  transform: rotate(180deg);
}

/* Card Content */
.message-card-v4 .message-card-content {
  padding: 0 1rem 1rem 1rem;
}

/* Input Wrapper */
.message-card-v4 .input-wrapper {
  position: relative;
}

.message-card-v4 .message-input-v4 {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 50px;
  transition: all 0.2s ease;
}

.message-card-v4 .message-input-v4:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.message-card-v4 .message-input-v4::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.message-card-v4 .btn-clear {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.message-card-v4 .btn-clear:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

/* Variables Row */
.message-card-v4 .variables-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.message-card-v4 .variables-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.message-card-v4 .variable-btn {
  padding: 0.25rem 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.message-card-v4 .variable-btn:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  transform: scale(1.05);
}

/* Quick Preview */
.message-card-v4 .quick-preview {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px dashed var(--glass-border);
}

.message-card-v4 .preview-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}

.message-card-v4 .preview-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Discord Preview Section */
.message-card-v4 .discord-preview-section {
  padding: 1rem;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.15);
  animation: slideDown 0.3s ease;
}

.message-card-v4 .preview-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.message-card-v4 .preview-divider::before,
.message-card-v4 .preview-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

.message-card-v4 .preview-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Slide Down Animation */
.slide-down-enter-active,
.slide-down-leave-active {
  transition: all 0.3s ease;
  overflow: hidden;
}

.slide-down-enter-from,
.slide-down-leave-to {
  opacity: 0;
  max-height: 0;
  transform: translateY(-10px);
}

.slide-down-enter-to,
.slide-down-leave-from {
  opacity: 1;
  max-height: 500px;
  transform: translateY(0);
}

/* Stats Footer */
.messages-stats-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.messages-stats-footer .stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.messages-stats-footer .stat-icon {
  font-size: 1.1rem;
}

.messages-stats-footer .stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.messages-stats-footer .stat-value.complete {
  color: #10b981;
}

.messages-stats-footer .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Messages */
@media (max-width: 768px) {
  .messages-grid-v4 {
    grid-template-columns: 1fr;
  }

  .messages-stats-footer {
    flex-direction: column;
    gap: 0.75rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   THEME ID VALIDATION STYLES
   Real-time feedback for theme ID uniqueness
   ═══════════════════════════════════════════════════════════════════════ */

/* Validation status display */
.id-validation-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease-out;
}

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

.id-validation-status .validation-icon {
  font-size: 1rem;
}

/* Checking state */
.id-validation-status.checking {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.1);
  color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb, 99, 102, 241), 0.3);
}

.id-validation-status.checking .validation-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Available state (green) */
.id-validation-status.available {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Owner state (blue/info) */
.id-validation-status.owner {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Fork required state (warning/orange) */
.id-validation-status.fork {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Conflict state (red/error) - ID already used by another of user's themes */
.id-validation-status.conflict {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 600;
}

/* Input border colors based on validation */
.meta-input-v3.id-available {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.meta-input-v3.id-owner {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.meta-input-v3.id-fork {
  border-color: #d97706 !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2);
}

.meta-input-v3.id-checking {
  border-color: var(--primary) !important;
}

.meta-input-v3.id-conflict {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

/* ═══════════════════════════════════════════════════════════════
   ID CHANGE WARNING - Avertissement modification ID
   ═══════════════════════════════════════════════════════════════ */
.id-change-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.06) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #d97706;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
  animation: warningPulse 3s ease-in-out infinite;
}

.id-change-warning .warning-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.id-change-warning .warning-text {
  line-height: 1.4;
  font-weight: 500;
}

@keyframes warningPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.35);
  }
  50% {
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.5);
  }
}

/* ═══════════════════════════════════════════════════════════════
   FORK ID LOCKED - ID verrouillé pour les thèmes forkés
   ═══════════════════════════════════════════════════════════════ */
.meta-input-v3.id-locked {
  background: rgba(100, 116, 139, 0.15) !important;
  border-color: rgba(100, 116, 139, 0.4) !important;
  color: #94a3b8;
  cursor: not-allowed;
}

.meta-input-v3.id-locked::placeholder {
  color: #64748b;
}

.fork-lock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 8px;
  font-size: 1rem;
  color: #94a3b8;
}

.id-fork-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0.06) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px;
  font-size: 0.82rem;
  color: #818cf8;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.id-fork-notice .notice-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.id-fork-notice .notice-text {
  line-height: 1.4;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   THEME ID DISPLAY - Affichage ID dans Library cards
   ═══════════════════════════════════════════════════════════════ */
.theme-id-display {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: 'Monaco', 'Consolas', monospace;
  color: #6366f1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1: PROFILE FRAMES SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.profile-frames-section .profile-frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.profile-frames-section .frame-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-fast);
  position: relative;
}

.profile-frames-section .frame-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.profile-frames-section .frame-preview {
  width: 100%;
  height: 120px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-frames-section .frame-preview .frame-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.profile-frames-section .frame-placeholder {
  font-size: 2rem;
  color: var(--text-muted);
}

.profile-frames-section .frame-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.profile-frames-section .frame-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.profile-frames-section .frame-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.profile-frames-section .frame-unlock,
.profile-frames-section .frame-bonus {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.profile-frames-section .frame-bonus {
  color: var(--success);
}

.profile-frames-section .frame-code {
  margin-top: var(--space-1);
}

.profile-frames-section .frame-code code {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--primary);
}

.profile-frames-section .frame-actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1: COLLECTIBLE FRAMES SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.collectible-frames-section .collectible-frames-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-4);
}

@media (max-width: 992px) {
  .collectible-frames-section .collectible-frames-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .collectible-frames-section .collectible-frames-grid {
    grid-template-columns: 1fr;
  }
}

.collectible-frames-section .collectible-frame-slot {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.collectible-frames-section .collectible-frame-slot.has-frame {
  border-style: solid;
  border-color: var(--rarity-color, var(--border));
}

.collectible-frames-section .collectible-frame-slot.drag-over {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.collectible-frames-section .slot-header {
  display: flex;
  justify-content: center;
}

.collectible-frames-section .rarity-badge {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.collectible-frames-section .slot-preview {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.collectible-frames-section .frame-preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.collectible-frames-section .frame-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
}

.collectible-frames-section .placeholder-icon {
  font-size: 1.5rem;
}

.collectible-frames-section .placeholder-text {
  font-size: 0.75rem;
  text-align: center;
}

.collectible-frames-section .slot-input {
  display: flex;
  gap: var(--space-2);
}

.collectible-frames-section .slot-input .input-url {
  flex: 1;
  font-size: 0.85rem;
}

.collectible-frames-section .btn-clear {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-2);
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.collectible-frames-section .btn-clear:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1: MYSTERY BOX CONFIG SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.mystery-box-config-section .mystery-box-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.mystery-box-config-section .tab-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.mystery-box-config-section .tab-button:hover {
  border-color: var(--tab-color, var(--primary));
}

.mystery-box-config-section .tab-button.active {
  border-color: var(--tab-color, var(--primary));
  background: rgba(99, 102, 241, 0.1);
}

.mystery-box-config-section .tab-button.configured .tab-check {
  color: var(--success);
}

.mystery-box-config-section .mystery-box-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.mystery-box-config-section .empty-box-state {
  text-align: center;
  padding: var(--space-6);
}

.mystery-box-config-section .empty-icon {
  font-size: 3rem;
  margin-bottom: var(--space-3);
}

.mystery-box-config-section .config-group,
.mystery-box-config-section .config-section {
  margin-bottom: var(--space-4);
}

.mystery-box-config-section .config-row {
  display: grid;
  grid-template-columns: 1fr 80px 60px;
  gap: var(--space-3);
  align-items: end;
}

@media (max-width: 576px) {
  .mystery-box-config-section .config-row {
    grid-template-columns: 1fr;
  }
}

.mystery-box-config-section .section-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.mystery-box-config-section .section-toggle:hover {
  background: var(--bg-hover);
}

.mystery-box-config-section .toggle-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mystery-box-config-section .section-content {
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.mystery-box-config-section .images-grid,
.mystery-box-config-section .texts-grid,
.mystery-box-config-section .probs-grid,
.mystery-box-config-section .advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

.mystery-box-config-section .options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.mystery-box-config-section .box-actions {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1.5: MYSTERY BOX CONFIG SECTION V3
   Multi-boxes per rarity + shared appearance
   ═══════════════════════════════════════════════════════════════════════ */

/* Section wrapper */
.mystery-box-config-section-v3 {
  --rarity-color: var(--primary);
}

/* Rarity tabs */
.rarity-tabs-v3 {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.rarity-tab-v3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.rarity-tab-v3:hover {
  border-color: var(--rarity-color);
}

.rarity-tab-v3.active {
  border-color: var(--rarity-color);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.rarity-tab-v3 .tab-emoji {
  font-size: 1.1rem;
}

.rarity-tab-v3 .tab-label {
  font-weight: 500;
}

.rarity-tab-v3 .tab-count {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.rarity-tab-v3.active .tab-count {
  background: var(--rarity-color);
  color: white;
}

.rarity-tab-v3 .tab-warning {
  font-size: 0.8rem;
}

/* Content panel */
.rarity-content-v3 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

/* Header */
.rarity-header-v3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.rarity-header-v3 .rarity-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1.1rem;
  font-weight: 600;
}

.rarity-header-v3 .rarity-emoji {
  font-size: 1.3rem;
}

.rarity-header-v3 .rarity-actions {
  display: flex;
  gap: var(--space-2);
}

/* Boxes grid */
.boxes-grid-v3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

/* Box card */
.box-card-v3 {
  background: var(--bg-tertiary);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  transition: all var(--transition-fast);
  position: relative;
}

.box-card-v3:hover {
  border-color: var(--rarity-color);
  transform: translateY(-2px);
}

.box-card-v3.is-default {
  border-color: var(--rarity-color);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-tertiary) 100%);
}

.box-card-v3.is-disabled {
  opacity: 0.6;
}

/* Box header */
.box-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.box-emoji {
  font-size: 2rem;
}

.box-name {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.box-badges {
  display: flex;
  gap: var(--space-1);
  font-size: 0.9rem;
}

.badge-default {
  color: var(--warning);
}

.badge-enabled {
  color: var(--success);
}

.badge-disabled {
  color: var(--danger);
}

/* Probability bar */
.box-probs {
  margin-bottom: var(--space-3);
}

.prob-bar {
  display: flex;
  height: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.prob-collectible {
  background: var(--info);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  transition: width var(--transition-fast);
}

.prob-bonus {
  background: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  transition: width var(--transition-fast);
}

/* Specific items */
.box-specific {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.specific-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.specific-item.has-selection {
  color: var(--primary);
  font-weight: 500;
}

/* Box actions */
.box-actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.btn-icon-sm:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-icon-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon-sm.btn-danger:hover {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Modal styles */
.mystery-box-config-section-v3 .modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-4);
}

.mystery-box-config-section-v3 .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.mystery-box-config-section-v3 .modal-content.selection-modal,
.mystery-box-config-section-v3 .modal-content.appearance-modal {
  max-width: 700px;
}

.mystery-box-config-section-v3 .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.mystery-box-config-section-v3 .modal-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

.mystery-box-config-section-v3 .modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.mystery-box-config-section-v3 .modal-close:hover {
  background: var(--danger);
  color: white;
}

.mystery-box-config-section-v3 .modal-body {
  padding: var(--space-4);
}

.mystery-box-config-section-v3 .modal-info {
  padding: var(--space-3);
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: 0.9rem;
}

.mystery-box-config-section-v3 .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg-card);
}

/* Form groups */
.mystery-box-config-section-v3 .form-group {
  margin-bottom: var(--space-4);
}

.mystery-box-config-section-v3 .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
}

.mystery-box-config-section-v3 .prob-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.mystery-box-config-section-v3 .prob-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.mystery-box-config-section-v3 .prob-total {
  margin-top: var(--space-2);
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
}

.mystery-box-config-section-v3 .prob-total.is-valid {
  color: var(--success);
}

.mystery-box-config-section-v3 .prob-total.is-invalid {
  color: var(--danger);
}

/* Selection grid */
.mystery-box-config-section-v3 .selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-2);
  max-height: 350px;
  overflow-y: auto;
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.mystery-box-config-section-v3 .selection-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.mystery-box-config-section-v3 .selection-item:hover {
  border-color: var(--primary);
}

.mystery-box-config-section-v3 .selection-item.selected {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.mystery-box-config-section-v3 .selection-item .item-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.mystery-box-config-section-v3 .selection-item .item-icon {
  font-size: 1.5rem;
}

.mystery-box-config-section-v3 .selection-item .item-name {
  font-size: 0.75rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mystery-box-config-section-v3 .selection-item .item-rarity {
  font-size: 0.7rem;
}

.mystery-box-config-section-v3 .selection-item .item-check {
  font-size: 0.8rem;
}

.mystery-box-config-section-v3 .selection-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.mystery-box-config-section-v3 .selection-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.mystery-box-config-section-v3 .empty-selection {
  text-align: center;
  padding: var(--space-6);
  color: var(--text-muted);
}

/* Appearance modal sections */
.mystery-box-config-section-v3 .appearance-section {
  margin-bottom: var(--space-5);
}

.mystery-box-config-section-v3 .appearance-section h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mystery-box-config-section-v3 .images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (max-width: 576px) {
  .mystery-box-config-section-v3 .images-grid {
    grid-template-columns: 1fr;
  }
}

.mystery-box-config-section-v3 .image-slot label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.mystery-box-config-section-v3 .texts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.mystery-box-config-section-v3 .options-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1.5: MYSTERY BOX V3.1 - Slider & Appearance Modal
   ═══════════════════════════════════════════════════════════════════════ */

/* Probability Slider */
.prob-slider-container {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.prob-slider-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.prob-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.prob-label.collectible {
  color: var(--info);
}

.prob-label.bonus {
  color: var(--warning);
}

.prob-slider-wrapper {
  position: relative;
  height: 20px;
  margin-bottom: var(--space-3);
}

.prob-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.prob-slider-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.prob-slider-fill {
  height: 100%;
  transition: width 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prob-slider-fill.collectible {
  background: linear-gradient(135deg, var(--info) 0%, #0ea5e9 100%);
}

.prob-slider-fill.bonus {
  background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%);
}

.prob-slider-values {
  display: flex;
  justify-content: space-between;
}

.prob-value {
  font-size: 1.2rem;
  font-weight: 700;
}

.prob-value.collectible {
  color: var(--info);
}

.prob-value.bonus {
  color: var(--warning);
}

/* Selection summary */
.mystery-box-config-section-v3 .selection-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

/* Label hint */
.mystery-box-config-section-v3 .label-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Appearance modal V3.1 */
.mystery-box-config-section-v3 .appearance-modal-v3 {
  max-width: 800px;
}

/* Color picker row */
.mystery-box-config-section-v3 .color-picker-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.mystery-box-config-section-v3 .form-color-input {
  width: 50px;
  height: 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 2px;
}

.mystery-box-config-section-v3 .color-preview {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Images grid V3.1 with preview */
.mystery-box-config-section-v3 .images-grid-v3 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .mystery-box-config-section-v3 .images-grid-v3 {
    grid-template-columns: 1fr;
  }
}

.mystery-box-config-section-v3 .image-slot-v3 {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.mystery-box-config-section-v3 .image-slot-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.mystery-box-config-section-v3 .image-preview-v3 {
  width: 100%;
  height: 100px;
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.mystery-box-config-section-v3 .image-preview-v3.has-image {
  border-style: solid;
  border-color: var(--success);
}

.mystery-box-config-section-v3 .image-preview-v3 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mystery-box-config-section-v3 .image-preview-v3 .no-image {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.mystery-box-config-section-v3 .image-actions-v3 {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.mystery-box-config-section-v3 .btn-sm {
  padding: var(--space-1) var(--space-2);
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.mystery-box-config-section-v3 .btn-upload {
  flex: 1;
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.mystery-box-config-section-v3 .btn-upload:hover {
  opacity: 0.9;
}

.mystery-box-config-section-v3 .btn-reset {
  background: var(--bg-tertiary);
}

.mystery-box-config-section-v3 .btn-reset:hover {
  border-color: var(--warning);
}

.mystery-box-config-section-v3 .image-url-input {
  font-size: 0.75rem;
  padding: var(--space-2);
}

/* Label with reset button */
.mystery-box-config-section-v3 .label-with-reset {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-1);
}

.mystery-box-config-section-v3 .btn-reset-text {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.mystery-box-config-section-v3 .btn-reset-text:hover {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
}

/* Toggle group */
.mystery-box-config-section-v3 .toggle-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mystery-box-config-section-v3 .toggle-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.mystery-box-config-section-v3 .toggle-label {
  font-size: 0.85rem;
  cursor: pointer;
}

/* Item rarity indicator in selection grid */
.mystery-box-config-section-v3 .selection-item[style*="--item-color"] {
  border-left: 3px solid var(--item-color);
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1.5: UPGRADE CONFIG SECTION (Mystery Box Global Upgrades)
   ═══════════════════════════════════════════════════════════════════════ */

.upgrade-config-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}

.upgrade-config-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.upgrade-config-header .upgrade-icon {
  font-size: 1.5rem;
}

.upgrade-config-header .upgrade-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.upgrade-config-header .upgrade-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

@media (max-width: 768px) {
  .upgrade-config-header .upgrade-hint {
    width: 100%;
    margin-left: 0;
    margin-top: var(--space-2);
  }
}

.upgrade-sliders {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.upgrade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

.upgrade-row:hover:not(.disabled) {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.upgrade-row.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.upgrade-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.upgrade-arrow {
  color: var(--text-muted);
  font-weight: bold;
}

.rarity-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--rarity-color, var(--border));
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--rarity-color, var(--text-primary));
}

.upgrade-control {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  max-width: 300px;
}

.upgrade-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.upgrade-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.upgrade-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.upgrade-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.upgrade-slider:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.upgrade-value {
  min-width: 50px;
  text-align: right;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--primary);
}

.upgrade-info {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 576px) {
  .upgrade-row {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .upgrade-control {
    max-width: none;
  }

  .upgrade-label {
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1: DAILY REWARDS SECTION
   ═══════════════════════════════════════════════════════════════════════ */

.daily-rewards-section .daily-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

@media (max-width: 576px) {
  .daily-rewards-section .daily-calendar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.daily-rewards-section .day-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.daily-rewards-section .day-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.daily-rewards-section .day-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: var(--shadow-glow);
}

.daily-rewards-section .day-card.milestone {
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.1);
}

.daily-rewards-section .day-card.milestone.selected {
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.daily-rewards-section .day-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  position: relative;
}

.daily-rewards-section .milestone-star {
  position: absolute;
  top: -8px;
  right: -12px;
  font-size: 0.7rem;
}

.daily-rewards-section .day-emoji {
  font-size: 1.5rem;
}

.daily-rewards-section .day-reward {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.daily-rewards-section .day-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Day Editor Panel */
.daily-rewards-section .day-editor {
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.daily-rewards-section .editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.daily-rewards-section .editor-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.daily-rewards-section .editor-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.daily-rewards-section .editor-group {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.daily-rewards-section .group-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-3) 0;
}

.daily-rewards-section .form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
}

@media (max-width: 576px) {
  .daily-rewards-section .form-row {
    grid-template-columns: 1fr;
  }
}

.daily-rewards-section .options-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════════════
   v2.1: SHARED STYLES
   ═══════════════════════════════════════════════════════════════════════ */

/* Stats chips */
.stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
}

.stat-chip .chip-emoji {
  font-size: 0.9rem;
}

.stat-chip .chip-count {
  font-weight: 600;
  color: var(--primary);
}

.stat-chip.milestone-chip {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
}

.stat-chip.bonus-chip {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Section info box */
.section-info {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  margin-top: var(--space-4);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.section-info .info-icon {
  flex-shrink: 0;
}

/* Form elements */
.form-group-small {
  max-width: 100px;
}

.form-input-color {
  width: 50px;
  height: 38px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Checkbox label */
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Icon action button */
.btn-icon-action {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.btn-icon-action:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.btn-icon-action.btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════════════════
   PROFILE FRAMES SECTION V2.1 - 2 Slots + Library Architecture
   ═══════════════════════════════════════════════════════════════════════ */

.profile-frames-section-v2 {
  padding: var(--space-2);
}

.profile-frames-section-v2 .header-glow.frame {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4) 0%, rgba(236, 72, 153, 0.25) 100%);
}

/* Subsection title */
.profile-frames-section-v2 .subsection-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-3) 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ────────────────────────────────────────────────────────────────────────
   Section 1: Les 2 Slots (Argent/Or)
   ──────────────────────────────────────────────────────────────────────── */

.profile-slots-container {
  margin-bottom: var(--space-6);
}

.profile-slots-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 768px) {
  .profile-slots-grid {
    grid-template-columns: 1fr;
  }
}

.profile-slot-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all 0.3s ease;
  position: relative;
}

.profile-slot-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.profile-slot-card.has-custom {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
}

/* Slot Header */
.profile-slot-card .slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-slot-card .slot-badge {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-slot-card .slot-badge.silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
  color: #333;
}

.profile-slot-card .slot-badge.gold {
  background: linear-gradient(135deg, #ffd700 0%, #f0b000 100%);
  color: #333;
}

.profile-slot-card .custom-badge {
  padding: var(--space-1) var(--space-2);
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  color: var(--success);
}

/* Slot Preview */
.profile-slot-card .slot-preview {
  width: 100%;
  aspect-ratio: 1;
  max-height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-slot-card .slot-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Slot Info */
.profile-slot-card .slot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.profile-slot-card .slot-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.profile-slot-card .slot-condition {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.85rem;
}

.profile-slot-card .slot-bonus {
  font-size: 0.85rem;
  color: var(--success);
}

.profile-slot-card .slot-price {
  font-size: 0.85rem;
  color: var(--warning);
}

/* Slot Actions */
.profile-slot-card .slot-actions {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.profile-slot-card .btn-action {
  flex: 1;
  min-width: 70px;
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
}

.profile-slot-card .btn-action:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.profile-slot-card .btn-action.assign {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

.profile-slot-card .btn-action.assign:hover {
  background: var(--primary);
  color: white;
}

.profile-slot-card .btn-action.unassign {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.profile-slot-card .btn-action.unassign:hover {
  background: var(--danger);
  color: white;
}

.profile-slot-card .btn-action.edit {
  flex: 0;
  min-width: 40px;
}

/* ────────────────────────────────────────────────────────────────────────
   Section 2: Bibliotheque de Frames Custom
   ──────────────────────────────────────────────────────────────────────── */

.profile-library-container {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
}

.profile-library-container .library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.profile-library-container .library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.profile-library-container .library-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: all 0.2s ease;
}

.profile-library-container .library-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.profile-library-container .library-preview {
  width: 100%;
  aspect-ratio: 1;
  max-height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-library-container .library-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-library-container .library-placeholder {
  font-size: 2rem;
  opacity: 0.3;
}

.profile-library-container .library-info {
  text-align: center;
}

.profile-library-container .library-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-library-container .library-info small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.profile-library-container .library-actions {
  display: flex;
  gap: var(--space-1);
  justify-content: center;
}

.profile-library-container .btn-sm {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  transition: all 0.2s ease;
}

.profile-library-container .btn-sm.edit:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.profile-library-container .btn-sm.delete:hover {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ────────────────────────────────────────────────────────────────────────
   Modal: Assigner frame a un slot
   ──────────────────────────────────────────────────────────────────────── */

.assign-modal {
  max-width: 500px;
}

.assign-modal .modal-body {
  max-height: 400px;
  overflow-y: auto;
}

.assign-modal .assign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
}

.assign-modal .assign-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.assign-modal .assign-card:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
}

.assign-modal .assign-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.assign-modal .assign-card span {
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-secondary);
}

.assign-modal .assign-placeholder {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.3;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

/* ────────────────────────────────────────────────────────────────────────
   Modal: Configuration slot (condition/bonus/prix)
   ──────────────────────────────────────────────────────────────────────── */

.slot-config-modal {
  max-width: 500px;
}

.slot-config-modal .modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.slot-config-modal .config-group {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.slot-config-modal .config-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 var(--space-3) 0;
  color: var(--text-primary);
}

.slot-config-modal .form-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

@media (max-width: 480px) {
  .slot-config-modal .form-row-2col {
    grid-template-columns: 1fr;
  }
}

.slot-config-modal .form-group {
  margin-bottom: var(--space-3);
}

.slot-config-modal .form-group:last-child {
  margin-bottom: 0;
}

.slot-config-modal .form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-1);
}

.slot-config-modal .form-select,
.slot-config-modal .form-input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.slot-config-modal .form-select:focus,
.slot-config-modal .form-input:focus {
  outline: none;
  border-color: var(--primary);
}

.slot-config-modal .form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slot-config-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.slot-config-modal .config-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.slot-config-modal .badge-coming-soon {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.15));
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slot-config-modal .config-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0 0 var(--space-3) 0;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════
   COLLECTIBLE FRAMES SECTION V2 - Rarity Slots Design
   ═══════════════════════════════════════════════════════════════════════ */

.collectible-frames-section-v2 {
  padding: var(--space-2);
}

.collectible-frames-section-v2 .header-glow.card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.4) 0%, rgba(168, 85, 247, 0.25) 100%);
}

.collectible-frames-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.collectible-frame-slot-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all 0.3s ease;
}

.collectible-frame-slot-v2.has-custom {
  border-style: solid;
  border-color: var(--rarity-color);
}

.collectible-frame-slot-v2.using-default {
  border-style: dashed;
  border-color: var(--glass-border);
}

.collectible-frame-slot-v2.drag-over {
  border-color: var(--rarity-color);
  background: color-mix(in srgb, var(--rarity-color) 10%, transparent);
}

/* Nouveau header avec indicateur de niveau */
.slot-header-v2 {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--space-2);
}

.level-indicator {
  width: 36px;
  height: 36px;
  border: 3px solid var(--rarity-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.level-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.slot-title-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slot-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.slot-xp {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.slot-status {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.slot-status.is-custom {
  background: color-mix(in srgb, var(--rarity-color) 20%, transparent);
  color: var(--rarity-color);
}

/* Zone preview cliquable avec overlay */
.slot-preview-v2 {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slot-preview-v2:hover {
  transform: scale(1.02);
}

.slot-preview-v2 .frame-preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.slot-preview-v2 .frame-preview-image.is-default {
  opacity: 0.7;
}

.slot-preview-v2:hover .frame-preview-image {
  opacity: 0.6;
}

/* Overlay sur hover */
.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slot-preview-v2:hover .preview-overlay {
  opacity: 1;
}

.overlay-icon {
  font-size: 2rem;
}

.overlay-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
}

.upload-spinner {
  font-size: 2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Badge "Frame par défaut" */
.default-badge {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1) var(--space-2);
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.slot-preview-v2.is-uploading {
  pointer-events: none;
}

.slot-preview-v2.is-uploading .preview-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
}

.slot-input-v2 {
  display: flex;
  gap: var(--space-2);
}

.input-url-v2 {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text);
}

.input-url-v2:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-clear-v2 {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.btn-clear-v2:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Bouton reset vers frame par défaut */
.btn-reset-default {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.btn-reset-default:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

/* Grille 3 colonnes pour collectible frames */
.collectible-frames-grid-v2.three-columns {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .collectible-frames-grid-v2.three-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .collectible-frames-grid-v2.three-columns {
    grid-template-columns: 1fr;
  }
}

/* XP info sous le badge */
.slot-xp-info {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: calc(var(--space-1) * -1);
}

/* Description sous l'input */
.slot-description {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* Hint dans le placeholder */
.placeholder-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════════
   LEVELING EXPLANATION V2 - Info Box
   ═══════════════════════════════════════════════════════════════════════ */

.leveling-explanation-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.leveling-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.leveling-icon {
  font-size: 1.2rem;
}

.leveling-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.leveling-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.5;
}

/* Progression horizontale avec cercles */
.leveling-progression {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.level-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.level-circle {
  width: 40px;
  height: 40px;
  border: 3px solid #6b7280;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: all 0.2s ease;
}

.level-circle.level-1 {
  border-color: #6b7280;
}

.level-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.level-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.level-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 var(--space-1);
  margin-bottom: var(--space-4);
}

@media (max-width: 500px) {
  .leveling-progression {
    gap: var(--space-1);
  }
  .level-circle {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
  .level-arrow {
    font-size: 0.9rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MYSTERY BOX CONFIG SECTION V2 - Tab-Based Design
   ═══════════════════════════════════════════════════════════════════════ */

.mystery-box-section-v2 {
  padding: var(--space-2);
}

.mystery-box-section-v2 .header-glow.box {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.4) 0%, rgba(245, 158, 11, 0.25) 100%);
}

.mystery-box-content-v2 {
  margin-top: var(--space-4);
}

.box-config-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.config-group-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.config-row-v2 {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.config-section-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.section-toggle-v2 {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.section-toggle-v2:hover {
  background: var(--bg-hover);
}

.section-toggle-v2 .toggle-icon {
  font-size: 0.8rem;
  opacity: 0.6;
}

.section-content-v2 {
  padding: var(--space-4);
  padding-top: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.images-grid-v2,
.texts-grid-v2,
.probs-grid-v2,
.advanced-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.options-grid-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.box-actions-v2 {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* Mystery Box Config V2 - Status Header */
.box-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.status-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.status-emoji {
  font-size: 1.5rem;
}

.status-label {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.status-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.default {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.status-badge.custom {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-actions {
  display: flex;
  gap: var(--space-2);
}

/* Mystery Box Config V2 - Image Upload Slots */
.mystery-images-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

@media (max-width: 900px) {
  .mystery-images-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .mystery-images-grid {
    grid-template-columns: 1fr;
  }
}

.image-upload-slot {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.image-preview-slot {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.image-preview-slot:hover {
  border-color: var(--accent);
}

.image-preview-slot.is-default {
  border-style: solid;
  border-color: var(--border);
  opacity: 0.7;
}

.image-preview-slot.is-default:hover {
  opacity: 1;
}

.image-preview-slot .preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: var(--space-2);
}

.image-preview-slot .preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.image-preview-slot:hover .preview-overlay {
  opacity: 1;
}

.image-preview-slot .overlay-icon {
  font-size: 1.5rem;
}

.image-preview-slot .upload-spinner {
  font-size: 1.5rem;
  animation: spin 1s linear infinite;
}

.image-preview-slot .default-badge {
  position: absolute;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: #9ca3af;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.image-preview-slot .empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
}

.image-preview-slot .empty-placeholder span:first-child {
  font-size: 2rem;
  opacity: 0.5;
}

.image-preview-slot .placeholder-text {
  font-size: 0.75rem;
  margin-top: var(--space-1);
}

/* Default indicator in labels */
.default-indicator {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: var(--space-1);
}

/* Disabled inputs styling */
.form-input-v2:disabled,
.form-textarea-v2:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg-elevated);
}

.form-input-v2.is-default {
  border-style: dashed;
}

/* ═══════════════════════════════════════════════════════════════════════
   DAILY REWARDS SECTION V2 - Calendar Design
   ═══════════════════════════════════════════════════════════════════════ */

.daily-rewards-section-v2 {
  padding: var(--space-2);
}

.daily-rewards-section-v2 .header-glow.calendar {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, rgba(5, 150, 105, 0.25) 100%);
}

.daily-calendar-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.day-card-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.day-card-v2:hover {
  border-color: var(--reward-color);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.day-card-v2.selected {
  border-color: var(--reward-color);
  background: color-mix(in srgb, var(--reward-color) 15%, var(--glass-bg));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--reward-color) 30%, transparent);
}

.day-card-v2.milestone {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
  border-color: rgba(251, 191, 36, 0.4);
}

.day-card-v2.bonus {
  animation: bonus-pulse 2s ease-in-out infinite;
}

@keyframes bonus-pulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 15px rgba(245, 158, 11, 0.3); }
}

.day-number-v2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--reward-color);
  display: flex;
  align-items: center;
  gap: 4px;
}

.day-number-v2 .milestone-star {
  font-size: 0.8rem;
}

.day-emoji-v2 {
  font-size: 1.8rem;
}

.day-reward-v2 {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.day-name-v2 {
  font-size: 0.7rem;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Day Editor V2 */
.day-editor-v2 {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
}

.editor-header-v2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.editor-title-v2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.editor-content-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.editor-group-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.group-title-v2 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.form-row-v2 {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.options-row-v2 {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ═══════════════════════════════════════════════════════════════════════
   SHARED V2 FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════ */

.form-group-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-width: 150px;
}

.form-group-v2.form-group-small {
  flex: 0 0 auto;
  min-width: 80px;
  max-width: 100px;
}

.form-label-v2 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input-v2,
.form-select-v2,
.form-textarea-v2 {
  width: 100%;
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-input-v2:focus,
.form-select-v2:focus,
.form-textarea-v2:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input-color-v2 {
  width: 50px;
  height: 38px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-input);
}

.checkbox-label-v2 {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.checkbox-label-v2:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.checkbox-label-v2 input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Section Info V2 */
.section-info-v2 {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  margin-top: var(--space-5);
}

.section-info-v2 .info-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.section-info-v2 .info-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Button Danger for V2 sections */
.btn-outline-fancy.btn-danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.btn-outline-fancy.btn-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

.btn-outline-fancy.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   DAILY REWARDS SECTION V2 - Additional Styles
   ═══════════════════════════════════════════════════════════════════════ */

/* Status Header (Fallback indicator) */
.daily-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.daily-status-header.using-fallback {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.05));
  border-color: rgba(59, 130, 246, 0.3);
}

.daily-status-header .status-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.daily-status-header .status-icon {
  font-size: 1.3rem;
}

.daily-status-header .status-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.daily-status-header .status-text strong {
  color: var(--text);
}

.daily-status-header .status-badge {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.daily-status-header .badge-default {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.daily-status-header .badge-custom {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* Daily Stats Chips */
.daily-stats-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.daily-stats-chips .stat-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
}

.daily-stats-chips .chip-emoji {
  font-size: 1rem;
}

.daily-stats-chips .chip-label {
  color: var(--text-secondary);
}

.daily-stats-chips .chip-count {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  color: var(--text);
}

/* Day Card Badges */
.day-card-v2 .day-badges {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
}

.day-card-v2 .milestone-badge,
.day-card-v2 .fallback-badge {
  font-size: 0.7rem;
  padding: 2px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.day-card-v2.is-fallback {
  opacity: 0.85;
  border-style: dashed;
}

.day-card-v2.is-fallback:hover {
  opacity: 1;
}

/* Preset Modal */
.preset-modal {
  max-width: 700px;
}

.preset-modal .preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.preset-modal .preset-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.preset-modal .preset-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.preset-modal .preset-header {
  display: flex;
  justify-content: center;
}

.preset-modal .preset-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.preset-modal .preset-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

.preset-modal .preset-preview {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.preset-modal .preview-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-2);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.preset-modal .preview-day.milestone {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(251, 191, 36, 0.2));
}

.preset-modal .preview-num {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.preset-modal .preview-emoji {
  font-size: 1rem;
}

.preset-modal .preview-more {
  display: flex;
  align-items: center;
  padding: var(--space-2);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Preset Modal V2 - Dynamique avec sélecteur de jours */
.preset-modal-v2 {
  max-width: 700px;
}

.preset-days-selector {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.days-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.days-slider {
  flex: 1;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-card);
  border-radius: 4px;
  outline: none;
}

.days-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  transition: transform 0.15s ease;
}

.days-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.days-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.days-value {
  min-width: 80px;
  padding: var(--space-2) var(--space-3);
  background: var(--primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

.preset-days-badge {
  padding: var(--space-1) var(--space-2);
  background: var(--primary-alpha);
  color: var(--primary);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.form-hint-v2 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}

.form-hint-v2.warning {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border-left: 3px solid #f59e0b;
}

/* Section Footer */
.section-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* Header Actions (multiple buttons) */
.header-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ═══════════════════════════════════════════════════════════════════
   DAILY REWARDS - CATCHUP CONFIG SECTION
   ═══════════════════════════════════════════════════════════════════ */

.catchup-config-section {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.catchup-config-section .section-header-sub {
  padding: var(--space-3);
  margin: calc(-1 * var(--space-4));
  margin-bottom: var(--space-4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: 1px solid var(--border);
}

.catchup-config-section .section-header-sub .header-title {
  font-size: 1rem;
  margin: 0;
}

.catchup-config-section .section-header-sub .header-desc {
  font-size: 0.85rem;
}

.catchup-config-content {
  animation: fadeIn 0.3s ease-out;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 28px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: transparent;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Form Grid */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Catchup Price Preview */
.catchup-price-preview {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.catchup-price-preview .preview-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 var(--space-3) 0;
}

.price-preview-grid {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.price-preview-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 80px;
  transition: all 0.2s ease;
}

.price-preview-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.preview-days {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.preview-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Catchup Disabled Notice */
.catchup-disabled-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: rgba(148, 163, 184, 0.1);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.catchup-disabled-notice .notice-icon {
  font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PVP GAMES CONFIG SECTION
   Configuration globale des jeux PvP (Morpion et Puissance 4)
   ═══════════════════════════════════════════════════════════════════════════ */

.pvp-games-config-section {
  padding: var(--space-2);
}

.pvp-games-config-section .header-glow.pvp {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.4) 0%, rgba(239, 68, 68, 0.25) 100%);
}

/* PvP Tabs */
.pvp-tabs {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.pvp-tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--glass-bg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: var(--text-secondary);
}

.pvp-tab:hover {
  border-color: var(--tab-color);
  transform: translateY(-2px);
}

.pvp-tab.active {
  border-color: var(--tab-color);
  background: color-mix(in srgb, var(--tab-color) 15%, var(--glass-bg));
  color: var(--text-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tab-color) 20%, transparent);
}

.pvp-tab .tab-emoji {
  font-size: 1.3rem;
}

.pvp-tab .tab-label {
  font-size: 0.9rem;
}

.pvp-tab .tab-status {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 700;
}

.pvp-tab .tab-status.enabled {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

/* Config Panel */
.pvp-config-panel {
  animation: fadeIn 0.3s ease;
}

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

/* Config Card */
.config-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.config-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.config-card-header .config-emoji {
  font-size: 1.8rem;
}

.config-card-header h3 {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

/* Config Grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.config-field.full-width {
  grid-column: 1 / -1;
}

.config-field.important {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.config-field label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.config-field .field-icon {
  font-size: 1rem;
}

.config-field .field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.config-field input[type="number"],
.config-field .field-select {
  padding: var(--space-3);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.config-field input[type="number"]:focus,
.config-field .field-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.input-with-unit input {
  flex: 1;
}

.input-with-unit .unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Config Subsection */
.config-subsection {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border);
}

.config-subsection h4 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-4);
}

.config-subsection h4 span {
  font-size: 1.1rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch.inline {
  margin-left: auto;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(148, 163, 184, 0.3);
  border-radius: 26px;
  transition: 0.3s ease;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

/* Info Panel */
.pvp-info-panel {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-lg);
  margin-top: var(--space-4);
}

.pvp-info-panel .info-icon {
  font-size: 1.3rem;
}

.pvp-info-panel .info-content strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.pvp-info-panel .info-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
  .pvp-tabs {
    flex-direction: column;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }
}
