/* =====================================================================
   Baccara PRINCE — Thème "PREMIUM Noir & Or & Rouge"
   Palette :
     🖤 NOIR PROFOND  → fonds principaux
     🥇 OR VIF        → titres, bordures, éléments importants
     🔴 ROUGE VIF     → boutons, alertes, éléments actifs
     🤍 BLANC         → textes principaux
     ⬜ GRIS CLAIR    → textes secondaires
   Typographie : Cormorant Garamond (titres) · Manrope (corps)
   Note : les noms de variables (--emerald-*, --gold-*) sont conservés
   pour ne rien casser dans la structure ; seules leurs valeurs changent.
   ===================================================================== */

:root {
  /* "emerald-*" remappé vers ROUGE VIF (accent action / boutons / alertes) */
  --emerald-950: #1a0000;
  --emerald-900: #3a0a0a;
  --emerald-800: #5c1010;
  --emerald-700: #8a1414;
  --emerald-600: #c81919;
  --emerald-500: #ef2020;   /* rouge vif principal */
  --emerald-400: #ff3838;   /* rouge lumineux — accents actifs */

  /* "gold-*" remappé vers OR VIF (titres, bordures, badges importants) */
  --gold-100: #fff8dc;
  --gold-300: #f5c542;      /* or clair — titres et texte doré */
  --gold-400: #ffd447;      /* or brillant — accents */
  --gold-500: #ffc107;      /* or vif — bordures importantes */
  --gold-600: #d4a017;      /* or profond */
  --gold-700: #8b6914;      /* or foncé */

  /* "jade-*" = VERT (utilisé pour les carrés WIN de la cadence récente) */
  --jade-600: #0f6b2c;
  --jade-500: #16a34a;      /* vert vif — carré WIN cadence récente */
  --jade-400: #22c55e;      /* vert lumineux — accents */

  /* "burgundy-*" reste dans la gamme rouge (boutons danger) */
  --burgundy-700: #5a0a0a;
  --burgundy-600: #8a1414;
  --burgundy-500: #c81919;
  --burgundy-400: #ef2020;

  /* Textes : blanc pur pour titres, gris clair pour secondaire */
  --ivory: #ffffff;
  --parchment: #e8e8e8;
  --smoke: #b0b0b0;

  /* Fonds NOIR PROFOND avec dégradés subtils */
  --night-950: #000000;      /* noir absolu */
  --night-900: #0a0a0a;      /* noir profond */
  --night-800: #141414;      /* noir cartes */
  --night-700: #1e1e1e;      /* noir légèrement clair */
  --night-600: #2a2a2a;      /* noir surélevé */

  /* Sémantiques — fonds noirs, bordures OR, accents rouges */
  --bg-app: radial-gradient(ellipse at top, #1a1005 0%, #0a0503 55%, #000000 100%);
  --bg-card: linear-gradient(160deg, rgba(20, 20, 20, 0.95) 0%, rgba(10, 10, 10, 0.98) 100%);
  --bg-card-hover: linear-gradient(160deg, rgba(30, 25, 15, 0.95) 0%, rgba(15, 12, 8, 0.98) 100%);
  --border-gold: rgba(255, 193, 7, 0.4);
  --border-gold-strong: rgba(255, 193, 7, 0.75);
  --border-soft: rgba(255, 255, 255, 0.1);
  --text-primary: var(--ivory);
  --text-muted: rgba(255, 255, 255, 0.72);
  --text-dim: rgba(255, 255, 255, 0.5);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 193, 7, 0.12) inset;
  --shadow-gold: 0 12px 32px -8px rgba(255, 193, 7, 0.45);
  --shadow-red: 0 12px 32px -8px rgba(239, 32, 32, 0.55);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
}

body {
  font-family: 'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  background: var(--bg-app);
  background-attachment: fixed;
  line-height: 1.55;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Motif "feutre de table" subtil en overlay — touches d'or */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 193, 7, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(239, 32, 32, 0.05) 0%, transparent 45%),
    repeating-linear-gradient(45deg, transparent 0 2px, rgba(255, 255, 255, 0.012) 2px 4px);
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  background: linear-gradient(135deg, rgba(20, 15, 5, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
  border: 1.5px solid var(--border-gold-strong);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lg), 0 0 30px -10px rgba(255, 193, 7, 0.2);
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 193, 7, 0.18) 50%, transparent 60%);
  pointer-events: none;
}
.header-inner {
  position: relative;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand-crest {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-400) 0%, var(--gold-600) 60%, var(--gold-700) 100%);
  color: var(--night-950);
  display: grid;
  place-items: center;
  font-size: 28px;
  box-shadow:
    0 0 0 3px var(--night-950),
    0 0 0 4px var(--gold-500),
    var(--shadow-gold);
  flex-shrink: 0;
}
.brand-text h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--ivory);
  line-height: 1;
}
.brand-text h1 .accent {
  background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-600) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}
.brand-text .version {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-400);
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.header-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.stat {
  min-width: 88px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 10px;
  color: var(--gold-300);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ivory);
  font-variant-numeric: tabular-nums;
}
.stat-alpha { border-color: rgba(255, 193, 7, 0.5); }
.stat-alpha .stat-value { color: var(--gold-400); }
.stat-beta  { border-color: rgba(239, 32, 32, 0.5); }
.stat-beta  .stat-value { color: var(--emerald-400); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { border-color: var(--border-gold); }

.card-cta {
  padding: 22px;
  text-align: center;
  background: linear-gradient(135deg, rgba(30, 20, 5, 0.85) 0%, rgba(10, 5, 0, 0.95) 100%);
  border: 1.5px solid var(--border-gold-strong);
  box-shadow: var(--shadow-lg), 0 0 25px -8px rgba(255, 193, 7, 0.25);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-gold);
  flex-wrap: wrap;
}
.card-head h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--gold-300);
  display: flex;
  align-items: center;
  gap: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.card-head h2 i { color: var(--gold-400); }

.badge {
  background: rgba(255, 193, 7, 0.15);
  color: var(--gold-300);
  border: 1px solid var(--border-gold);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ============================================================
   LIVE FEED
   ============================================================ */
.live-feed .live-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}
.live-dot {
  font-size: 22px;
  line-height: 1;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.live-dot.off { color: var(--smoke); text-shadow: none; }
.live-dot.on  {
  color: var(--emerald-400);
  text-shadow: 0 0 16px rgba(239, 32, 32, 0.85);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.live-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--parchment);
  margin-bottom: 12px;
}
.live-info code {
  background: rgba(0, 0, 0, 0.6);
  color: var(--gold-300);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  border: 1px solid var(--border-gold);
}
.live-info strong { color: var(--gold-400); font-variant-numeric: tabular-nums; }
.channel-picker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--gold-300);
  font-weight: 700;
}
.channel-picker select {
  min-height: 36px;
  max-width: 100%;
  padding: 7px 32px 7px 10px;
  color: var(--parchment);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  font: inherit;
}
.channel-picker select:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 2px;
}
.channel-help {
  margin: -4px 0 12px;
  color: var(--smoke);
  font-size: 12px;
}

.live-preview {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  max-height: 200px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  color: var(--parchment);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ============================================================
   PREDICTION CARD
   ============================================================ */
.prediction-card {
  overflow: hidden;
}
.system-final {
  background:
    radial-gradient(ellipse at top right, rgba(255, 193, 7, 0.15) 0%, transparent 50%),
    linear-gradient(160deg, rgba(25, 20, 5, 0.9) 0%, rgba(5, 3, 0, 0.98) 100%);
  border: 2px solid var(--border-gold-strong);
  box-shadow: var(--shadow-lg), 0 0 40px -10px rgba(255, 193, 7, 0.3);
}
.system-alpha {
  border-color: rgba(255, 193, 7, 0.4);
  background: linear-gradient(160deg, rgba(30, 22, 5, 0.6) 0%, rgba(0, 0, 0, 0.95) 100%);
}
.system-beta {
  border-color: rgba(239, 32, 32, 0.4);
  background: linear-gradient(160deg, rgba(40, 10, 10, 0.5) 0%, rgba(10, 5, 5, 0.95) 100%);
}

.prediction-body {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 1.5fr;
  gap: 22px;
  align-items: center;
}
@media (max-width: 720px) {
  .prediction-body { grid-template-columns: 1fr; }
}

.prediction-outcome {
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.08) 0%, rgba(0,0,0,0.7) 70%);
  border: 1.5px solid var(--border-gold-strong);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 170px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}
.prediction-outcome.pop { transform: scale(1.05); }
.prediction-outcome::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), var(--glow, transparent) 0%, transparent 60%);
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.outcome-symbol {
  font-size: 72px;
  line-height: 1;
  font-weight: 700;
  font-family: 'Cormorant Garamond', Georgia, serif;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8), 0 0 30px currentColor;
  position: relative;
  z-index: 1;
}
.outcome-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

/* Couleurs des issues — bien visibles */
.outcome-player .outcome-symbol,
.outcome-player .outcome-label { color: var(--emerald-400); }
.outcome-player { --glow: rgba(239, 32, 32, 0.4); border-color: rgba(239, 32, 32, 0.7); }

.outcome-banker .outcome-symbol,
.outcome-banker .outcome-label { color: var(--gold-400); }
.outcome-banker { --glow: rgba(255, 193, 7, 0.4); border-color: rgba(255, 193, 7, 0.7); }

.outcome-tie .outcome-symbol,
.outcome-tie .outcome-label { color: var(--ivory); }
.outcome-tie { --glow: rgba(255, 255, 255, 0.25); border-color: rgba(255, 255, 255, 0.5); }

/* Colonne pour valeurs textuelles */
.prediction-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.meta-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.meta-label {
  color: var(--gold-300);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.meta-value {
  color: var(--ivory);
  font-size: 13px;
  word-break: break-word;
  font-weight: 500;
}

/* Confidence bar */
.confidence-bar {
  position: relative;
  height: 22px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  overflow: hidden;
  min-width: 160px;
}
.confidence-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald-500) 0%, var(--gold-500) 60%, var(--gold-400) 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.45);
}
.confidence-text {
  position: relative;
  z-index: 1;
  display: block;
  text-align: center;
  line-height: 22px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ivory);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  font-variant-numeric: tabular-nums;
}

/* Tags */
.tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.tag-stable      { background: rgba(255, 193, 7, 0.2);  color: var(--gold-300); border: 1px solid rgba(255, 193, 7, 0.5); }
.tag-safe        { background: rgba(255, 193, 7, 0.18); color: var(--gold-400); border: 1px solid rgba(255, 193, 7, 0.5); }
.tag-warn        { background: rgba(239, 32, 32, 0.2);  color: #ffb0b0;         border: 1px solid rgba(239, 32, 32, 0.6); }
.tag-aggressive  { background: rgba(239, 32, 32, 0.25); color: #ffb0b0;         border: 1px solid rgba(239, 32, 32, 0.6); }

.sys-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--parchment);
  border: 1px solid var(--border-soft);
}
.sys-tag-alpha  { background: rgba(255, 193, 7, 0.18);  color: var(--gold-400); border-color: rgba(255, 193, 7, 0.55); }
.sys-tag-beta   { background: rgba(239, 32, 32, 0.18);  color: var(--emerald-400); border-color: rgba(239, 32, 32, 0.55); }
.sys-tag-final  { background: linear-gradient(90deg, rgba(255, 193, 7, 0.25), rgba(239, 32, 32, 0.25)); color: var(--gold-300); border-color: rgba(255, 193, 7, 0.6); }

/* Target selector */
.target-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-gold);
}
.target-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold-300);
}
.target-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
  font-size: 13px;
  color: var(--ivory);
}
.target-radio:hover { background: rgba(255, 193, 7, 0.1); }
.target-radio input { accent-color: var(--gold-500); cursor: pointer; }
.target-radio i { color: var(--gold-400); font-size: 12px; }

.prediction-actions { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-gold); }
.validate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--parchment);
}

.dual-systems {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 900px) {
  .dual-systems { grid-template-columns: 1fr; }
}

/* ============================================================
   BUTTONS — ROUGE VIF pour actions principales
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
}

/* Bouton PRIMAIRE : ROUGE VIF — le plus important */
.btn-primary {
  background: linear-gradient(135deg, var(--emerald-500) 0%, var(--emerald-700) 100%);
  color: var(--ivory);
  border: 1.5px solid var(--emerald-400);
  box-shadow: var(--shadow-red);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--emerald-400) 0%, var(--emerald-600) 100%);
  box-shadow: 0 16px 40px -8px rgba(239, 32, 32, 0.65);
  border-color: var(--emerald-400);
}
.btn-lg.btn-primary::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--gold-400);
  border-radius: 50%;
  margin-right: 8px;
  opacity: 0.9;
  box-shadow: 0 0 8px var(--gold-400);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ivory);
  border: 1px solid var(--border-gold);
}
.btn-ghost:hover { background: rgba(255, 193, 7, 0.1); border-color: var(--gold-500); }

/* SUCCESS = ROUGE VIF (car "emerald" est mappé rouge) */
.btn-success {
  background: linear-gradient(135deg, var(--emerald-500) 0%, var(--emerald-700) 100%);
  border: 1.5px solid var(--emerald-400);
  color: var(--ivory);
  box-shadow: var(--shadow-red);
}
.btn-success:hover { background: linear-gradient(135deg, var(--emerald-400) 0%, var(--emerald-600) 100%); }

.btn-danger {
  background: linear-gradient(135deg, var(--burgundy-500) 0%, var(--burgundy-700) 100%);
  border: 1.5px solid var(--burgundy-400);
  color: var(--ivory);
  box-shadow: var(--shadow-red);
}
.btn-danger:hover { background: linear-gradient(135deg, var(--burgundy-400) 0%, var(--burgundy-600) 100%); }

.row-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

/* ============================================================
   RECENT HISTORY
   ============================================================ */
.recent-history {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.hand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: transform 0.15s ease;
  color: var(--ivory);
}
.hand-chip:hover { transform: translateY(-2px); }
.hand-chip.ok    { border-left-color: var(--gold-500); background: rgba(30, 22, 5, 0.5); }
.hand-chip.ko    { border-left-color: var(--emerald-500); background: rgba(40, 10, 10, 0.5); }
.hand-chip.mixed { border-left-color: var(--gold-400); background: rgba(30, 22, 5, 0.35); }

.hand-chip.outcome-player  { border-color: rgba(239, 32, 32, 0.5); }
.hand-chip.outcome-banker  { border-color: rgba(255, 193, 7, 0.5); }
.hand-chip.outcome-tie     { border-color: rgba(255, 255, 255, 0.4); }

.hand-id {
  color: var(--gold-300);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
}
.hand-score {
  color: var(--ivory);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.hand-winner {
  font-weight: 800;
  font-size: 14px;
  padding: 0 4px;
}
.hand-winner.outcome-player { color: var(--emerald-400); }
.hand-winner.outcome-banker { color: var(--gold-400); }
.hand-winner.outcome-tie    { color: var(--ivory); }
.hand-badges { display: inline-flex; gap: 3px; }

.mini-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}
.mini-badge.ok { background: rgba(255, 193, 7, 0.3); color: var(--gold-300); border: 1px solid rgba(255, 193, 7, 0.6); }
.mini-badge.ko { background: rgba(239, 32, 32, 0.3); color: #ffb0b0; border: 1px solid rgba(239, 32, 32, 0.6); }

/* ============================================================
   MANUAL INPUT
   ============================================================ */
.manual-input {
  width: 100%;
  min-height: 120px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--ivory);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
}
.manual-input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}
.manual-input::placeholder { color: var(--text-dim); }

.muted { color: var(--parchment); }
.small { font-size: 11.5px; }

/* ============================================================
   ACCORDION
   ============================================================ */
.acc {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.acc:hover { border-color: var(--border-gold); }
.acc summary {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--ivory);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::before {
  content: '▸';
  color: var(--gold-400);
  font-size: 12px;
  transition: transform 0.2s ease;
}
.acc[open] > summary::before { transform: rotate(90deg); }
.acc summary:hover { background: rgba(255, 193, 7, 0.06); }
.acc summary i { color: var(--gold-400); }
.acc-body {
  padding: 18px 20px;
  border-top: 1px solid var(--border-gold);
  background: rgba(0, 0, 0, 0.3);
}

.dual-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 900px) {
  .dual-detail { grid-template-columns: 1fr; }
}
.dual-col { min-width: 0; }
.dual-h {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-gold);
}
.dual-h-alpha { color: var(--gold-400); border-bottom-color: rgba(255, 193, 7, 0.4); }
.dual-h-beta  { color: var(--emerald-400); border-bottom-color: rgba(239, 32, 32, 0.4); }

/* ============================================================
   TABLES
   ============================================================ */
table.simple {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.simple th,
table.simple td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  color: var(--ivory);
}
table.simple th {
  color: var(--gold-300);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--border-gold);
}
table.simple tbody tr:hover { background: rgba(255, 193, 7, 0.05); }
table.simple td.outcome-player,
table.simple td .outcome-player  { color: var(--emerald-400); font-weight: 700; }
table.simple td.outcome-banker,
table.simple td .outcome-banker  { color: var(--gold-400); font-weight: 700; }
table.simple td.outcome-tie,
table.simple td .outcome-tie     { color: var(--ivory); font-weight: 700; }

table.simple tr.row-outcome-player td:nth-child(4) { color: var(--emerald-400); font-weight: 800; }
table.simple tr.row-outcome-banker td:nth-child(4) { color: var(--gold-400); font-weight: 800; }
table.simple tr.row-outcome-tie    td:nth-child(4) { color: var(--ivory); font-weight: 800; }

/* ============================================================
   KEY-VALUE GRID
   ============================================================ */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.kv .k { color: var(--gold-300); font-weight: 600; }
.kv .v { color: var(--ivory); font-weight: 700; font-variant-numeric: tabular-nums; }
.kv .v.outcome-player { color: var(--emerald-400); }
.kv .v.outcome-banker { color: var(--gold-400); }
.kv .v.outcome-tie    { color: var(--ivory); }

/* ============================================================
   BIG ROAD
   ============================================================ */
.bigroad {
  display: grid;
  grid-template-columns: repeat(auto-fill, 26px);
  gap: 3px;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
}
.br-cell {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--ivory);
  border: 2px solid transparent;
  transition: transform 0.15s ease;
}
.br-cell:hover { transform: scale(1.15); z-index: 2; }
.br-cell.outcome-player { background: radial-gradient(circle at 30% 30%, var(--emerald-500), var(--emerald-800)); border-color: var(--emerald-400); }
.br-cell.outcome-banker { background: radial-gradient(circle at 30% 30%, var(--gold-500), var(--gold-700));       border-color: var(--gold-400); color: var(--night-950); }
.br-cell.outcome-tie    { background: radial-gradient(circle at 30% 30%, #d4d4d8, #52525b);                       border-color: #ffffff; }

/* ============================================================
   AI LOGS
   ============================================================ */
.ai-logs {
  max-height: 260px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11.5px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.ai-logs > div {
  padding: 2px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
  word-break: break-word;
}
.ai-logs .info { color: var(--parchment); }
.ai-logs .ok   { color: var(--gold-400); }
.ai-logs .ko   { color: #ffb0b0; }
.ai-logs .warn { color: var(--gold-300); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  padding: 20px 8px 4px;
  color: var(--parchment);
  font-size: 11.5px;
  letter-spacing: 0.6px;
}
.footer strong { color: var(--gold-400); }

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.5); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-600), var(--gold-700));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gold-500), var(--gold-600));
  background-clip: padding-box;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  #root { padding: 16px 12px 32px; }
  .header { padding: 18px 18px; }
  .brand-text h1 { font-size: 26px; }
  .brand-crest { width: 52px; height: 52px; font-size: 22px; }
  .outcome-symbol { font-size: 56px; }
  .outcome-label { font-size: 13px; letter-spacing: 2px; }
  .card { padding: 16px 16px; }
  .card-head h2 { font-size: 19px; }
  .btn-lg { padding: 14px 24px; font-size: 14px; letter-spacing: 2px; }
  .meta-row { grid-template-columns: 90px 1fr; }
  .hand-chip { font-size: 11px; padding: 5px 8px; }
  .hand-winner { font-size: 13px; }
}

/* ============================================================
   CARTES PLIABLES (collapsibles)
   ============================================================ */
.collapsible .collapsible-head {
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}
.collapsible .collapsible-head:hover {
  background: rgba(255, 193, 7, 0.05);
  border-radius: var(--radius-md);
}
.collapsible .collapsible-head:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}
.collapsible .head-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.collapse-chevron {
  color: var(--gold-400);
  font-size: 14px;
  transition: transform 0.28s ease;
}
.collapsible.collapsed .collapse-chevron {
  transform: rotate(-90deg);
}
.collapsible .collapsible-body {
  overflow: hidden;
  max-height: 3000px;
  transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.25s ease, padding-top 0.25s ease;
  opacity: 1;
  margin-top: 14px;
}
.collapsible.collapsed .collapsible-body {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  pointer-events: none;
}

/* ============================================================
   BACKTEST CHRONOLOGIQUE
   ============================================================ */
.backtest-controls .bt-label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 8px;
  font-weight: 700;
}
.bt-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bt-input {
  flex: 0 0 120px;
  background: rgba(0,0,0,0.6);
  border: 1.5px solid var(--border-gold);
  color: var(--ivory);
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.bt-input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2);
}
.bt-quicks {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bt-quick {
  min-width: 48px;
}

.bt-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.bt-stat {
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gold);
  background: rgba(0,0,0,0.5);
  text-align: center;
}
.bt-stat-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 6px;
  font-weight: 700;
}
.bt-stat-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.bt-stat-win  .bt-stat-value { color: var(--gold-400); }
.bt-stat-loss .bt-stat-value { color: var(--emerald-400); }
.bt-stat-rate .bt-stat-value { color: var(--gold-300); }
.bt-stat-streak .bt-stat-value { color: var(--ivory); }

.bt-bar {
  height: 10px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
  position: relative;
}
.bt-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--emerald-500) 0%, var(--gold-500) 100%);
  transition: width 0.4s ease;
}

.bt-verdict {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-gold-strong);
  text-align: center;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 13px;
}
.bt-verdict.good { background: rgba(255, 193, 7, 0.18); color: var(--gold-300); border-color: rgba(255, 193, 7, 0.6); }
.bt-verdict.mid  { background: rgba(255, 193, 7, 0.12); color: var(--gold-400); border-color: rgba(255, 193, 7, 0.5); }
.bt-verdict.bad  { background: rgba(239, 32, 32, 0.2);  color: #ffb0b0; border-color: rgba(239, 32, 32, 0.6); }

.bt-table-wrap {
  margin-top: 16px;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  background: rgba(0,0,0,0.4);
}
.bt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bt-table thead th {
  position: sticky;
  top: 0;
  background: rgba(20, 15, 5, 0.98);
  color: var(--gold-300);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1.5px solid var(--gold-500);
  z-index: 1;
  font-weight: 800;
}
.bt-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
  color: var(--ivory);
}
.bt-table tbody tr:last-child td { border-bottom: none; }
.bt-table tbody tr.bt-win  { background: rgba(255, 193, 7, 0.08); }
.bt-table tbody tr.bt-loss { background: rgba(239, 32, 32, 0.08); }
.bt-cell-num { font-family: monospace; color: var(--gold-300); }
.bt-cell-suit { font-size: 18px; letter-spacing: 2px; }
.bt-cell-real { font-family: monospace; color: var(--parchment); font-size: 12px; }
.bt-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 4px;
}
.bt-tag-win  { background: rgba(255, 193, 7, 0.25);  color: var(--gold-300); border: 1px solid rgba(255, 193, 7, 0.5); }
.bt-tag-loss { background: rgba(239, 32, 32, 0.25);  color: #ffb0b0; border: 1px solid rgba(239, 32, 32, 0.5); }

/* Responsive: 2 col au lieu de 4 en mobile */
@media (max-width: 600px) {
  .bt-summary { grid-template-columns: repeat(2, 1fr); }
  .bt-stat-value { font-size: 26px; }
  .bt-input { flex: 0 0 90px; font-size: 18px; }
  .bt-table { font-size: 12px; }
  .bt-table thead th { padding: 8px 6px; }
  .bt-table tbody td { padding: 6px 6px; }
}

/* ═════════════════════════════════════════════════════════════════
   PARITÉ P1 — Ajouts spécifiques (tags OUI/NON, composants, live)
   ═════════════════════════════════════════════════════════════════ */

.brand-subtitle {
  font-size: 13px;
  color: var(--gold-300);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.95;
  font-weight: 600;
}

/* Tags OUI (or/vert positif) / NON (rouge) */
.tag-oui {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 193, 7, 0.22);
  color: var(--gold-300);
  border: 1px solid rgba(255, 193, 7, 0.55);
}
.tag-non {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(239, 32, 32, 0.22);
  color: #ffb0b0;
  border: 1px solid rgba(239, 32, 32, 0.55);
}

/* Prediction outcome — variantes OUI / NON / abstain */
.prediction-outcome.oui {
  color: var(--gold-400);
  text-shadow: 0 0 24px rgba(255, 193, 7, 0.6);
}
.prediction-outcome.non {
  color: var(--emerald-400);
  text-shadow: 0 0 24px rgba(239, 32, 32, 0.6);
}
.prediction-outcome.abstain {
  color: var(--parchment);
  opacity: 0.85;
}

.prediction-meta {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--parchment);
  font-family: 'Manrope', sans-serif;
  letter-spacing: 0.4px;
}

/* Grille des composantes du blend */
.pred-components {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
}
.pred-comp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(255, 193, 7, 0.15);
}
.pc-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gold-300);
  text-transform: uppercase;
}
.pc-value {
  font-family: 'Manrope', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--ivory);
}
.pred-comp-final {
  grid-column: 1 / -1;
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.45);
}
.pred-comp-final .pc-value {
  color: var(--gold-300);
  font-size: 16px;
}
@media (max-width: 600px) {
  .pred-components { grid-template-columns: repeat(2, 1fr); }
  .pred-comp-final { grid-column: 1 / -1; }
}

/* Live feed — message parsé */
.live-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.5);
  border-left: 3px solid var(--gold-500);
  border-radius: 6px;
}
.live-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.live-msg-body {
  display: flex;
  gap: 10px;
  color: var(--ivory);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
}
.live-msg-sep { color: var(--gold-400); }
.live-msg-side b { color: var(--gold-300); font-size: 15px; }
.live-msg-raw {
  margin-top: 4px;
  font-size: 12px;
  color: var(--parchment);
  word-break: break-all;
}
.live-msg-raw code {
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold-300);
}

/* Backtest — verdict variantes + rows */
.bt-verdict.v-good { background: rgba(255, 193, 7, 0.18); color: var(--gold-300); border-color: rgba(255, 193, 7, 0.55); }
.bt-verdict.v-ok   { background: rgba(255, 193, 7, 0.12); color: var(--gold-400); border-color: rgba(255, 193, 7, 0.45); }
.bt-verdict.v-bad  { background: rgba(239, 32, 32, 0.2);  color: #ffb0b0;         border-color: rgba(239, 32, 32, 0.6); }

.bt-table tbody tr.row-ok  { background: rgba(255, 193, 7, 0.08); }
.bt-table tbody tr.row-ko  { background: rgba(239, 32, 32, 0.08); }

.bt-bar-fill.good { background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); }
.bt-bar-fill.ok   { background: linear-gradient(90deg, var(--gold-600), var(--gold-300)); }
.bt-bar-fill.bad  { background: linear-gradient(90deg, var(--emerald-600), var(--emerald-400)); }

/* Footer disclaimer */
.footer-disclaimer {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 12px;
  line-height: 1.5;
}

/* Live dot états */
.live-dot.on   { color: var(--emerald-400); text-shadow: 0 0 12px rgba(239, 32, 32, 0.85); }
.live-dot.wait { color: var(--gold-400);    text-shadow: 0 0 12px rgba(255, 193, 7, 0.7); }
.live-dot.off  { color: #6b7280; }

/* PHASE 4 — verdict direct P1 */
.prediction-verdict{display:flex;align-items:center;gap:10px;margin:12px 0;padding:12px 14px;border-radius:12px;border:1px solid var(--border,#333);background:rgba(255,255,255,.03)}
.prediction-verdict i{font-size:24px}.prediction-verdict-title{font-weight:800;font-size:18px;letter-spacing:.5px}.prediction-verdict-sub{margin-top:2px}
.prediction-verdict-win{border-color:rgba(34,197,94,.65);background:rgba(34,197,94,.10)}.prediction-verdict-win i,.prediction-verdict-win .prediction-verdict-title{color:#22c55e}
.prediction-verdict-loss{border-color:rgba(239,68,68,.65);background:rgba(239,68,68,.10)}.prediction-verdict-loss i,.prediction-verdict-loss .prediction-verdict-title{color:#ef4444}
.prediction-verdict-pending{border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.08)}.prediction-verdict-pending i,.prediction-verdict-pending .prediction-verdict-title{color:#f59e0b}

/* =====================================================================
   🎯 CONTRÔLE DES MOMENTS + ÉTAT DU SYSTÈME (portés de Baccara QUEEN)
   ===================================================================== */

/* =====================================================================
   ÉTAT DU SYSTÈME
   ===================================================================== */
.state-controls { display: flex; flex-direction: column; gap: 10px; }

.state-verdict-wrap {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }

.state-verdict {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-gold);
  background: linear-gradient(160deg, rgba(0,0,0,0.35), rgba(0,0,0,0.15));
  position: relative;
  overflow: hidden;
}
.state-verdict::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}
.state-verdict-good::before { background: radial-gradient(circle at 30% 50%, rgba(16,185,129,0.45), transparent 65%); }
.state-verdict-bad::before  { background: radial-gradient(circle at 30% 50%, rgba(220,38,38,0.45),  transparent 65%); }
.state-verdict-neutral::before { background: radial-gradient(circle at 30% 50%, rgba(245,158,11,0.35), transparent 65%); }

.state-verdict-good    { border-color: rgba(16, 185, 129, 0.55); box-shadow: 0 0 22px rgba(16,185,129,0.15); }
.state-verdict-bad     { border-color: rgba(220, 38, 38, 0.55);  box-shadow: 0 0 22px rgba(220,38,38,0.18); }
.state-verdict-neutral { border-color: rgba(245, 158, 11, 0.5);  box-shadow: 0 0 22px rgba(245,158,11,0.12); }

.state-verdict > * { position: relative; z-index: 1; }

.state-verdict-icon {
  width: 74px; height: 74px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  background: rgba(0,0,0,0.35);
  border: 2px solid currentColor;
  flex-shrink: 0;
}
.state-verdict-good    .state-verdict-icon { color: var(--jade-400); }
.state-verdict-bad     .state-verdict-icon { color: #fca5a5; }
.state-verdict-neutral .state-verdict-icon { color: var(--gold-300); }

.state-verdict-text { min-width: 0; }
.state-verdict-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 6px;
}
.state-verdict-good    .state-verdict-title { color: var(--jade-400); }
.state-verdict-bad     .state-verdict-title { color: #fca5a5; }
.state-verdict-neutral .state-verdict-title { color: var(--gold-300); }
.state-verdict-sub { color: var(--text-muted); font-size: 13px; line-height: 1.4; }

.state-verdict-score { text-align: center; flex-shrink: 0; }
.state-score-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-300);
  text-shadow: 0 0 18px rgba(251,191,36,0.35);
}
.state-score-label {
  font-size: 10px; letter-spacing: 1.5px;
  color: var(--text-dim); text-transform: uppercase;
  margin-top: 4px;
}

.state-recommendation {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border-left: 3px solid var(--gold-500);
  background: rgba(0,0,0,0.3);
  align-items: flex-start;
}
.state-reco-good { border-left-color: var(--jade-500); background: rgba(6, 78, 59, 0.28); }
.state-reco-bad  { border-left-color: var(--burgundy-500); background: rgba(127, 29, 29, 0.28); }
.state-reco-neutral { border-left-color: var(--gold-500); background: rgba(180, 83, 9, 0.18); }

.state-reco-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4);
  font-size: 16px;
  flex-shrink: 0;
}
.state-reco-good    .state-reco-icon { color: var(--jade-400); }
.state-reco-bad     .state-reco-icon { color: #fca5a5; }
.state-reco-neutral .state-reco-icon { color: var(--gold-300); }

.state-reco-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--ivory);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.state-reco-text { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.state-reco-body { min-width: 0; }

.state-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.state-metric {
  background: rgba(0,0,0,0.28);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: transform 0.15s ease;
}
.state-metric:hover { transform: translateY(-2px); }
.state-metric-good    { border-color: rgba(16, 185, 129, 0.45); box-shadow: inset 0 0 0 1px rgba(16,185,129,0.1); }
.state-metric-bad     { border-color: rgba(220, 38, 38, 0.45);  box-shadow: inset 0 0 0 1px rgba(220,38,38,0.1); }
.state-metric-neutral { border-color: rgba(245, 158, 11, 0.4);  box-shadow: inset 0 0 0 1px rgba(245,158,11,0.1); }

.state-metric-label {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.state-metric-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ivory);
  line-height: 1;
}
.state-metric-good    .state-metric-value { color: var(--jade-400); }
.state-metric-bad     .state-metric-value { color: #fca5a5; }
.state-metric-neutral .state-metric-value { color: var(--gold-300); }
.state-metric-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: monospace;
}

.state-signals-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  color: var(--gold-300);
  letter-spacing: 1.2px;
  margin: 6px 0 10px;
  text-transform: uppercase;
}
.state-signals {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.state-signal {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.28);
  border-left: 3px solid transparent;
  font-size: 13px;
  color: var(--ivory);
}
.state-signal i { flex-shrink: 0; font-size: 14px; }
.state-signal-good { border-left-color: var(--jade-500); }
.state-signal-good i { color: var(--jade-400); }
.state-signal-bad  { border-left-color: var(--burgundy-500); }
.state-signal-bad i  { color: #fca5a5; }
.state-signal-mid  { border-left-color: var(--gold-500); }
.state-signal-mid i  { color: var(--gold-300); }

.state-trend-wrap { margin-top: 4px; }
.state-trend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px;
  background: rgba(0,0,0,0.30);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  min-height: 40px;
}
.trend-dot {
  width: 14px; height: 14px;
  border-radius: 3px;
  display: inline-block;
  cursor: help;
  transition: transform 0.15s;
}
.trend-dot:hover { transform: scale(1.4); z-index: 2; }
.trend-win  { background: var(--jade-500); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.trend-loss { background: var(--burgundy-500); box-shadow: 0 0 6px rgba(220,38,38,0.5); }

.state-trend-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  align-items: center;
  flex-wrap: wrap;
}
.state-trend-legend .dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.state-trend-legend .dot-win  { background: var(--jade-500); }
.state-trend-legend .dot-loss { background: var(--burgundy-500); }

@media (max-width: 640px) {
  .state-verdict {
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon text" "score score";
    gap: 14px;
    padding: 18px;
  }
  .state-verdict-icon { grid-area: icon; width: 56px; height: 56px; font-size: 24px; }
  .state-verdict-text { grid-area: text; }
  .state-verdict-score { grid-area: score; text-align: left; padding-top: 6px; border-top: 1px solid var(--border-soft); }
  .state-verdict-score .state-score-value { font-size: 30px; }
  .state-verdict-title { font-size: 22px; }
  .state-metrics { grid-template-columns: repeat(2, 1fr); }
  .state-metric-value { font-size: 18px; }
}

/* =====================================================================
   MINI-WIDGET "ÉTAT DU SYSTÈME" — carte compacte au-dessus des prédictions
   ===================================================================== */
.state-mini-card {
  padding: 14px 18px !important;
}

/* Variante STANDALONE (V3) : le widget est maintenant DANS SA PROPRE
   carte "État du système", placée juste après la Prédiction finale.
   Il s'affiche pleine largeur avec un rendu plus généreux. */
.state-mini.state-mini--standalone {
  padding: 16px 20px;
  gap: 12px;
  min-height: 0;
}
.state-mini.state-mini--standalone .state-mini-body {
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}
.state-mini.state-mini--standalone .state-mini-icon {
  width: 56px; height: 56px;
  font-size: 24px;
  border-width: 2px;
}
.state-mini.state-mini--standalone .state-mini-verdict {
  font-size: 22px;
  letter-spacing: 1.6px;
}
.state-mini.state-mini--standalone .state-mini-sub { font-size: 12px; }
.state-mini.state-mini--standalone .state-mini-score-val { font-size: 42px; }
.state-mini.state-mini--standalone .state-mini-score-lbl { font-size: 11px; }

/* Carte dédiée "État du système" (V3) */
.state-card .card-head {
  margin-bottom: 14px;
}
.state-card .card-head .head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#btn-toggle-sound {
  padding: 6px 10px;
}
#btn-toggle-sound i { font-size: 14px; }
.state-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (max-width: 640px) {
  .state-mini.state-mini--standalone .state-mini-body {
    grid-template-columns: auto 1fr;
    row-gap: 10px;
  }
  .state-mini.state-mini--standalone .state-mini-score {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    gap: 8px;
    justify-content: flex-end;
  }
  .state-mini.state-mini--standalone .state-mini-score-val { font-size: 34px; }
}

/* Variante INLINE : le widget est encastré dans la carte de Prédiction
   finale (3ᵉ colonne du .prediction-body). Il doit rester compact tout
   en gardant son style : bordure, glow, tailles réduites. */
.state-mini.state-mini--inline {
  padding: 12px 14px;
  gap: 10px;
  min-height: 0;
  height: 100%;
}
.state-mini.state-mini--inline .state-mini-title { font-size: 10px; letter-spacing: 1.2px; }
.state-mini.state-mini--inline .state-mini-badge { font-size: 9px; padding: 2px 7px; }
.state-mini.state-mini--inline .state-mini-body {
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 2px 0;
}
.state-mini.state-mini--inline .state-mini-icon {
  width: 38px; height: 38px;
  font-size: 17px;
  border-width: 1.5px;
}
.state-mini.state-mini--inline .state-mini-verdict {
  font-size: 17px;
  letter-spacing: 1px;
  margin-bottom: 2px;
}
.state-mini.state-mini--inline .state-mini-sub {
  font-size: 10px;
  -webkit-line-clamp: 2;
}
.state-mini.state-mini--inline .state-mini-score-val { font-size: 24px; }
.state-mini.state-mini--inline .state-mini-score-lbl { font-size: 9px; }
.state-mini.state-mini--inline .state-mini-foot { font-size: 10px; margin-top: 2px; }

/* Sur mobile étroit, on masque le pied (fenêtre glissante) pour éviter
   tout débordement et on garde uniquement l'essentiel : verdict + score.
   Le widget reste sur toute la largeur du cadre PRÉDICTION FINALE
   (prediction-body-with-state repasse déjà en 1 colonne sous 720px). */
@media (max-width: 720px) {
  .state-mini.state-mini--inline { padding: 10px 12px; }
  .state-mini.state-mini--inline .state-mini-foot { display: none; }
  .state-mini.state-mini--inline .state-mini-verdict { font-size: 16px; }
  .state-mini.state-mini--inline .state-mini-score-val { font-size: 22px; }
  .state-mini.state-mini--inline .state-mini-icon { width: 34px; height: 34px; font-size: 15px; }
}

.state-mini {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-gold);
  background: linear-gradient(160deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.55) 100%);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 130px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.state-mini::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.state-mini > * { position: relative; z-index: 1; }

.state-mini-good {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 22px -6px rgba(16, 185, 129, 0.35);
}
.state-mini-good::before { background: radial-gradient(circle at 30% 30%, rgba(16,185,129,0.45), transparent 65%); }

.state-mini-bad {
  border-color: rgba(220, 38, 38, 0.6);
  box-shadow: 0 0 22px -6px rgba(220, 38, 38, 0.4);
}
.state-mini-bad::before { background: radial-gradient(circle at 30% 30%, rgba(220,38,38,0.45), transparent 65%); }

.state-mini-neutral {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 22px -6px rgba(245, 158, 11, 0.28);
}
.state-mini-neutral::before { background: radial-gradient(circle at 30% 30%, rgba(245,158,11,0.4), transparent 65%); }

.state-mini-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.state-mini-title {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-300);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.state-mini-title i { font-size: 12px; }

.state-mini-badge {
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  background: rgba(0,0,0,0.4);
  color: var(--text-muted);
  white-space: nowrap;
}
.state-mini-badge-good    { color: var(--jade-400); border-color: rgba(16, 185, 129, 0.6); background: rgba(16, 185, 129, 0.15); }
.state-mini-badge-bad     { color: #fca5a5;              border-color: rgba(220, 38, 38, 0.6); background: rgba(220, 38, 38, 0.18); }
.state-mini-badge-neutral { color: var(--gold-300);      border-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.15); }

.state-mini-body {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 4px 0;
}
.state-mini-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: rgba(0,0,0,0.4);
  border: 2px solid currentColor;
  color: var(--gold-300);
  flex-shrink: 0;
}
.state-mini-good    .state-mini-icon { color: var(--jade-400); }
.state-mini-bad     .state-mini-icon { color: #fca5a5; }
.state-mini-neutral .state-mini-icon { color: var(--gold-300); }

.state-mini-text { min-width: 0; }
.state-mini-verdict {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1;
  color: var(--ivory);
  margin-bottom: 4px;
}
.state-mini-good    .state-mini-verdict { color: var(--jade-400); }
.state-mini-bad     .state-mini-verdict { color: #fca5a5; }
.state-mini-neutral .state-mini-verdict { color: var(--gold-300); }
.state-mini-sub {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.state-mini-score { text-align: center; flex-shrink: 0; }
.state-mini-score-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold-300);
  text-shadow: 0 0 12px rgba(251,191,36,0.3);
}
.state-mini-good    .state-mini-score-val { color: var(--jade-400); text-shadow: 0 0 12px rgba(16,185,129,0.35); }
.state-mini-bad     .state-mini-score-val { color: #fca5a5;              text-shadow: 0 0 12px rgba(220,38,38,0.35);   }
.state-mini-score-lbl {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}

.state-mini-foot {
  border-top: 1px dashed var(--border-soft);
  padding-top: 8px;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-align: center;
}

@media (max-width: 720px) {
  .state-mini { min-height: auto; }
  .state-mini-verdict { font-size: 20px; }
  .state-mini-score-val { font-size: 26px; }
  .state-mini-icon { width: 42px; height: 42px; font-size: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   🎯 CONTRÔLE DES MOMENTS — GoodMomentPerformanceTracker
   ─────────────────────────────────────────────────────────────────────
   📦 Copie INTÉGRALE des styles de Baccara KING v3.1 (2026-08-26)
   Observateur indépendant. N'affecte AUCUN autre composant du QUEEN.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Blocs communs (repris tel quel de King) ─────────────────────── */
.alerts-row-title { font-weight: 700; color: var(--gold-300); }
.alerts-row-desc  { font-size: 13px; color: rgba(255,255,255,0.7); }
.alerts-key-block {
  padding: 12px 14px;
  background: rgba(0,0,0,0.18);
  border-left: 3px solid var(--gold-500, #f59e0b);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 10px;
}
.alerts-key-block code {
  background: rgba(0,0,0,0.35); padding: 1px 6px; border-radius: 4px;
  color: var(--gold-300); font-size: 12px;
}
.alerts-tests {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-top: 6px;
}
.alerts-tests .btn { width: 100%; justify-content: center; }
.btn-test-good { background: linear-gradient(135deg, #059669, #10b981); color: #fff; border-color: #10b981; }
.btn-test-good:hover { background: linear-gradient(135deg, #047857, #059669); }

.alerts-limitation {
  margin-top: 4px;
  padding: 10px 12px;
  background: rgba(180, 83, 9, 0.14);
  border-left: 3px solid #fbbf24;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.82);
}
.alerts-limitation strong { color: var(--gold-300); }
.alerts-limitation code {
  background: rgba(0,0,0,0.35); padding: 1px 6px; border-radius: 4px;
  color: var(--gold-300); font-size: 11px;
}

@media (max-width: 520px) {
  .alerts-tests { grid-template-columns: repeat(2, 1fr); }
}

/* ── Statistiques session en cours ──────────────────────────────── */
.perf-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.perf-stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-300, #e6c26a);
  margin-top: 2px;
}

.perf-state-active {
  color: #10b981;
  font-weight: 700;
}
.perf-state-idle {
  color: #9ca3af;
  font-weight: 600;
}

#perf-current-seq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.perf-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.perf-chip-win {
  background: rgba(16,185,129,0.15);
  color: #6ee7b7;
  border-color: rgba(16,185,129,0.35);
}
.perf-chip-loss {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border-color: rgba(239,68,68,0.35);
}
.perf-chip-state {
  opacity: 0.7;
  font-size: 0.68rem;
  margin-left: 3px;
}

/* ── Historique ─────────────────────────────────────────────────── */
.perf-hist-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid #9ca3af;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.perf-hist-good { border-left-color: #10b981; }
.perf-hist-mid  { border-left-color: #f59e0b; }
.perf-hist-bad  { border-left-color: #ef4444; }
.perf-hist-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  margin-bottom: 4px;
}
.perf-hist-stats {
  font-size: 0.85rem;
  opacity: 0.85;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Dernier rapport ────────────────────────────────────────────── */
.perf-last-report {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.perf-flash {
  background: rgba(230, 194, 106, 0.15) !important;
  border-color: var(--gold-300, #e6c26a) !important;
}

/* ── Sortie des tests déterministes ─────────────────────────────── */
.perf-test-output {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  max-height: 260px;
  overflow: auto;
}
.perf-test-pass {
  border-color: rgba(16,185,129,0.55);
  color: #a7f3d0;
}
.perf-test-fail {
  border-color: rgba(239,68,68,0.55);
  color: #fecaca;
}

@media (max-width: 520px) {
  .perf-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═══ Adaptations PRINCE (palette rouge/or : les classes tag-* y ont un autre sens) ═══ */
.tag-danger { background: rgba(220, 38, 38, 0.22); color: #fca5a5; border: 1px solid rgba(220, 38, 38, 0.6); }
#perf-session-badge.tag-safe, #state-badge.tag-safe { background: rgba(16,185,129,0.20); color: var(--jade-400); border: 1px solid rgba(16,185,129,0.55); }
#perf-session-badge.tag-warn, #state-badge.tag-warn { background: rgba(251,191,36,0.16); color: var(--gold-300); border: 1px solid rgba(251,191,36,0.5); }
#state-badge.tag-danger { background: rgba(220,38,38,0.22); color: #fca5a5; border: 1px solid rgba(220,38,38,0.6); }
.prediction-card .state-mini.state-mini--inline {
  height: auto;
  margin-top: 14px;
  grid-column: 1 / -1;   /* pleine largeur : .prediction-body de PRINCE a 2 colonnes, pas 3 */
}

/* Sélecteur de canal */
.channel-picker{display:inline-flex;align-items:center;gap:8px}
.channel-picker label{font-weight:700;color:#fbbf24;white-space:nowrap}
.channel-select{background:#052e22;color:#fef3c7;border:1px solid rgba(251,191,36,.55);border-radius:10px;padding:6px 10px;font:inherit;font-weight:600;cursor:pointer;max-width:100%}
.channel-select:hover,.channel-select:focus{border-color:#fbbf24;outline:none;box-shadow:0 0 0 2px rgba(251,191,36,.25)}
