/* Tableau du jour : la page d'entrée « je suis les pronostics ». */
#day-board {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line, #1d3a2b);
  border-radius: 18px;
  background: var(--panel, #0c1f16);
}
#day-board .db-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
}
#day-board .db-head h2 {
  margin: 2px 0 0;
  font-size: 22px;
}
#day-board .db-counts {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted, #9bb3a5);
}
#day-board .db-counts b {
  font-size: 17px;
  color: var(--text, #e9f7ee);
  margin-right: 4px;
}
#day-board .db-counts .ok b { color: var(--lime, #b6ff3a); }
#day-board .db-counts .warn b { color: #e8c266; }
#day-board .db-next {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(182, 255, 58, 0.08);
  border: 1px solid rgba(182, 255, 58, 0.22);
  font-size: 13px;
}
#day-board .db-next span { color: var(--muted, #9bb3a5); }
#day-board .db-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
#day-board .db-filters button {
  border: 1px solid var(--line, #1d3a2b);
  background: transparent;
  color: var(--muted, #9bb3a5);
  font-weight: 700;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}
#day-board .db-filters button.active {
  background: var(--lime, #b6ff3a);
  border-color: var(--lime, #b6ff3a);
  color: #06210f;
}
#day-board .db-list {
  display: grid;
  gap: 10px;
}
/* --- une course --- */
#day-board .db-card {
  display: grid;
  gap: 9px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line, #1d3a2b);
  border-left: 4px solid var(--muted, #9bb3a5);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  font: inherit;
  transition: transform 0.12s, border-color 0.12s;
}
#day-board .db-card:hover { transform: translateY(-1px); border-color: rgba(182, 255, 58, 0.35); }
#day-board .db-solid { border-left-color: #59d861; }
#day-board .db-playable { border-left-color: #b6ff3a; }
#day-board .db-open { border-left-color: #e8c266; }
#day-board .db-avoid { border-left-color: #d8635f; opacity: 0.72; }
#day-board .db-done { opacity: 0.6; }
#day-board .db-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted, #9bb3a5);
}
#day-board .db-when { display: grid; line-height: 1.25; }
#day-board .db-when b { font-size: 15px; color: var(--text, #e9f7ee); }
#day-board .db-where { flex: 1; font-weight: 700; letter-spacing: 0.02em; }
#day-board .db-q {
  background: rgba(232, 194, 102, 0.16);
  color: #e8c266;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 800;
}
#day-board .db-conf { display: grid; justify-items: end; line-height: 1.2; }
#day-board .db-conf b { font-size: 17px; color: var(--text, #e9f7ee); }
#day-board .db-pick {
  display: flex;
  align-items: center;
  gap: 10px;
}
#day-board .db-num {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--lime, #b6ff3a);
  color: #06210f;
  font-weight: 900;
  font-size: 16px;
}
#day-board .db-horse { flex: 1; font-size: 18px; font-weight: 800; }
#day-board .db-win { font-size: 17px; font-weight: 800; color: var(--lime, #b6ff3a); }
#day-board .db-backups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
#day-board .db-lab {
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted, #9bb3a5);
  margin-right: 2px;
}
#day-board .db-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
#day-board .db-chip.db-value { background: rgba(232, 194, 102, 0.14); color: #e8c266; }
#day-board .db-advice {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted, #9bb3a5);
}
#day-board .db-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #e9f7ee);
}
#day-board .db-solid .db-badge { background: rgba(89, 216, 97, 0.16); color: #59d861; }
#day-board .db-avoid .db-badge { background: rgba(216, 99, 95, 0.16); color: #d8635f; }
#day-board .db-result { font-size: 12px; font-weight: 800; }
#day-board .db-result.db-won { color: #59d861; }
#day-board .db-result.db-placed { color: #e8c266; }
#day-board .db-result.db-missed { color: #d8635f; }
/* Mode Essentiel : le tableau suffit, on retire les blocs d'analyse de l'accueil. */
body[data-mode="essentiel"] #daily-brief,
body[data-mode="essentiel"] #day-highlights,
body[data-mode="essentiel"] #hotlist { display: none !important; }
@media (max-width: 640px) {
#day-board { padding: 14px; }
#day-board .db-top { flex-wrap: wrap; }
#day-board .db-where { order: 3; flex-basis: 100%; }
}

/* Séparateur avant les courses déjà courues. */
#day-board .db-sep {
  margin: 6px 2px 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #9bb3a5);
}
/* La carte est un <button> : on neutralise le style bouton global des panneaux. */
#day-board .db-card {
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  box-shadow: none;
  filter: none;
}
#day-board .db-card:hover:not(:disabled) { box-shadow: none; filter: none; }

/* Noms longs : on tronque plutôt que de faire déborder le pourcentage. */
#day-board .db-horse {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#day-board .db-win { white-space: nowrap; }

/* ============================================================
   Relief 3D : pastille extrudée, anneau de confiance, reflet,
   entrée en cascade + squelettes de chargement.
   Tout est CSS pur — aucun impact sur les performances.
   ============================================================ */
#day-board .db-card { position: relative; overflow: hidden; }
#day-board .db-card:active:not(:disabled) { transform: scale(0.985); }

/* Pastille du cheval « extrudée » : dégradé + lumière en haut, ombre en bas. */
#day-board .db-num {
  background: linear-gradient(160deg, #dfff9a, var(--lime, #b6ff3a) 55%, #8fc73a);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 6px rgba(6, 20, 10, 0.35);
}

/* La base du jour se détache : fond légèrement teinté + reflet qui balaie. */
#day-board .db-solid {
  background: linear-gradient(165deg, rgba(89, 216, 97, 0.07), rgba(255, 255, 255, 0.02) 55%);
}
#day-board .db-solid::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.06) 50%, transparent 58%);
  transform: translateX(-130%);
  animation: db-sweep 6s ease-in-out 1.2s infinite;
}
@keyframes db-sweep {
  0% { transform: translateX(-130%); }
  45%, 100% { transform: translateX(130%); }
}

/* Anneau de confiance : jauge circulaire remplie à hauteur du score. */
#day-board .db-conf { justify-items: center; gap: 2px; }
#day-board .db-conf small { font-size: 10px; }
#day-board .db-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
#day-board .db-ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  /* Opaque volontairement : --panel est redéfini en blanc translucide par
     meloturf-theme.css, ce qui rendrait le disque intérieur invisible. */
  background: #0f2018;
}
#day-board .db-ring b { position: relative; font-size: 14px; }

/* Entrée en cascade — la classe db-enter n'est posée qu'au premier affichage. */
#day-board.db-enter .db-card { animation: db-rise 0.55s cubic-bezier(0.2, 0.8, 0.3, 1) both; }
#day-board.db-enter .db-card:nth-child(2) { animation-delay: 0.07s; }
#day-board.db-enter .db-card:nth-child(3) { animation-delay: 0.14s; }
#day-board.db-enter .db-card:nth-child(4) { animation-delay: 0.21s; }
#day-board.db-enter .db-card:nth-child(n + 5) { animation-delay: 0.28s; }
@keyframes db-rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

/* Squelettes : silhouettes qui scintillent pendant la requête. */
#day-board .db-skel { pointer-events: none; }
#day-board .db-bone {
  display: block;
  border-radius: 8px;
  background: linear-gradient(100deg, #14271f 40%, #1d3529 50%, #14271f 60%);
  background-size: 220% 100%;
  animation: db-shimmer 1.4s ease-in-out infinite;
}
#day-board .db-bone-ring { width: 40px; height: 40px; border-radius: 50%; }
@keyframes db-shimmer {
  from { background-position-x: 130%; }
  to { background-position-x: -60%; }
}

/* Podium 3D des courses arrivées : le tiercé de tête en marches (2e·1er·3e). */
#day-board .db-podium { position: relative; display: grid; gap: 8px; overflow: hidden; }
#day-board .db-podium-steps {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding-top: 4px;
}
#day-board .db-step { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 72px; }
#day-board .db-medal {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-weight: 900;
  font-size: 14px;
  background: linear-gradient(160deg, #e8ecef, #b9c2c9 60%, #8f9aa3);
  color: #1a2126;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
#day-board .db-step-1 .db-medal {
  width: 36px;
  height: 36px;
  font-size: 16px;
  background: linear-gradient(160deg, #dfff9a, var(--lime, #b6ff3a) 55%, #8fc73a);
  color: #06210f;
}
#day-board .db-step-3 .db-medal {
  background: linear-gradient(160deg, #f7dd9a, #e8c266 60%, #b58a3a);
  color: #1c1408;
}
#day-board .db-medal-played { outline: 2px solid var(--lime, #b6ff3a); outline-offset: 2px; }
#day-board .db-block {
  width: 100%;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--line, #1d3a2b);
  border-bottom: 0;
  background: linear-gradient(180deg, #23443a, #14271f);
  color: var(--muted, #9bb3a5);
  font-weight: 800;
  font-size: 12px;
}
#day-board .db-step-1 .db-block {
  height: 52px;
  font-size: 15px;
  color: var(--lime, #b6ff3a);
  border-color: rgba(182, 255, 58, 0.45);
  background: linear-gradient(180deg, rgba(182, 255, 58, 0.24), rgba(182, 255, 58, 0.06) 70%, #14271f);
}
#day-board .db-step-3 .db-block { height: 26px; }
#day-board .db-podium-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
#day-board .db-podium-return { font-size: 12px; color: var(--muted, #9bb3a5); }
#day-board .db-podium-return b { color: var(--lime, #b6ff3a); }
/* La carte d'un gagnant trouvé reste bien visible malgré l'estompe des courses finies. */
#day-board .db-done:has(.db-podium-won) { opacity: 0.9; }
/* Marches et confettis animés uniquement au premier affichage (db-enter),
   pas à chaque re-rendu minute des comptes à rebours. Confettis en 2 passages
   puis arrêt : pas de mouvement perpétuel dans la liste. */
#day-board.db-enter .db-block {
  animation: db-grow 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) 0.25s both;
  transform-origin: bottom;
}
@keyframes db-grow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
#day-board .db-confetti {
  position: absolute;
  top: -12px;
  width: 5px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
}
#day-board.db-enter .db-podium-won .db-confetti { animation: db-fall 2.4s linear 0.5s 2; }
@keyframes db-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(150px) rotate(600deg); opacity: 0; }
}

/* Accessibilité : pas d'animation pour qui préfère réduire les mouvements. */
@media (prefers-reduced-motion: reduce) {
  #day-board .db-solid::after,
  #day-board.db-enter .db-card,
  #day-board.db-enter .db-block,
  #day-board.db-enter .db-podium-won .db-confetti,
  #day-board .db-bone { animation: none; }
}
