/* ==========================================================================
   Intégration Native TCA — Custom Packs & Tables de Break des Membres (v4.0)
   - N’écrase JAMAIS le vrai Cartable v18 de TCA (aucune modification du layout Cartable)
   - Bouton natif dans .tca-cartable-v18-nav -> Modale Studio Custom Packs
   - Galerie Custom Packs & Breaks intégrée dans l’onglet Marché (.is-market-mode)
   - Carte Contrôle Cases intégrée dans Console Opérations (/application/operations.html)
   ========================================================================== */

html body #root .v193-collection-shell.is-market-mode > #tca-market-mystery-packs-section:not([hidden]),
html body #root .v2221-market-landing > #tca-market-mystery-packs-section:not([hidden]),
html body #tca-ops-mystery-packs-panel:not([hidden]) {
  display: block !important;
}

body.tca-mp-modal-open { overflow: hidden !important; }

.tca-mp-ops-summary {
  min-height: 44px;
  cursor: pointer;
  color: #f5f3ff;
  line-height: 1.5;
}
.tca-mp-ops-summary span { display: block; font-size: 0.85rem; color: #ddd6fe; }
.tca-mp-ops-summary:focus-visible { outline: 3px solid #fbbf24; outline-offset: 3px; }
.tca-mp-ops-panel details[open] > .tca-mp-ops-summary { margin-bottom: 1rem; }

/* Bouton natif dans la barre du Cartable v18 (juste à côté de « Stock de Lachine ») */
html body .tca-cartable-v18-nav .tca-cartable-v18-btn.is-custom-packs {
  min-height: 44px !important;
  min-width: 44px !important;
  background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%) !important;
  border: 1px solid rgba(251, 191, 36, 0.65) !important;
  color: #fde68a !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.35);
  cursor: pointer;
}

html body .tca-cartable-v18-nav .tca-cartable-v18-btn.is-custom-packs:hover {
  filter: brightness(1.08);
}

/* Conteneurs intégrés dans Marché et Console Opérations + Modale Studio */
.tca-mp-market-embed,
.tca-mp-ops-panel,
.tca-mp-studio-dialog {
  box-sizing: border-box;
  width: 100%;
  max-width: 78rem;
  margin: 0.75rem auto 1.25rem;
  padding: 1.1rem;
  background: radial-gradient(circle at 18% 0%, rgba(124, 58, 237, 0.16), transparent 45%),
              linear-gradient(180deg, #130d24 0%, #0e091b 100%);
  color: #f5f3ff !important;
  border: 1px solid rgba(167, 139, 250, 0.26);
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.52);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: clip;
  scroll-margin-top: 92px;
}

.tca-mp-market-embed *,
.tca-mp-ops-panel *,
.tca-mp-studio-dialog *,
.tca-mp-zoom-dialog * {
  box-sizing: border-box;
  min-width: 0;
}

/* Fenêtre Modale Studio Custom Packs (par-dessus le Cartable sans le déplacer) */
.tca-mp-studio-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem 3rem;
  background: rgba(8, 5, 18, 0.82);
  backdrop-filter: blur(7px);
  overflow-y: auto;
}

.tca-mp-studio-dialog {
  max-width: 66rem;
  margin: 0 auto;
  border: 1.5px solid rgba(251, 191, 36, 0.45);
}

/* Protection contraste blanc/or contre les feuilles globales */
html body .tca-mp-market-embed h2,
html body .tca-mp-market-embed h3,
html body .tca-mp-market-embed h4,
html body .tca-mp-market-embed h5,
html body .tca-mp-market-embed strong,
html body .tca-mp-market-embed li,
html body .tca-mp-studio-dialog h2,
html body .tca-mp-studio-dialog h3,
html body .tca-mp-studio-dialog h4,
html body .tca-mp-studio-dialog h5,
html body .tca-mp-studio-dialog strong,
html body .tca-mp-studio-dialog li,
html body .tca-mp-ops-panel h2,
html body .tca-mp-ops-panel h3,
html body .tca-mp-ops-panel h4,
html body .tca-mp-ops-panel h5,
html body .tca-mp-ops-panel strong,
html body .tca-mp-ops-panel li {
  color: #ffffff !important;
}

html body .tca-mp-market-embed code,
html body .tca-mp-studio-dialog code,
html body .tca-mp-ops-panel code {
  color: #fde68a !important;
  background: rgba(251, 191, 36, 0.16);
  padding: 0.08rem 0.4rem;
  border-radius: 0.35rem;
}

/* --- En-tête Vitrine compact --- */
.tca-mp-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.25rem;
  margin-bottom: 0.9rem;
  border-radius: 1.05rem;
  background: radial-gradient(circle at 82% 35%, rgba(251, 191, 36, 0.24), transparent 46%),
              linear-gradient(135deg, #1d1036 0%, #2f1759 58%, #461d7c 100%);
  border: 1px solid rgba(251, 191, 36, 0.38);
  overflow: hidden;
}

html body .tca-mp-hero .tca-mp-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.48);
  color: #fde68a !important;
  font-size: 0.71rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

html body .tca-mp-hero .tca-mp-hero-title {
  margin: 0.32rem 0 0.12rem;
  font-size: clamp(1.22rem, 2.2vw, 1.58rem);
  line-height: 1.15;
  font-weight: 900;
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

html body .tca-mp-hero .tca-mp-hero-sub {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.32;
  color: #e9d5ff !important;
}

.tca-mp-booster-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tca-mp-booster-fan img {
  width: 62px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.55));
}

.tca-mp-booster-fan img:nth-child(1) { transform: rotate(-11deg) translateX(8px); }
.tca-mp-booster-fan img:nth-child(2) { transform: scale(1.1) translateY(-3px); z-index: 2; }
.tca-mp-booster-fan img:nth-child(3) { transform: rotate(11deg) translateX(-8px); }

/* --- Onglets internes de la Modale Studio (2 onglets simples : Créer | Mes Séries & Cases) --- */
.tca-mp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}

.tca-mp-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.95rem;
  border-radius: 0.78rem;
  border: 1px solid rgba(167, 139, 250, 0.26);
  background: rgba(255, 255, 255, 0.05);
  color: #e9d5ff !important;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}

.tca-mp-tab[aria-selected="true"] {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border-color: #fbbf24;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.tca-mp-tab:focus-visible,
.tca-mp-btn:focus-visible,
.tca-mp-spot-btn:focus-visible,
.tca-mp-filter-pill:focus-visible,
.tca-mp-zoom-trigger:focus-visible,
.tca-mp-pick-tile:focus-visible,
.tca-mp-input:focus-visible,
.tca-mp-select:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* --- Compteurs & Bandeau Plancher · Moyenne · Sommet --- */
.tca-mp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.tca-mp-stat {
  padding: 0.65rem 0.8rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(196, 181, 253, 0.18);
  text-align: center;
}

.tca-mp-stat-label {
  display: block;
  font-size: 0.71rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c4b5fd !important;
}

.tca-mp-stat-value {
  display: block;
  margin-top: 0.12rem;
  font-size: 1.28rem;
  font-weight: 900;
  color: #ffffff !important;
}

.tca-mp-odds-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.6rem 0 0.8rem;
}

.tca-mp-odds-item {
  padding: 0.55rem 0.65rem;
  border-radius: 0.78rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(196, 181, 253, 0.2);
  text-align: center;
}

.tca-mp-odds-item small {
  display: block;
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c4b5fd !important;
}

.tca-mp-odds-item strong {
  display: block;
  margin-top: 0.08rem;
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff !important;
}

.tca-mp-odds-item.is-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(180, 83, 9, 0.3) 100%);
  border-color: rgba(251, 191, 36, 0.65);
}

html body .tca-mp-odds-item.is-gold small,
html body .tca-mp-odds-item.is-gold strong {
  color: #fde68a !important;
}

/* --- Podium Vedette, Râtelier scellé & Table de Break --- */
.tca-mp-chase-podium {
  padding: 0.85rem;
  margin-bottom: 0.8rem;
  border-radius: 0.95rem;
  background: radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.2), transparent 65%),
              rgba(38, 22, 66, 0.85);
  border: 1.5px solid rgba(251, 191, 36, 0.58);
}

.tca-mp-chase-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

html body .tca-mp-chase-podium .tca-mp-chase-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 850;
  color: #fde68a !important;
}

.tca-mp-pack-rack-wrap {
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.8rem;
  border-radius: 0.9rem;
  background: rgba(13, 8, 25, 0.72);
  border: 1px solid rgba(167, 139, 250, 0.24);
}

.tca-mp-pack-rack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.4rem, 1fr));
  gap: 0.42rem;
  margin-top: 0.5rem;
}

.tca-mp-pack-pouch {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.14rem;
  min-height: 60px;
  padding: 0.3rem 0.2rem;
  border-radius: 0.5rem;
  text-align: center;
  font-size: 0.67rem;
  font-weight: 800;
}

.tca-mp-pack-pouch.is-sealed {
  background: linear-gradient(160deg, #7c3aed 0%, #4c1d95 65%, #b45309 100%);
  border: 1.5px solid #fbbf24;
  color: #ffffff;
}

.tca-mp-pack-pouch.is-drawn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(196, 181, 253, 0.25);
  color: #a78bfa;
}

.tca-mp-break-table {
  padding: 0.85rem;
  margin: 0.6rem 0 0.8rem;
  border-radius: 0.95rem;
  background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.24), transparent 60%),
              rgba(20, 12, 38, 0.9);
  border: 1.5px solid rgba(167, 139, 250, 0.5);
}

.tca-mp-spots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.8rem, 1fr));
  gap: 0.48rem;
  margin-top: 0.55rem;
}

.tca-mp-spot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.14rem;
  min-height: 52px;
  min-width: 44px;
  padding: 0.42rem 0.5rem;
  border-radius: 0.72rem;
  border: 1.5px solid #fbbf24;
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.55), rgba(76, 29, 149, 0.8));
  color: #ffffff !important;
  font-size: 0.83rem;
  font-weight: 850;
  cursor: pointer;
}

.tca-mp-spot-btn.is-taken {
  border-color: rgba(196, 181, 253, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #c4b5fd !important;
  cursor: default;
}

.tca-mp-break-stage {
  padding: 0.85rem;
  margin-top: 0.7rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #1f1137 0%, #3b1763 100%);
  border: 1.5px solid #fbbf24;
}

/* --- Vignettes Cartes Galerie (Format 63:88) --- */
.tca-mp-grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.2rem, 1fr));
  gap: 0.7rem;
}

.tca-mp-card-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.52rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(196, 181, 253, 0.2);
  background: linear-gradient(180deg, rgba(35, 24, 62, 0.92) 0%, rgba(22, 14, 40, 0.96) 100%);
}

.tca-mp-card-box.is-chase {
  background: linear-gradient(180deg, rgba(58, 36, 18, 0.92) 0%, rgba(30, 18, 45, 0.96) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.75);
}

.tca-mp-card-art {
  position: relative;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 0.65rem;
  padding: 0.32rem;
  background: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.14), rgba(15, 10, 28, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tca-mp-card-box.is-chase .tca-mp-card-art {
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.9) 0%, rgba(245, 158, 11, 0.75) 50%, rgba(253, 230, 138, 0.9) 100%);
  border-color: #fbbf24;
}

.tca-mp-card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.45rem;
  display: block;
}

.tca-mp-card-price-tag {
  position: absolute;
  bottom: 0.42rem;
  right: 0.42rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: rgba(15, 9, 28, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.55);
  color: #fde68a !important;
  font-size: 0.74rem;
  font-weight: 900;
  pointer-events: none;
}

.tca-mp-card-status-dot {
  position: absolute;
  top: 0.42rem;
  right: 0.42rem;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  background: rgba(15, 9, 28, 0.86);
  color: #ffffff;
  font-size: 0.67rem;
  font-weight: 850;
  pointer-events: none;
}

.tca-mp-zoom-trigger {
  appearance: none;
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tca-mp-zoom-hint {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15, 9, 28, 0.78);
  color: #fde68a;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* --- Grille visuelle de sélection des cartes du Cartable dans le Studio --- */
.tca-mp-studio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.4rem, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.tca-mp-pick-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.42rem;
  border-radius: 0.78rem;
  border: 1.5px solid rgba(196, 181, 253, 0.2);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.tca-mp-pick-tile.is-selected {
  border-color: #a855f7;
  background: rgba(124, 58, 237, 0.22);
}

.tca-mp-pick-tile.is-chase {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.18);
}

.tca-mp-pick-tile-art {
  position: relative;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 0.48rem;
  overflow: hidden;
  background: rgba(12, 8, 24, 0.8);
}

.tca-mp-pick-tile-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* --- Loupe Plein Écran sous TopLoader --- */
.tca-mp-zoom-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  background: rgba(10, 6, 20, 0.86);
  backdrop-filter: blur(8px);
}

.tca-mp-zoom-dialog {
  width: 100%;
  max-width: 24rem;
  padding: 1.05rem;
  border-radius: 1.15rem;
  background: radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.22), transparent 55%),
              linear-gradient(160deg, #1a1030 0%, #2b174d 100%);
  border: 2px solid rgba(251, 191, 36, 0.7);
  color: #ffffff;
  text-align: center;
}

.tca-mp-zoom-frame {
  width: min(16.5rem, 70vw);
  aspect-ratio: 63 / 88;
  margin: 0.55rem auto 0.8rem;
  padding: 0.48rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #fde68a 0%, #ffffff 48%, #f59e0b 100%);
}

.tca-mp-zoom-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.55rem;
  background: #0f0a1c;
  display: block;
}

/* --- Simulateur Flamme Collector --- */
.tca-mp-simulator {
  padding: 0.75rem 0.9rem;
  margin: 0.65rem 0 0.8rem;
  border-radius: 0.85rem;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.42);
}

.tca-mp-simulator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.6rem, 1fr));
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.tca-mp-sim-cell {
  padding: 0.42rem 0.5rem;
  border-radius: 0.6rem;
  background: rgba(14, 9, 27, 0.65);
  border: 1px solid rgba(233, 213, 255, 0.18);
  text-align: center;
}

.tca-mp-sim-cell small {
  display: block;
  font-size: 0.68rem;
  color: #d8b4fe;
}

html body .tca-mp-sim-cell strong {
  display: block;
  margin-top: 0.06rem;
  font-size: 0.98rem;
  font-weight: 900;
  color: #fde68a !important;
}

.tca-mp-flame-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid #fbbf24;
  color: #fde68a !important;
  font-size: 0.74rem;
  font-weight: 850;
}

/* --- Utilitaires UI --- */
.tca-mp-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.tca-mp-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.tca-mp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
}

.tca-mp-badge.is-free { background: rgba(16, 185, 129, 0.2); color: #6ee7b7 !important; border: 1px solid rgba(52, 211, 153, 0.35); }
.tca-mp-badge.is-locked { background: rgba(139, 92, 246, 0.24); color: #ddd6fe !important; border: 1px solid rgba(167, 139, 250, 0.4); }
.tca-mp-badge.is-chase { background: rgba(245, 158, 11, 0.22); color: #fde68a !important; border: 1px solid rgba(251, 191, 36, 0.5); }
.tca-mp-badge.is-locker { background: rgba(56, 189, 248, 0.18); color: #bae6fd !important; border: 1px solid rgba(56, 189, 248, 0.35); }
.tca-mp-badge.is-break { background: rgba(217, 70, 239, 0.22); color: #f5d0fe !important; border: 1px solid rgba(232, 121, 249, 0.42); }
.tca-mp-badge.is-alert { background: rgba(244, 63, 94, 0.24); color: #fecdd3 !important; border: 1px solid rgba(251, 113, 133, 0.45); }

html body .tca-mp-card-name {
  margin: 0.06rem 0 0;
  font-size: 0.86rem;
  font-weight: 850;
  color: #ffffff !important;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html body .tca-mp-card-meta {
  margin: 0;
  font-size: 0.75rem;
  color: #c4b5fd !important;
  line-height: 1.28;
}

.tca-mp-banner {
  padding: 0.68rem 0.88rem;
  border-radius: 0.78rem;
  margin-bottom: 0.8rem;
  font-size: 0.85rem;
}

.tca-mp-banner.is-info { background: rgba(124, 58, 237, 0.2); border: 1px solid rgba(167, 139, 250, 0.4); color: #ede9fe !important; }
.tca-mp-banner.is-success { background: rgba(5, 150, 105, 0.22); border: 1px solid rgba(52, 211, 153, 0.45); color: #d1fae5 !important; }
.tca-mp-banner.is-error { background: rgba(190, 18, 60, 0.25); border: 1px solid rgba(251, 113, 133, 0.5); color: #ffe4e6 !important; }
.tca-mp-banner.is-warn { background: rgba(217, 119, 6, 0.22); border: 1px solid rgba(251, 191, 36, 0.5); color: #fef3c7 !important; }

.tca-mp-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.48rem;
  margin-bottom: 0.8rem;
}

.tca-mp-btn,
.tca-mp-filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.88rem;
  border-radius: 0.7rem;
  border: 1px solid #7c3aed;
  background: linear-gradient(135deg, #6d28d9 0%, #4c1d95 100%);
  color: #ffffff !important;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.tca-mp-btn.is-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  border-color: #fde68a;
  color: #ffffff !important;
}

.tca-mp-btn.is-secondary,
.tca-mp-filter-pill {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(196, 181, 253, 0.28);
  color: #ede9fe !important;
}

.tca-mp-btn.is-success { background: #059669; border-color: #34d399; color: #ffffff !important; }
.tca-mp-btn.is-danger { background: #e11d48; border-color: #fda4af; color: #ffffff !important; }
.tca-mp-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.tca-mp-section-box {
  padding: 0.9rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(196, 181, 253, 0.18);
  background: rgba(255, 255, 255, 0.035);
  margin-bottom: 0.9rem;
}

html body .tca-mp-section-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 850;
  color: #ffffff !important;
}

.tca-mp-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.8rem, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.tca-mp-field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.tca-mp-field > span {
  font-size: 0.76rem;
  font-weight: 750;
  color: #d8b4fe !important;
}

.tca-mp-input,
.tca-mp-select {
  width: 100%;
  min-height: 44px;
  padding: 0.42rem 0.65rem;
  border-radius: 0.62rem;
  border: 1px solid rgba(196, 181, 253, 0.3);
  background: rgba(12, 8, 24, 0.85);
  color: #ffffff !important;
  font-size: 0.86rem;
}

.tca-mp-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 36px;
  min-width: 44px;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 750;
  color: #fde68a !important;
}

.tca-mp-check-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: #f59e0b;
  flex-shrink: 0;
}

.tca-mp-series-block {
  padding: 1rem;
  border-radius: 1.05rem;
  border: 1px solid rgba(196, 181, 253, 0.24);
  background: linear-gradient(180deg, rgba(28, 18, 52, 0.88) 0%, rgba(18, 11, 34, 0.94) 100%);
  margin-bottom: 0.95rem;
}

.tca-mp-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(196, 181, 253, 0.14);
  margin-bottom: 0.75rem;
}

.tca-mp-counter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fde68a !important;
  font-size: 0.8rem;
  font-weight: 850;
}

.tca-mp-order-alert {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.85rem;
  border: 1.5px solid rgba(167, 139, 250, 0.45);
  background: rgba(15, 9, 28, 0.72);
  margin: 0.55rem 0;
}

.tca-mp-thumb {
  width: 5rem;
  aspect-ratio: 63 / 88;
  border-radius: 0.48rem;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.45);
  padding: 0.16rem;
}

.tca-mp-mission-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin: 0.4rem 0;
}

.tca-mp-mission-step {
  padding: 0.26rem 0.52rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(196, 181, 253, 0.22);
  font-size: 0.74rem;
  color: #ede9fe;
}

.tca-mp-clean-list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.38rem;
}

.tca-mp-clean-list > li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(196, 181, 253, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

/* --- Cérémonie 3D de Retournement de Carte --- */
.tca-mp-flip-stage {
  display: grid;
  grid-template-columns: 7.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: radial-gradient(circle at 20% 50%, rgba(251, 191, 36, 0.2), transparent 60%),
              rgba(20, 11, 38, 0.92);
  border: 1.5px solid #fbbf24;
}

.tca-mp-flip-card {
  width: 7rem;
  aspect-ratio: 63 / 88;
  perspective: 900px;
  margin: 0 auto;
}

.tca-mp-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.tca-mp-flip-card.is-flipped .tca-mp-flip-inner {
  transform: rotateY(180deg);
}

.tca-mp-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 0.58rem;
  padding: 0.22rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.tca-mp-flip-face.is-back {
  background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
  border: 1.5px solid #fbbf24;
}

.tca-mp-flip-face.is-front {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #fde68a 0%, #ffffff 50%, #f59e0b 100%);
  border: 1.5px solid #d97706;
}

.tca-mp-flip-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0.4rem;
  display: block;
}

.tca-mp-mini-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.4rem, 1fr));
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.tca-mp-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.22rem;
  padding: 0.4rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(196, 181, 253, 0.18);
  font-size: 0.72rem;
}

.tca-mp-mini-card img {
  width: 52px;
  height: 72px;
  object-fit: contain;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .tca-mp-booster-fan img,
  .tca-mp-flip-inner {
    transition: none !important;
  }
}

@media (max-width: 760px) {
  .tca-mp-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .tca-mp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .tca-mp-studio-backdrop {
    padding: 0.75rem 0.5rem 2rem;
  }
  .tca-mp-market-embed,
  .tca-mp-ops-panel,
  .tca-mp-studio-dialog {
    padding: 0.8rem;
    border-radius: 0.95rem;
  }
  .tca-mp-grid-cards {
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  }
  .tca-mp-order-alert,
  .tca-mp-flip-stage {
    grid-template-columns: 1fr;
  }
}

/* Excellence Pass 0-Fix : contrastes WCAG 2.2 AA, fonds solides de secours, cibles >= 44px & marges 320px */
.tca-mp-market-embed,
.tca-mp-ops-panel,
.tca-mp-studio-dialog {
  background-color: #110b20 !important;
}
.tca-mp-market-embed {
  min-height: 340px;
}
.tca-mp-hero {
  background-color: #241244 !important;
}
.tca-mp-series-block,
.tca-mp-section-box,
.tca-mp-card-box,
.tca-mp-spot-btn,
.tca-mp-odds-item,
.tca-mp-stat,
.tca-mp-order-alert {
  background-color: #19102e !important;
}
html body .tca-mp-market-embed small,
html body .tca-mp-studio-dialog small,
html body .tca-mp-ops-panel small {
  color: #ede9fe !important;
  font-size: 0.78rem;
}
html body .tca-mp-odds-item.is-gold small,
html body .tca-mp-odds-item.is-gold strong {
  color: #fef08a !important;
}
.tca-mp-btn {
  background-color: #5b21b6;
  min-height: 44px !important;
  min-width: 44px !important;
}
.tca-mp-btn.is-gold {
  background-color: #fbbf24 !important;
  background-image: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%) !important;
  border-color: #fef08a !important;
  color: #1c1008 !important;
}
.tca-mp-btn.is-secondary,
.tca-mp-filter-pill {
  background-color: #23173d !important;
  color: #f5f3ff !important;
  min-height: 44px !important;
}
.tca-mp-btn.is-success {
  background-color: #047857 !important;
  background-image: none !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
}
.tca-mp-btn.is-danger {
  background-color: #be123c !important;
  background-image: none !important;
  border-color: #fda4af !important;
  color: #ffffff !important;
}
.tca-mp-input,
.tca-mp-select {
  min-height: 44px !important;
  font-size: 16px !important;
  background-color: #150d28 !important;
  color: #ffffff !important;
}
@media (max-width: 640px) {
  .tca-mp-market-embed {
    width: calc(100% - 16px) !important;
    margin-inline: auto !important;
    padding: 0.9rem !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tca-mp-market-embed *,
  .tca-mp-ops-panel *,
  .tca-mp-studio-dialog * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* === Cycle 1 : Cadrage Collectionneur & Clarté Paliers (Courtyard / Arena Club / Whatnot) === */
.tca-mp-card-art {
  aspect-ratio: 5 / 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0e091b !important;
  background-image: radial-gradient(circle at 50% 24%, rgba(251, 191, 36, 0.14), #0e091b 76%) !important;
  border-radius: 0.65rem;
  padding: 0.35rem;
}
.tca-mp-card-art img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 0.42rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}
.tca-mp-odds-strip,
.tca-mp-counter-pill,
.tca-mp-spot-btn {
  font-variant-numeric: tabular-nums;
}
.tca-mp-card-box.is-chase {
  border: 1.5px solid rgba(251, 191, 36, 0.58) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(254, 240, 138, 0.18);
}

/* === Cycle 3 : Anneau focus doré haute visibilité sur fond sombre Custom Packs === */
.tca-mp-market-embed a:focus-visible,
.tca-mp-market-embed button:focus-visible,
.tca-mp-market-embed summary:focus-visible,
.tca-mp-ops-panel button:focus-visible,
.tca-mp-ops-panel summary:focus-visible,
.tca-mp-studio-dialog button:focus-visible {
  outline: 3px solid #fde68a !important;
  outline-offset: 2px !important;
}
