/* Duel IA : comparaison de deux chevaux + historique du profil */

.compare-selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 25px;
}

.compare-selectors label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.compare-selectors select {
  display: block;
  width: 100%;
  margin-top: 7px;
  background: var(--panel-3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .2s;
}

.compare-selectors select:hover { border-color: var(--lime); }

.versus {
  height: 44px;
  width: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #dcff8f, var(--lime));
  color: #102014;
  font-size: 11px;
  font-weight: 900;
  box-shadow: var(--glow-lime);
}

.duel-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.duel-horse strong { display: block; font-size: 20px; font-family: var(--font-display); }
.duel-horse span { color: var(--muted); font-size: 11px; }

.duel-score {
  font-size: 32px;
  font-weight: 700;
  color: var(--lime);
  padding: 0 22px;
  letter-spacing: -1px;
}

.duel-factor {
  display: grid;
  grid-template-columns: 46px 1fr 130px 1fr 46px;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}

.duel-factor > strong { text-align: center; font-size: 13px; }

.duel-factor > span {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.duel-track { height: 8px; background: #20342c; border-radius: 5px; overflow: hidden; }
.duel-track.left { display: flex; justify-content: flex-end; }

.duel-track i {
  display: block;
  height: 100%;
  background: var(--cyan);
  border-radius: 5px;
  transition: width .45s cubic-bezier(.2, .8, .2, 1);
}

.duel-track.winner i { background: linear-gradient(90deg, #8fc433, var(--lime)); box-shadow: 0 0 8px rgba(200, 255, 98, .4); }

.duel-verdict {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 3px solid var(--lime);
  background: #10231a;
  color: #c7d2cc;
  border-radius: 0 10px 10px 0;
  line-height: 1.6;
}

/* Historique 5 dernières courses (drawer profil) */

.history-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 18px 0; }

.history-race {
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  text-align: center;
}

.history-race strong, .history-race span { display: block; }
.history-race strong { font-size: 18px; color: var(--lime); font-family: var(--font-display); }
.history-race span { font-size: 9px; color: var(--muted); margin-top: 4px; }

.profile-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }

.profile-badge {
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 9px;
  color: var(--cyan);
  background: rgba(89, 216, 196, .05);
}

/* Équipement & angles + relevé par condition (fiche cheval) */
.equip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.equip {
  font-size: 11px; font-weight: 700;
  border: 1px solid var(--line-strong); border-radius: 20px;
  padding: 6px 11px; color: var(--text); background: rgba(21, 40, 32, .5);
}
.equip.hot { color: var(--lime); border-color: rgba(200, 255, 98, .5); background: rgba(200, 255, 98, .1); }
.equip-note { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 4px 0 0; }
.equip-note.good { color: var(--lime); }

.rec-list { display: grid; gap: 4px; margin: 12px 0 6px; }
.rec-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(21, 40, 32, .4); }
.rec-row span { font-size: 12px; color: var(--muted); }
.rec-row strong { font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .3px; }

.history-race.fault { border-color: rgba(255, 124, 112, .5); background: rgba(255, 124, 112, .08); }
.history-race.fault strong { color: var(--red); }
.fault-lbl { color: var(--red); font-weight: 700; }

/* Dernières courses réelles (fiche cheval) */
#horse-history { display: flex; flex-direction: column; gap: 7px; margin: 14px 0 18px; }
.history-loading { font-size: 12px; color: var(--muted); }
.past-race {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
}
.past-race .pr-pos {
  min-width: 40px;
  text-align: center;
  font-size: 16px;
  color: var(--lime);
  font-family: var(--font-display);
}
.past-race.good { border-color: rgba(190, 242, 100, .35); }
.past-race.fault { border-color: rgba(255, 124, 112, .5); background: rgba(255, 124, 112, .08); }
.past-race.fault .pr-pos { color: var(--red); font-size: 13px; }
.past-race .pr-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.past-race .pr-race { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.past-race .pr-meta { font-size: 10px; color: var(--muted); }

@media (max-width: 650px) {
  .duel-factor { grid-template-columns: 35px 1fr 75px 1fr 35px; }
  .compare-selectors { grid-template-columns: 1fr; }
  .versus { margin: auto; }
  .history-list { grid-template-columns: repeat(3, 1fr); }
}
