{# CSS de l'application (enveloppe base.html), partagé avec base_public.html pour
   que les pages outil (bulletin, fiche course…) gardent leurs composants sur
   ordinateur. Sorti de base.html le 16/09/2026 sans modification. #}

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-main: #F5EEDC;
  --bg-card: #FDF9EE;
  --bg-input: #EFE7D3;
  --text-main: #26331F;
  --text-muted: #75705B;
  --text-dim: #A29A80;
  --border: #E2D7B8;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-main); color: var(--text-main); line-height: 1.5;
  padding-bottom: 70px;
}
.card { background: var(--bg-card); }
.muted { color: var(--text-muted); }
header {
  color: #F3ECD8;
  background: linear-gradient(135deg, #1E4D33 0%, #14361F 100%);
  padding: 12px 16px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Filtres rapides (onglets) */
.filter-tabs-row {
  display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; margin-bottom: 4px;
  background: #FDF9EE; border-radius: 12px;
  scrollbar-width: none;
}
.filter-tabs-row::-webkit-scrollbar { display: none; }
.filter-tab {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px;
  background: #E9DFC4; color: #75705B; text-decoration: none;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: all 0.15s;
}
.filter-tab.active {
  background: linear-gradient(135deg, #1E4D33 0%, #14361F 100%);
  color: white;
}

/* Indicateur pull-to-refresh */
.ptr-indicator {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%) translateY(-100%);
  background: #1E4D33; color: white; padding: 10px 24px;
  border-radius: 0 0 16px 16px; font-size: 13px; z-index: 150;
  transition: transform 0.25s ease-out;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.ptr-indicator.visible { transform: translateX(-50%) translateY(0); }
.ptr-indicator.active { background: #E4BC63; color: #14361F; font-weight: 600; }
/* La marque n'est plus un titre de niveau 1 (elle l'était sur les 122 routes,
   ce qui gâchait le principal signal on-page). Rendu inchangé : mêmes règles,
   autre sélecteur. */
header .brand { font-size: 18px; font-weight: 600; }
/* Le sous-titre est devenu le titre de niveau 1 de la page : on neutralise les
   styles par défaut du navigateur (2em, gras, marges) pour que l'affichage
   reste identique à ce qu'il était. */
header .sub { font-size: 12px; opacity: 0.8; font-weight: 400; margin: 0; }
main { padding: 12px; max-width: 800px; margin: 0 auto; }
.card {
  background: #FDF9EE; border-radius: 12px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.card h2 { font-size: 15px; margin-bottom: 10px; color: #1E4D33; }
.card h3 { font-size: 13px; margin: 8px 0 6px; color: #75705B; }
.row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.row .label { color: #75705B; }
.row .val { font-weight: 600; }
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; margin: 2px 4px 2px 0;
}
.chip-green { background: #1E4D33; color: #EAF4E9; }
.chip-yellow { background: #F1E5BD; color: #7A5A10; }
.chip-red { background: #F2DEDA; color: #7D2A33; }
.chip-blue { background: #DDE6F0; color: #31517A; }
.chip-grey { background: #E9DFC4; color: #75705B; }
.big {
  font-size: 22px; font-weight: 700; color: #1E4D33;
  margin: 8px 0;
}
.cote { color: #B4691E; font-weight: 600; }
.cheval { color: #26331F; font-weight: 600; }
.muted { color: #75705B; font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 6px 4px; text-align: left; border-bottom: 1px solid #E9DFC4; }
th { color: #75705B; font-weight: 500; font-size: 11px; text-transform: uppercase; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #FDF9EE; border-top: 1px solid #E9DFC4;
  display: flex; padding: 6px 2px; z-index: 100;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.bottom-nav a { font-size: 10px; padding: 4px 2px; }
.bottom-nav .icon { font-size: 22px; margin-bottom: 1px; }

/* Bannière course imminente */
.imminente-banner {
  background: linear-gradient(90deg, #c2410c 0%, #ea580c 100%);
  color: white; padding: 10px 14px; font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
  text-decoration: none; gap: 10px;
  border-bottom: 2px solid #C39237;
  animation: pulse-imm 2s infinite;
}
@keyframes pulse-imm {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(251,191,36,0); }
}
.imminente-banner strong { color: #fef3c7; }
.imminente-countdown {
  background: rgba(0,0,0,0.3); padding: 4px 10px; border-radius: 999px;
  font-weight: 700; white-space: nowrap;
}

/* Onboarding overlay */
.onboarding-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  z-index: 500; display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.onboarding-overlay.show { display: flex; }
.onboarding-card {
  background: #FDF9EE; border-radius: 16px; padding: 28px 24px;
  max-width: 380px; width: 100%; text-align: center;
}
.onboarding-emoji { font-size: 56px; margin-bottom: 14px; }
.onboarding-card h2 { color: #1E4D33; font-size: 22px; margin-bottom: 10px; }
.onboarding-card p { color: #75705B; font-size: 14px; line-height: 1.5; }
.onboarding-dots { display: flex; gap: 6px; justify-content: center; margin: 20px 0; }
.onboarding-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #D9CDAA;
}
.onboarding-dot.active { background: #1E4D33; width: 24px; border-radius: 4px; }
.onboarding-btn {
  background: linear-gradient(135deg, #1E4D33 0%, #14361F 100%);
  color: white; border: none; padding: 12px 28px;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 14px;
  margin-top: 4px;
}
.onboarding-skip {
  display: block; margin-top: 12px; background: none; border: none;
  color: #75705B; font-size: 12px; cursor: pointer;
}

/* Nav principale en haut, alignée à gauche */
.top-nav {
  background: #FDF9EE;
  border-bottom: 1px solid #E9DFC4;
  display: flex; gap: 4px; padding: 6px 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  position: sticky; top: 0; z-index: 90;
}
.top-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  color: #75705B; text-decoration: none;
  font-size: 13px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  background: transparent;
  transition: background 0.15s;
}
.top-nav a:hover { background: #E9DFC4; }
.top-nav a.active {
  background: linear-gradient(135deg, #1E4D33 0%, #14361F 100%);
  color: white;
}
.top-nav .icon { font-size: 15px; }
.top-nav .label { font-size: 13px; }
.bottom-nav a {
  flex: 1; text-align: center; padding: 6px 2px;
  color: #75705B; text-decoration: none; font-size: 11px;
}
.bottom-nav a.active { color: #1E4D33; }
.bottom-nav .icon { display: block; font-size: 18px; margin-bottom: 2px; }
a { color: #1E4D33; text-decoration: none; }
.btn {
  display: inline-block; padding: 10px 16px; background: #1E4D33;
  color: white; border-radius: 8px; text-decoration: none;
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
}
.btn-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.filter-toggle {
  padding: 6px 12px; background: #E9DFC4; border-radius: 6px;
  font-size: 12px; color: #75705B;
}
.filter-toggle.on { background: #1E4D33; color: white; }
form.inline { display: inline-flex; gap: 6px; }
input, select {
  background: #E9DFC4; color: white; border: 1px solid #D9CDAA;
  padding: 8px; border-radius: 6px; font-size: 14px;
}
.alert {
  background: #6b3a1a; color: #ffd8b8; padding: 12px;
  border-radius: 8px; margin: 8px 0; font-size: 13px;
}
.alert-good { background: #1E4D33; color: #EAF4E9; }
.alert-bad { background: #F2DEDA; color: #7D2A33; }

/* Header actions (loupe + menu) */
.header-actions { display: flex; align-items: center; gap: 8px; }
.search-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: white;
  text-decoration: none; font-size: 16px;
}
.search-icon:hover { background: rgba(255,255,255,0.2); }

/* ─── Info-bulles (loupe, nav Explorer) ─── */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip);
  position: absolute; z-index: 300;
  background: #FDF9EE; color: #26331F;
  border: 1px solid #1E4D33; border-radius: 8px;
  padding: 7px 10px; font-size: 11px; line-height: 1.4;
  width: max-content; max-width: 220px; white-space: normal;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.tip-down::after { top: calc(100% + 8px); right: 0; }
.tip-up::after { bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); }
.tip:hover::after, .tip:focus-visible::after, .tip:active::after { opacity: 1; }

/* ─── Bannière d'installation PWA ─── */
.install-banner {
  display: none; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #1E4D33 0%, #14361F 100%);
  color: #fff; padding: 10px 14px; font-size: 13px;
  border-radius: 0;
}
.install-banner .ib-txt { flex: 1; }
.install-banner .ib-btn {
  background: #fff; color: #14361F; border: none; cursor: pointer;
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700;
  font-family: inherit; white-space: nowrap;
}
.install-banner .ib-close {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
}

/* ─── Bloc info repliable "pourquoi le prono évolue" ─── */
.prono-info { background: var(--bg-card); border: 1px solid #E9DFC4; border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.prono-info summary { cursor: pointer; list-style: none; padding: 12px 14px; font-size: 13px; font-weight: 600; color: #1E4D33; display: flex; align-items: center; gap: 8px; }
.prono-info summary::-webkit-details-marker { display: none; }
.prono-info summary::after { content: '▾'; margin-left: auto; opacity: .7; transition: transform .2s; }
.prono-info[open] summary::after { transform: rotate(180deg); }
.prono-info summary:hover { background: rgba(140,224,140,0.06); }
.prono-info-body { padding: 0 16px 14px; font-size: 13px; line-height: 1.6; color: var(--text-main); }
.prono-info-body ul { padding-left: 18px; margin: 8px 0; }
.prono-info-body li { margin: 5px 0; }
.prono-info-body p { margin: 6px 0; }

/* Menu utilisateur (header) */
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px; position: relative;
  background: rgba(255,255,255,0.1); border: none; cursor: pointer;
  color: white; padding: 6px 10px; border-radius: 999px;
  font-family: inherit; font-size: 13px;
}
.user-btn:hover { background: rgba(255,255,255,0.2); }
.user-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: #E4BC63; color: #14361F; font-weight: 700; font-size: 14px;
}
.user-name { font-weight: 600; }
.user-caret { font-size: 10px; opacity: 0.8; }
.badge-admin {
  background: #7A5A10; color: #F1E5BD;
  padding: 1px 5px; border-radius: 4px; font-size: 9px; margin-left: 4px;
}
.user-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: #FDF9EE; border-radius: 12px; padding: 6px;
  min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  border: 1px solid #E9DFC4; z-index: 110;
}
.user-menu.open { display: block; }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #26331F; text-decoration: none; font-size: 14px;
}
.user-menu-item:hover { background: #E9DFC4; }
.user-menu-item.logout { color: #7D2A33; }
.user-menu-item.logout:hover { background: #3c1a1a; }
.um-icon { font-size: 16px; width: 24px; text-align: center; }
.um-badge {
  margin-left: auto; background: #7D2A33; color: #fff;
  border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 600;
}
.user-menu-sep {
  height: 1px; background: #E9DFC4; margin: 4px 8px;
}

/* Étoile favori */
.fav-star {
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 2px 6px; color: #A29A80;
  vertical-align: middle;
  transition: transform 0.1s;
}
.fav-star.on { color: #9A6B1F; }
.fav-star:hover { transform: scale(1.2); }

/* Bannière alerte favoris */
.fav-banner {
  background: linear-gradient(90deg, #4a3b00 0%, #F1E5BD 100%);
  color: #7A5A10; padding: 10px 16px; font-size: 13px;
  display: block; text-decoration: none;
  border-bottom: 1px solid #E9DFC4;
}
.fav-banner strong { color: #9A6B1F; }
.fav-banner:hover { background: linear-gradient(90deg, #5a4b00 0%, #7b6b00 100%); }

/* Bannière annonce formules (1er septembre) */
.annonce-banner {
  background: linear-gradient(90deg, #14361F 0%, #1E4D33 100%);
  color: #F3ECD8; padding: 10px 40px 10px 16px; font-size: 13px;
  display: block; position: relative; border-bottom: 2px solid #C39237;
}
.annonce-banner strong { color: #E4BC63; }
.annonce-banner a { color: #F3ECD8; text-decoration: underline; }
.annonce-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #F3ECD8; font-size: 16px;
  cursor: pointer; padding: 4px 8px; opacity: .7;
}
.annonce-close:hover { opacity: 1; }

/* Footer légal */
.legal-footer {
  background: transparent; padding: 16px 16px 6px;
  font-size: 10px; color: #A29A80; text-align: center;
}
.legal-links a { color: #75705B; margin: 0 4px; text-decoration: none; font-size: 11px; }
.legal-links a:hover { color: #1E4D33; }
.legal-disclaimer { font-size: 10px; color: #A29A80; margin-top: 4px; }

/* Cookie banner */
.cookie-banner {
  position: fixed; bottom: 80px; left: 12px; right: 12px;
  background: #E9DFC4; color: #26331F; padding: 12px 14px;
  border-radius: 10px; font-size: 12px; z-index: 150;
  display: flex; gap: 10px; align-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.cookie-banner.show { display: flex !important; }

/* Ligne pronostiquée dans une arrivée */
tr.row-prono td {
  background: rgba(26, 93, 26, 0.25);
}
tr.row-prono td.cheval, tr.row-prono .cheval {
  color: #EAF4E9 !important; font-weight: 600;
}

/* Bouton J'ai joué */
.bet-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #DDE6F0; color: #31517A; border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 13px; cursor: pointer; margin-top: 8px;
  font-family: inherit;
}
.bet-btn:hover { background: #C9D8E8; }
.bet-btn.done { background: #1E4D33; color: #EAF4E9; }
.bet-form {
  display: none; margin-top: 8px; padding: 10px;
  background: #F5EEDC; border-radius: 8px;
}
.bet-form.open { display: block; }
.bet-form label { display: block; font-size: 12px; color: #75705B; margin-bottom: 4px; }
.bet-form input { width: 80px; }
.bet-form .btn-sm {
  background: #1E4D33; color: white; border: none;
  border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}

/* Navigation entre dates */
.date-nav {
  display: flex; align-items: stretch; gap: 6px;
  background: #FDF9EE; border-radius: 12px; padding: 8px;
  margin-bottom: 12px;
}
.date-nav a, .date-nav button, .date-nav .date-current {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  background: #E9DFC4; color: #26331F; border: none; border-radius: 8px;
  padding: 10px 14px; font-size: 15px; text-decoration: none; cursor: pointer;
  font-family: inherit;
}
.date-nav .date-current {
  flex: 1; flex-direction: column; padding: 6px 8px;
  background: linear-gradient(135deg, #1E4D33 0%, #14361F 100%);
  color: #F3ECD8;
}
.date-nav .date-current .day { font-size: 18px; font-weight: 700; line-height: 1.1; }
.date-nav .date-current .sub { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.date-nav a:hover, .date-nav button:hover { background: #D9CDAA; }
.date-nav .today-btn {
  background: #1E4D33; color: white; font-size: 12px; padding: 6px 10px;
}
.date-nav input[type="date"] {
  background: #E9DFC4; color: #26331F; border: none; border-radius: 8px;
  padding: 8px; font-size: 14px; width: 100%;
}
.date-quick {
  display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto;
  padding-bottom: 4px;
}
.date-quick a {
  flex: 0 0 auto; background: #E9DFC4; color: #75705B; text-decoration: none;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; white-space: nowrap;
}
.date-quick a.active { background: #1E4D33; color: white; }


/* Top progress bar de navigation */
#nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #C39237, #f59e0b);
  width: 0%;
  z-index: 99999;
  transition: width 0.2s ease-out, opacity 0.3s;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
  opacity: 0;
  pointer-events: none;
}
#nav-progress.active { opacity: 1; }

/* Skeleton loader pour cartes */
.skeleton-card {
  background: linear-gradient(90deg, #E9DFC4 0%, #D9CDAA 50%, #E9DFC4 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s linear infinite;
  border-radius: 12px;
  height: 80px;
  margin-bottom: 12px;
}
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Infobulles métier (partagées — voir templates/_tips.html) ─── */
.info-tip {
  display: inline-block; position: relative; cursor: help;
  margin-left: 4px; vertical-align: middle;
  outline: none;
}
.info-tip-i { font-size: 11px; opacity: 0.55; transition: opacity 0.15s; }
.info-tip:hover .info-tip-i,
.info-tip:focus .info-tip-i,
.info-tip.open .info-tip-i { opacity: 1; }
.info-tip-bubble {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: #FDF9EE; border: 1px solid #1E4D33; border-radius: 8px;
  padding: 10px 12px; font-size: 12px; color: #26331F;
  width: 240px; z-index: 200; white-space: normal; line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0,0,0,0.55);
  text-align: left; font-weight: normal;
}
.info-tip-bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #1E4D33;
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus .info-tip-bubble,
.info-tip.open .info-tip-bubble { display: block; }
/* Si la bulle déborde à droite (ex. dans un th proche du bord), recadre */
.info-tip-bubble.right { left: auto; right: 0; transform: none; }
.info-tip-bubble.right::after { left: auto; right: 12px; transform: none; }
