/* ============================================================
   HISTORIQUE QUINTÉ+ v2.3 — tqh-*
   Performance : transitions rapides, pas de layout shift
============================================================ */

/* ── Scroll rapide sur toute la page ── */
html { scroll-behavior: auto; }

.tqh-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px;
    font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    contain: layout style;
}

/* ── Header ── */
.tqh-header { margin: 24px 0 18px; }
.tqh-header-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.tqh-header-icon svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.1));
}
.tqh-title { font-size: 1.75rem; font-weight: 900; color: #0f172a; margin: 0 0 3px; }
.tqh-sub   { font-size: .88rem; color: #64748b; margin: 0; }

/* Stats — une ligne flex, scrollable sur mobile */
.tqh-stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding-bottom: 2px;
}
.tqh-stat {
    flex: 1 0 0;
    min-width: 105px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 10px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.tqh-stat-icon { display: block; font-size: 1.25rem; margin-bottom: 4px; }
.tqh-stat-val  { display: block; font-size: 1.25rem; font-weight: 900; color: #0f172a; margin-bottom: 2px; }
.tqh-stat-lbl  { display: block; font-size: .68rem; color: #64748b; font-weight: 600;
                 text-transform: uppercase; letter-spacing: .04em; white-space: normal; }
.tqh-stat--gains { background: linear-gradient(135deg,#f0fdf4,#dcfce7); border-color: #86efac; }
.tqh-stat--gains .tqh-stat-val { color: #004D25; }
.tqh-stat--gains .tqh-stat-lbl { color: #166534; }
@media(max-width:600px){ .tqh-stats{flex-wrap:wrap;} .tqh-stat{flex:1 0 calc(50% - 5px);} }

/* ── Navigation mois — VERT PMU ── */
.tqh-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 12px 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #004D25 0%, #006b34 100%);
    border: 1px solid #003a1c;
    margin-bottom: 12px;
}
.tqh-nav-arrow {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #fff; text-decoration: none; font-weight: 700;
    transition: background .1s;
}
.tqh-nav-arrow:hover { background: rgba(255,255,255,.3); color: #fff; }
.tqh-nav-label { font-size: 1.15rem; font-weight: 800; color: #fff; }
.tqh-year-form { display: inline-flex; align-items: center; gap: 6px; }
.tqh-year-sel {
    padding: 5px 9px; border-radius: 7px;
    border: 1px solid rgba(255,255,255,.3);
    background: rgba(255,255,255,.12);
    font-size: .85rem; font-weight: 700; color: #fff; cursor: pointer;
}
.tqh-year-sel option { color: #0f172a; background: #fff; }

/* ── Bannière archivage ── */
.tqh-archive-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: linear-gradient(135deg, #fffbeb, #fef9c3);
    border: 1px solid #fde047;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: .84rem;
    color: #713f12;
    font-weight: 600;
    line-height: 1.5;
}

/* ── Calendrier ── */
.tqh-cal { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; }
.tqh-cal-head {
    display: grid; grid-template-columns: repeat(7,1fr);
    background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.tqh-cal-dh {
    padding: 9px; text-align: center;
    font-size: .75rem; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: .04em;
}
.tqh-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.tqh-cal-cell {
    min-height: 88px;
    border-right: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    padding: 5px 5px 7px;
    position: relative;
}
.tqh-cal-cell:nth-child(7n) { border-right: none; }
.tqh-cal-empty     { background: #fafafa; }
.tqh-cal-empty-day { background: #fff; }
.tqh-cal-today     { background: #fffbeb; border: 2px solid #f59e0b !important; }
.tqh-cal-future    { background: linear-gradient(135deg,#f8fafc,#f0fdf4); }

.tqh-cal-day-num {
    font-size: .8rem; font-weight: 700; color: #64748b;
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 3px;
}
.tqh-cal-check { color: #22c55e; font-size: .75rem; }
.tqh-cal-content {
    display: flex; flex-direction: column; gap: 2px;
    text-decoration: none;
    transition: opacity .1s;
}
.tqh-cal-content:hover { opacity: .8; }
.tqh-cal-hippo { font-size: .68rem; font-weight: 800; color: #004D25; line-height: 1.2; }
.tqh-cal-heure { font-size: .6rem; color: #94a3b8; }

@media(max-width:640px){ .tqh-cal-cell{min-height:66px;} .tqh-cal-hippo{display:none;} }

/* Badges */
.tqh-badge {
    display: inline-block; padding: 2px 6px; border-radius: 4px;
    font-size: .6rem; font-weight: 800; margin-top: 2px; width: fit-content;
}
.tqh-badge--gold      { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.tqh-badge--green     { background: #dcfce7; color: #166534; }
.tqh-badge--blue      { background: #dbeafe; color: #1e40af; }
.tqh-badge--orange    { background: #ffedd5; color: #9a3412; }
.tqh-badge--red       { background: #fee2e2; color: #dc2626; }
.tqh-badge--open      { background: #dcfce7; color: #166534; }
.tqh-badge--sub       { background: #f0fdf4; color: #004D25; border: 1px solid #86efac; }
.tqh-badge--info      { background: #eff6ff; color: #1e40af; }
.tqh-badge--pending-sm {
    display: inline-block; padding: 2px 6px; border-radius: 4px;
    font-size: .58rem; font-weight: 700; margin-top: 2px; width: fit-content;
    background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe;
}

/* ── Vue détail ── */
.tqh-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 8px; font-size: .83rem; font-weight: 700; color: #475569;
    text-decoration: none; margin-bottom: 18px;
    transition: all .1s;
}
.tqh-back:hover { background: #f0fdf4; border-color: #86efac; color: #004D25; }

.tqh-detail-hd {
    background: #004D25; border-radius: 12px;
    padding: 20px 22px; margin-bottom: 14px; color: #fff;
}
.tqh-detail-date { font-size: 1.2rem; font-weight: 900; margin: 0 0 7px; color: #fff; }
.tqh-detail-meta {
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: .82rem; color: rgba(255,255,255,.8); align-items: center;
}
.tqh-detail-badge { padding: 3px 9px; border-radius: 5px; font-size: .74rem; font-weight: 700; }
.tqh-detail-badge--open    { background: rgba(255,255,255,.2); color: #fff; }
.tqh-detail-badge--pending { background: rgba(245,158,11,.35); color: #fef3c7; }

/* Sections */
.tqh-section {
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 14px; overflow: hidden; margin-bottom: 18px;
}
.tqh-section-hd {
    display: flex; align-items: center; gap: 9px;
    padding: 12px 18px;
    background: #f8fafc; border-bottom: 1px solid #e2e8f0;
    font-size: .9rem; font-weight: 800; flex-wrap: wrap;
}
.tqh-section-hd img { height: 26px; border-radius: 50%; }
.tqh-section-badge  { margin-left: auto; font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 5px; }
.tqh-section--arrival .tqh-section-hd { background: #f0fdf4; border-color: #bbf7d0; }
.tqh-section--pending  { border-color: #e2e8f0; }

/* ── Grille 8 chevaux ── */
.tqh-horses { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; padding: 12px; }
@media(max-width:640px){ .tqh-horses{grid-template-columns:repeat(2,1fr);} }
@media(max-width:360px){ .tqh-horses{grid-template-columns:1fr;} }

.tqh-horse {
    border: 2px solid #e2e8f0; border-radius: 10px;
    padding: 9px 7px; text-align: center; background: #f8fafc; position: relative;
    transition: transform .1s, box-shadow .1s;
}
.tqh-horse:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(0,0,0,.07); }
.tqh-horse--placed { border-color: #86efac !important; background: linear-gradient(135deg,#f0fdf4,#fff); }

/* Case avec image cadenas */
.tqh-horse--locked-img {
    background: #f1f5f9; border: 2px dashed #e2e8f0; border-radius: 10px;
    padding: 9px 7px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.tqh-horse-lock-img img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; opacity: .8; display: block; }

.tqh-horse-num {
    width: 40px; height: 40px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 900; margin: 0 auto 6px; line-height: 1;
}
.tqh-horse-num sub  { font-size: .5em; margin-left: 2px; }
.tqh-horse-info     { display: flex; flex-direction: column; gap: 2px; }
.tqh-horse-nom      { font-size: .69rem; font-weight: 800; color: #0f172a; line-height: 1.3; }
.tqh-horse-role     { font-size: .6rem; font-weight: 700; }
.tqh-horse-cote     { font-size: .58rem; color: #94a3b8; }
.tqh-horse-iris-badge {
    position: absolute; top: 3px; right: 3px;
    background: #004D25; color: #fff;
    font-size: .5rem; font-weight: 800; padding: 2px 4px; border-radius: 4px;
}
.tqh-horse-np-badge {
    position: absolute; top: 3px; right: 3px;
    background: #fee2e2; color: #dc2626;
    font-size: .5rem; font-weight: 800; padding: 2px 4px; border-radius: 4px;
}
.tqh-horses--blurred { opacity: .3; pointer-events: none; }
.tqh-horses-legend {
    padding: 0 12px 10px;
    font-size: .72rem; color: #64748b;
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.tqh-leg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Infos membre */
.tqh-lock-box-full { padding: 24px 18px; text-align: center; background: linear-gradient(135deg,#f8fafc,#fff); }
.tqh-lock-title { font-size: .95rem; font-weight: 800; color: #0f172a; margin: 0 0 7px; }
.tqh-lock-sub   { font-size: .84rem; color: #64748b; margin: 0 0 14px; line-height: 1.6; }
.tqh-lock-btns  { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-bottom: 18px; }
.tqh-lock-btn {
    display: inline-block; padding: 8px 18px; border-radius: 8px;
    font-size: .83rem; font-weight: 700; text-decoration: none; transition: opacity .1s;
}
.tqh-lock-btn--green  { background: #004D25; color: #fff !important; }
.tqh-lock-btn--orange { background: #FF9800; color: #fff !important; }
.tqh-lock-btn:hover { opacity: .87; }

.tqh-member-info { padding: 10px 14px 0; font-size: .81rem; color: #475569; line-height: 1.5; }
.tqh-member-info a { color: #004D25; font-weight: 700; }

/* ── Arrivée officielle ── */
.tqh-arrival-wrap { padding: 12px 16px; }
.tqh-arrival-top5-label {
    font-size: .7rem; font-weight: 700; color: #64748b;
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 9px;
}
.tqh-arrival-top5 { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.tqh-arr-horse { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 50px; }
.tqh-arr-ord   { font-size: .66rem; color: #94a3b8; font-weight: 700; }
.tqh-arr-num {
    width: 46px; height: 46px; border-radius: 10px;
    background: #f1f5f9; color: #475569;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; font-weight: 900;
}
.tqh-arr-num--iris { background: #004D25; color: #fff; box-shadow: 0 0 0 2px #86efac; }
.tqh-arr-label { font-size: .57rem; color: #004D25; font-weight: 800; }

.tqh-arrival-extra {
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
    border-top: 1px solid #e2e8f0; padding-top: 9px; margin-top: 4px;
}
.tqh-arrival-extra-lbl { font-size: .7rem; color: #64748b; font-weight: 700; }
.tqh-arr-num-sm {
    width: 32px; height: 32px; border-radius: 7px;
    background: #f1f5f9; color: #475569;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 800; flex-direction: column;
}
.tqh-arr-num-sm small { font-size: .5rem; }
.tqh-arr-num-sm--iris { background: #dcfce7; color: #004D25; border: 1px solid #86efac; }

/* Résumé résultat */
.tqh-result-summary {
    background: #f8fafc; border-radius: 9px; padding: 11px 13px;
    margin-top: 9px; border: 1px solid #e2e8f0;
}
.tqh-result-badge {
    font-size: .87rem; font-weight: 800; padding: 5px 11px;
    border-radius: 7px; display: inline-block; margin-bottom: 6px;
}
.tqh-result-badge--gold   { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.tqh-result-badge--green  { background: #dcfce7; color: #166534; }
.tqh-result-badge--blue   { background: #dbeafe; color: #1e40af; }
.tqh-result-badge--orange { background: #ffedd5; color: #9a3412; }
.tqh-result-badge--grey   { background: #f1f5f9; color: #475569; }
.tqh-result-detail { font-size: .76rem; color: #64748b; margin: 0; line-height: 1.6; }

/* ── Messages ── */
.tqh-pending-msg { padding: 28px 18px; text-align: center; color: #475569; }
.tqh-pending-msg p { margin: 5px 0; font-size: .88rem; }
.tqh-no-data { padding: 20px; text-align: center; color: #94a3b8; font-size: .84rem; font-style: italic; }
.tqh-no-data--loading { color: #D97706; font-style: normal; font-weight: 600; }

/* ── Page futur ── */
.tqh-future-msg {
    background: linear-gradient(135deg,#f0fdf4,#fff);
    border: 1px solid #86efac; border-radius: 12px;
    padding: 32px 20px; text-align: center; margin-bottom: 18px;
}
.tqh-future-icon  { margin-bottom: 14px; display: flex; justify-content: center; }
.tqh-future-icon svg { filter: drop-shadow(0 3px 8px rgba(0,0,0,.13)); }
.tqh-future-title { font-size: 1.05rem; font-weight: 800; color: #0f172a; margin: 0 0 7px; }
.tqh-future-sub   { font-size: .88rem; color: #475569; margin: 0 0 9px; line-height: 1.6; }
.tqh-future-heure { font-size: .83rem; color: #64748b; margin: 0; }

/* ── Navigation prev / next ── */
.tqh-day-nav {
    display: flex; justify-content: space-between; align-items: stretch;
    gap: 10px; margin-top: 20px;
}
.tqh-day-nav-spacer { flex: 1; }
.tqh-day-nav-btn {
    flex: 1; display: flex; align-items: center; gap: 9px;
    padding: 12px 16px;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    text-decoration: none; color: #0f172a; font-size: .83rem;
    transition: all .1s;
    max-width: 48%;
}
.tqh-day-nav-btn:hover { background: #f0fdf4; border-color: #004D25; color: #004D25; }
.tqh-day-nav-btn--next { justify-content: flex-end; text-align: right; }
.tqh-day-nav-arrow { font-size: 1.5rem; font-weight: 900; color: #004D25; line-height: 1; flex-shrink: 0; }
.tqh-day-nav-lbl { display: flex; flex-direction: column; gap: 1px; }
.tqh-day-nav-lbl small  { font-size: .68rem; color: #94a3b8; font-weight: 600; text-transform: uppercase; }
.tqh-day-nav-lbl strong { font-size: .83rem; }

/* ══════════════════════════════════════════════════════════
   BLOC 3 — PRONOSTIC PRESSE QUINTÉ (format combinaison)
══════════════════════════════════════════════════════════ */
.tqh-section--press { border-top: 3px solid #1E40AF; }

/* Conteneur combinaison */
.tqh-press-combi { display: flex; flex-direction: column; gap: 14px; padding: 12px 0 6px; }

/* Groupe (BASE / COMPLÉMENTS / COUVERTURE) */
.tqh-press-group { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.tqh-press-group-label {
    min-width: 110px; font-size: .7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em;
    padding-top: 10px;
}
.tqh-press-group-horses { display: flex; gap: 8px; flex-wrap: wrap; }

/* Pilule cheval */
.tqh-press-pill {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 7px 10px; min-width: 160px; position: relative;
    transition: box-shadow .12s;
}
.tqh-press-pill--placed {
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
    border-color: transparent;
}
.tqh-press-pill-num {
    width: 44px; height: 44px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 900; flex-shrink: 0; flex-direction: column;
    transition: background .15s;
}
.tqh-press-pill-num sub { font-size: .55rem; line-height: 1; font-weight: 700; margin-top: 1px; }
.tqh-press-pill-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tqh-press-src {
    font-size: .62rem; color: #7C3AED; font-weight: 700;
    background: #f3f0ff; border-radius: 4px; padding: 1px 5px;
    display: inline-block; width: fit-content;
}
.tqh-press-rank-lbl { font-size: .72rem; color: #94a3b8; margin-top: 5px; font-weight: 600; }

/* ══════════════════════════════════════════════════════════
   BLOC 4 — CHEVAL DE LA RÉUNION
══════════════════════════════════════════════════════════ */
.tqh-section--cm { border-top: 3px solid #7C3AED; }
.tqh-cm-card {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px;
    padding: 16px 18px; margin: 14px 0 6px;
    transition: box-shadow .15s;
}
.tqh-cm-card--placed {
    border-color: #7C3AED; background: #faf5ff;
    box-shadow: 0 3px 12px rgba(124,58,237,.14);
}
.tqh-cm-badge-wrap {
    display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
}
.tqh-cm-course {
    font-size: .72rem; font-weight: 700; color: #7C3AED;
    background: #f3f0ff; border-radius: 5px; padding: 2px 8px;
}
.tqh-cm-heure {
    font-size: .72rem; font-weight: 600; color: #64748b;
    background: #f1f5f9; border-radius: 5px; padding: 2px 8px;
}
.tqh-cm-body {
    display: flex; align-items: center; gap: 14px;
}
.tqh-cm-num {
    width: 58px; height: 58px; border-radius: 12px;
    background: #f3f0ff; color: #7C3AED;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 900; flex-shrink: 0;
    flex-direction: column;
}
.tqh-cm-num sub { font-size: .6rem; line-height: 1; font-weight: 700; margin-top: 2px; }
.tqh-cm-num--winner { background: #fef3c7; color: #92400e; box-shadow: 0 0 0 3px #f59e0b; }
.tqh-cm-num--placed { background: #dcfce7; color: #166534; box-shadow: 0 0 0 2px #86efac; }
.tqh-cm-info {
    display: flex; flex-direction: column; gap: 4px;
}
.tqh-cm-result {
    font-size: .82rem; font-weight: 800; border-radius: 6px;
    padding: 3px 9px; display: inline-block; width: fit-content;
}
.tqh-cm-win   { background: #fef3c7; color: #92400e; border: 1px solid #f59e0b; }
.tqh-cm-place { background: #dcfce7; color: #166534; }
.tqh-cm-np    { background: #f1f5f9; color: #64748b; }
.tqh-cm-locked-placeholder { display: flex; justify-content: center; }

@media (max-width: 600px) {
    .tqh-press-horses { grid-template-columns: 1fr; }
    .tqh-cm-num { width: 48px; height: 48px; font-size: 1.2rem; }
}

/* tqh-cm-card--winner (ajout) */
.tqh-cm-card--winner {
    border-color: #f59e0b; background: #fffbeb;
    box-shadow: 0 3px 14px rgba(245,158,11,.2);
}
@media (max-width: 600px) {
    .tqh-press-group { flex-direction: column; gap: 6px; }
    .tqh-press-group-label { min-width: auto; padding-top: 0; }
    .tqh-press-pill { min-width: 0; width: 100%; }
}
