/* ============================================================================
 * ESSAIM CSS V4 — Dashboard Analytique + Bradley-Terry
 * ============================================================================
 * Ajouts V4 :
 *  - KPI Cards (Entropie double, Confiance, Scénario)
 *  - Power Ranking avec barres et catégories
 *  - Indicateur d'incertitude des duels
 *  - Animation "onde de choc" pour l'injection Sigma
 *  - Score BT affiché dans les duels
 *  - Responsive amélioré sur le verdict
 * ============================================================================ */

/* === VARIABLES === */
:root {
    --tbz-bg-body: #f4f7f9;
    --tbz-bg-card: #ffffff;
    --tbz-primary-dark: #033d4d;
    --tbz-primary-mid: #04566c;
    --tbz-accent: #22b8a7;
    --tbz-accent-hover: #1da898;
    --tbz-text-main: #334155;
    --tbz-text-muted: #64748b;
    --tbz-border: #e2e8f0;
    --tbz-gold: #f59e0b;
    --tbz-green: #10b981;
    --tbz-red: #ef4444;
    --tbz-radius: 12px;
    --tbz-shadow: 0 4px 15px rgba(3, 61, 77, 0.08);
}

/* === LAYOUT === */
.tbz-swarm-wrapper { width: 100%; background-color: var(--tbz-bg-body); padding-bottom: 120px; }

#swarm-app {
    font-family: 'Open Sans', sans-serif;
    color: var(--tbz-text-main);
    padding: 20px 15px;
    border-radius: var(--tbz-radius);
    max-width: 1200px;
    margin: 0 auto;
    min-height: 80vh;
    box-sizing: border-box;
}

/* === HEADER === */
.swarm-header { text-align: center; margin-bottom: 20px; position: relative; }
.swarm-header h1 { color: var(--tbz-primary-dark); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 5px; }
.swarm-header p { color: var(--tbz-text-muted); font-size: clamp(0.9rem, 2vw, 1.1rem); margin-bottom: 15px; }

/* === COUNTDOWN === */
.countdown-pill {
    display: inline-block;
    background: #fff;
    border: 2px solid var(--tbz-red);
    color: var(--tbz-red);
    font-weight: 800;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}
.countdown-pill.closed { background: var(--tbz-red); color: white; border-color: var(--tbz-red); }

/* === ACCORDION === */
.tbz-accordion { margin-bottom: 25px; background: #fff; border: 1px solid var(--tbz-border); border-radius: 8px; overflow: hidden; text-align: left; }
.tbz-accordion summary { padding: 15px; font-weight: 800; color: var(--tbz-primary-mid); cursor: pointer; background: #f8fafc; outline: none; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.tbz-accordion summary::-webkit-details-marker { display: none; }
.tbz-accordion summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; transition: transform 0.3s; color: var(--tbz-accent); }
.tbz-accordion[open] summary::after { transform: rotate(180deg); }
.tbz-accordion .acc-content { padding: 15px; border-top: 1px solid var(--tbz-border); font-size: 0.95rem; color: var(--tbz-text-main); line-height: 1.6; }

/* === SCREENS & ANIMATIONS === */
.swarm-screen { display: none; animation: fadeIn 0.4s ease; }
.swarm-screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* === PANELS === */
.tbz-panel {
    background: var(--tbz-bg-card);
    border: 1px solid var(--tbz-border);
    border-radius: var(--tbz-radius);
    padding: clamp(15px, 3vw, 25px);
    box-shadow: var(--tbz-shadow);
    height: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
}
.tbz-panel h2 {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 800;
    color: var(--tbz-primary-mid);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--tbz-border);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media(min-width: 992px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* === FORM ELEMENTS === */
.tbz-input {
    width: 100%; padding: 12px 15px; border: 2px solid var(--tbz-border); border-radius: 8px;
    font-size: 1rem; font-weight: 600; outline: none; transition: border-color 0.3s;
    color: var(--tbz-primary-dark); box-sizing: border-box;
}
.tbz-input:focus { border-color: var(--tbz-gold); }

.tbz-select {
    width: 100%; padding: 12px 10px; border: 2px solid var(--tbz-border); border-radius: 8px;
    font-weight: 600; color: var(--tbz-primary-dark); cursor: pointer; outline: none;
    font-size: 0.95rem; background: #fff; box-sizing: border-box;
}
.tbz-select:focus { border-color: var(--tbz-accent); }

/* === PARTICIPANTS === */
.participant-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-bottom: 1px solid var(--tbz-border); }
.p-avatar { width: 35px; height: 35px; border-radius: 50%; background: linear-gradient(135deg, var(--tbz-primary-mid), var(--tbz-accent)); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; }
.p-name { font-weight: 600; font-size: 0.95rem; word-break: break-all; }

/* === HORSE CARDS === */
.horse-card { display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 8px; background: #f8fafc; border: 1px solid var(--tbz-border); border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.horse-card:hover { border-color: var(--tbz-primary-mid); background: #f1f5f9; }
.horse-card.selected { border-color: var(--tbz-red); background: #fef2f2; }
.horse-card.eliminated { opacity: 0.3; pointer-events: none; filter: grayscale(1); }
.h-num { width: 28px; height: 28px; border-radius: 50%; background: var(--tbz-primary-dark); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; font-size: 0.85rem; }
.h-meta { flex: 1; min-width: 0; }
.h-name { font-weight: 800; font-size: 0.95rem; color: var(--tbz-primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-sub { font-size: 0.75rem; color: var(--tbz-text-muted); }

/* === SLIDERS === */
.slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; background: #f8fafc; padding: 15px 12px; border-radius: 8px; border: 1px solid var(--tbz-border); flex-wrap: wrap; }
.sl-label { flex: 1 1 100%; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--tbz-primary-dark); }
.sl-input { flex: 1 1 60%; -webkit-appearance: none; height: 10px; background: #e2e8f0; border-radius: 5px; outline: none; }
.sl-input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--tbz-gold); cursor: pointer; box-shadow: 0 0 5px rgba(245, 158, 11, 0.5); }
.sl-input::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--tbz-gold); cursor: pointer; border: none; }
.sl-val { flex: 0 0 45px; text-align: right; font-weight: 900; color: var(--tbz-gold); font-size: 1.1rem; }
@media(min-width: 768px) { .slider-row { flex-wrap: nowrap; padding: 12px 15px; } .sl-label { flex: 0 0 180px; margin-bottom: 0; } }

/* === EXPERT QUESTIONS === */
.expert-q { margin-bottom: 15px; padding: 15px; background: #f8fafc; border-left: 4px solid var(--tbz-primary-mid); border-radius: 8px; border: 1px solid var(--tbz-border); border-left-width: 4px; }
.expert-q label { display: block; font-weight: 800; font-size: 0.95rem; color: var(--tbz-primary-dark); margin-bottom: 8px; }
.expert-q .q-hint { font-size: 0.8rem; color: var(--tbz-text-muted); margin-top: 5px; font-style: italic; line-height: 1.4; }

/* === BUTTONS === */
.tbz-btn {
    display: inline-block; padding: 15px 20px; background: var(--tbz-accent); color: white; border: none;
    border-radius: 8px; font-weight: 800; font-size: 1rem; cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(34, 184, 167, 0.3); text-align: center; text-transform: uppercase;
    width: 100%; box-sizing: border-box; text-decoration: none !important;
}
.tbz-btn:hover:not(:disabled) { background: var(--tbz-accent-hover); transform: translateY(-2px); color: white; }
.tbz-btn:disabled { background: #e2e8f0; cursor: not-allowed; box-shadow: none; color: #94a3b8; transform: none; }
.tbz-btn-secondary { background: var(--tbz-primary-dark); box-shadow: 0 4px 10px rgba(3, 61, 77, 0.3); }
.tbz-btn-secondary:hover:not(:disabled) { background: var(--tbz-primary-mid); }

/* === PHASE TRACKER === */
.phase-tracker {
    display: flex; justify-content: flex-start; margin-bottom: 25px; border-bottom: 3px solid var(--tbz-border);
    padding-bottom: 15px; overflow-x: auto; gap: 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.phase-tracker::-webkit-scrollbar { display: none; }
.phase-step {
    font-weight: 700; font-size: 0.85rem; color: var(--tbz-text-muted); padding: 8px 15px;
    border-radius: 20px; transition: all 0.3s; white-space: nowrap; background: white;
    border: 1px solid var(--tbz-border); flex-shrink: 0;
}
.phase-step.active { background: var(--tbz-primary-mid); color: white; border-color: var(--tbz-primary-mid); box-shadow: 0 4px 10px rgba(3, 61, 77, 0.2); }
.phase-step.done { color: var(--tbz-accent); border-color: var(--tbz-accent); background: #f0fdfa; }

/* === SCROLL BOX === */
.scroll-box { max-height: 50vh; overflow-y: auto; padding-right: 5px; }
.scroll-box::-webkit-scrollbar { width: 6px; }
.scroll-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* === SWARM BADGES === */
.swarm-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; color: white; margin-left: 5px; }
.bg-alpha { background-color: #f59e0b; }
.bg-beta { background-color: #3b82f6; }
.bg-gamma { background-color: #10b981; }
.bg-delta { background-color: #8b5cf6; }
.bg-sigma { background-color: #f43f5e; }
.bg-omega { background-color: #0ea5e9; }

/* === SWARM RESULTS === */
.swarm-results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.swarm-result-card { background: var(--tbz-bg-card); border: 1px solid var(--tbz-border); padding: 20px; border-radius: var(--tbz-radius); text-align: center; box-shadow: var(--tbz-shadow); display: flex; flex-direction: column; justify-content: center; position: relative; min-height: 140px; }
.swarm-result-card.highlight { border: 3px solid var(--tbz-accent); background: #f0fdfa; transform: translateY(-4px); box-shadow: 0 8px 20px rgba(34, 184, 167, 0.2); }
.swarm-result-card.highlight::before { content: 'Votre contribution'; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--tbz-accent); color: #fff; padding: 4px 14px; border-radius: 12px; font-size: 0.8rem; font-weight: 900; white-space: nowrap; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15); }
.swarm-result-title { font-size: 1.15rem; font-weight: 900; color: var(--tbz-primary-mid); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.swarm-result-ticket { font-size: 1.4rem; font-weight: 900; color: var(--tbz-primary-dark); letter-spacing: 2px; margin-bottom: 8px; }
.swarm-result-stats { font-size: 0.85rem; color: var(--tbz-text-muted); font-weight: 600; }

/* === LOCKED VERDICT === */
.locked-verdict-banner { background: linear-gradient(135deg, var(--tbz-primary-dark), var(--tbz-primary-mid)); color: #fff; padding: 40px 20px; border-radius: var(--tbz-radius); text-align: center; box-shadow: 0 10px 30px rgba(3, 61, 77, 0.3); position: relative; overflow: hidden; }
.locked-icon { font-size: 3.5rem; color: var(--tbz-gold); margin-bottom: 20px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2)); }
.locked-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 15px; letter-spacing: 0.5px; }
.locked-text { font-size: 1.1rem; color: #cbd5e1; margin-bottom: 30px; line-height: 1.6; max-width: 600px; margin-left: auto; margin-right: auto; }

/* === PODIUM (conservé pour rétrocompat) === */
.podium-modern-wrapper { display: flex; justify-content: center; align-items: flex-end; gap: 12px; min-height: 280px; padding-top: 40px; margin-bottom: 30px; flex-wrap: nowrap; overflow: visible; }
.podium-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 95px; }
.podium-bar { width: 100%; border-radius: 8px 8px 0 0; position: relative; box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15); display: flex; justify-content: center; }
.podium-rank-badge { position: absolute; top: -22px; width: 38px; height: 38px; background: #fff; border: 4px solid; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 1.2rem; color: var(--tbz-primary-dark); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 2; }
.podium-label { margin-top: 0; background: var(--tbz-primary-dark); color: #fff; font-size: 0.8rem; font-weight: 800; padding: 12px 6px; border-radius: 0 0 8px 8px; text-align: center; width: 100%; line-height: 1.3; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); box-sizing: border-box; }
.p1 { height: 180px; background: linear-gradient(to top, #b45309, #fbbf24); }
.p1 .podium-rank-badge { border-color: #fbbf24; }
.p2 { height: 140px; background: linear-gradient(to top, #475569, #cbd5e1); }
.p2 .podium-rank-badge { border-color: #cbd5e1; }
.p3 { height: 100px; background: linear-gradient(to top, #78350f, #d97706); }
.p3 .podium-rank-badge { border-color: #d97706; }
.p4 { height: 70px; background: linear-gradient(to top, #0f172a, #334155); }
.p4 .podium-rank-badge { border-color: #334155; }
.p5 { height: 40px; background: linear-gradient(to top, #0f172a, #334155); }
.p5 .podium-rank-badge { border-color: #334155; }

@media(min-width: 576px) {
    .podium-modern-wrapper { gap: 20px; }
    .podium-col { width: 120px; }
    .podium-label { font-size: 0.9rem; }
    .podium-rank-badge { width: 44px; height: 44px; top: -24px; font-size: 1.4rem; border-width: 5px; }
    .p1 { height: 220px; } .p2 { height: 170px; } .p3 { height: 120px; } .p4 { height: 85px; } .p5 { height: 55px; }
}


/* ============================================================================
 * V4 : NOUVELLES CLASSES POUR LE DASHBOARD ANALYTIQUE
 * ============================================================================ */

/* === V4 — KPI CARDS ROW === */
.v4-kpi-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
    text-align: left;
}

.v4-kpi-card {
    background: #fff;
    border: 1px solid var(--tbz-border);
    border-left: 4px solid var(--tbz-accent);
    padding: 15px;
    border-radius: 8px;
    flex: 1;
    min-width: 170px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.v4-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.v4-kpi-label {
    font-size: 0.75rem;
    color: var(--tbz-text-muted);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.5px;
}
.v4-kpi-value {
    font-size: 1.6rem;
    font-weight: 900;
    color: #0f172a;
    margin: 5px 0;
    line-height: 1.2;
}
.v4-kpi-detail {
    font-size: 0.8rem;
    color: var(--tbz-text-muted);
}

/* Variantes de bordure gauche par type */
.v4-kpi-card.scenario { border-left-color: var(--tbz-gold); }
.v4-kpi-card.entropy-low { border-left-color: var(--tbz-green); }
.v4-kpi-card.entropy-mid { border-left-color: var(--tbz-gold); }
.v4-kpi-card.entropy-high { border-left-color: var(--tbz-red); }
.v4-kpi-card.confidence-haute { border-left-color: var(--tbz-green); }
.v4-kpi-card.confidence-moyenne { border-left-color: var(--tbz-gold); }
.v4-kpi-card.confidence-faible { border-left-color: var(--tbz-red); }
.v4-kpi-card.divergence { border-left-color: var(--tbz-primary-mid); }

/* === V4 — POWER RANKING === */
.v4-power-ranking {
    max-width: 700px;
    margin: 0 auto 30px;
}
.v4-power-ranking-title {
    color: var(--tbz-primary-dark);
    font-size: 1.1rem;
    margin-top: 25px;
    margin-bottom: 5px;
    text-align: center;
    text-transform: uppercase;
    font-weight: 800;
}
.v4-power-ranking-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--tbz-text-muted);
    margin-bottom: 15px;
}

.v4-pr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-left: 3px solid var(--tbz-border);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}
.v4-pr-row:hover {
    background: #f1f5f9 !important;
}
.v4-pr-row.top5 {
    background: #f0fdfa;
    border-left-color: var(--tbz-green);
}
.v4-pr-row.top7 {
    background: #fffbeb;
    border-left-color: var(--tbz-gold);
}
.v4-pr-rank {
    width: 28px;
    font-weight: 900;
    color: #94a3b8;
    text-align: right;
    flex-shrink: 0;
}
.v4-pr-num {
    width: 32px;
    height: 32px;
    background: var(--tbz-primary-dark);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    flex-shrink: 0;
}
.v4-pr-name {
    flex: 1;
    font-weight: 700;
    color: var(--tbz-primary-dark);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.v4-pr-score {
    width: 55px;
    text-align: right;
    font-weight: 900;
    color: var(--tbz-primary-dark);
}
.v4-pr-cote {
    width: 45px;
    text-align: right;
    font-size: 0.8rem;
    color: #94a3b8;
}
.v4-pr-cat {
    width: 22px;
    text-align: center;
}
.v4-pr-bar-wrapper {
    width: 100px;
    background: #e2e8f0;
    border-radius: 3px;
    height: 8px;
    flex-shrink: 0;
    overflow: hidden;
}
.v4-pr-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.v4-pr-bar.top { background: var(--tbz-accent); }
.v4-pr-bar.other { background: #94a3b8; }

/* === V4 — DUEL UNCERTAINTY INDICATOR === */
.v4-duel-uncertainty {
    font-size: 0.85rem;
    font-weight: normal;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}
.v4-duel-uncertainty.high {
    color: var(--tbz-red);
    background: #fef2f2;
}
.v4-duel-uncertainty.low {
    color: var(--tbz-green);
    background: #f0fdf4;
}

/* V4 — BT Score badge dans les cartes de duel */
.v4-bt-badge {
    font-size: 0.8rem;
    color: var(--tbz-accent);
    font-weight: 700;
    margin-bottom: 8px;
}

/* === V4 — ESSAIM GROUPE CARD === */
.v4-swarm-card {
    background: #fff;
    border-top: 4px solid var(--tbz-accent);
    border-radius: 8px;
    padding: 15px;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    transition: transform 0.2s ease;
}
.v4-swarm-card:hover {
    transform: translateY(-3px);
}
.v4-swarm-card-title {
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-size: 1rem;
    letter-spacing: 1px;
}
.v4-swarm-card-signal {
    font-size: 0.75rem;
    color: var(--tbz-text-muted);
    margin-top: 8px;
}

/* V4 — Cheval numéro dans les groupes */
.v4-swarm-horse-num {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 26px;
    font-weight: 900;
    margin: 0 3px;
    border: 2px solid;
    font-size: 0.9rem;
}

/* === V4 — ANIMATION SIGMA INJECTION === */
@keyframes sigmaWave {
    0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(244, 63, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}
.v4-sigma-pulse {
    animation: sigmaWave 2s ease-in-out 3;
}

/* ============================================================================
 * V5 : INDICATOR SELECTOR (Phase 0)
 * ============================================================================ */

.indicator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
}

@media (max-width: 480px) {
    .indicator-grid {
        grid-template-columns: 1fr;
    }
}

.indicator-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 2px solid var(--tbz-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.indicator-chip:hover {
    border-color: var(--tbz-primary-mid);
    background: #f8fafc;
    transform: translateY(-1px);
}

.indicator-chip.selected {
    border-color: var(--tbz-accent);
    background: #f0fdfa;
    box-shadow: 0 2px 8px rgba(34, 184, 167, 0.15);
}

.indicator-chip .ind-emoji {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.indicator-chip .ind-label {
    flex: 1;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--tbz-primary-dark);
    line-height: 1.2;
}

.indicator-chip .ind-check {
    flex-shrink: 0;
    font-size: 1.1rem;
    color: #cbd5e1;
    transition: color 0.2s;
}

.indicator-chip.selected .ind-check {
    color: var(--tbz-accent);
}

/* Casaque images in cards */
.casaque-img {
    width: 22px;
    height: 26px;
    vertical-align: middle;
    border-radius: 2px;
    margin-right: 6px;
}

/* Puriste details toggle */
.puriste-details summary {
    cursor: pointer;
    font-weight: bold;
    outline: none;
    color: var(--tbz-primary-mid);
}

.puriste-details[open] summary {
    margin-bottom: 8px;
}

/* === V4 — USER RECAP === */
.v4-user-recap {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-left: 5px solid var(--tbz-primary-mid);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

/* === V4 — PROVISOIRE BADGE === */
.v4-badge-provisoire {
    font-size: 0.8rem;
    background: var(--tbz-red);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    vertical-align: middle;
    font-weight: bold;
    display: inline-block;
    margin-left: 8px;
    animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.v4-badge-final {
    font-size: 0.8rem;
    background: var(--tbz-green);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    vertical-align: middle;
    font-weight: bold;
    display: inline-block;
    margin-left: 8px;
}

/* === V4/V5 — RESPONSIVE OVERRIDES === */
@media (max-width: 768px) {
    .v4-kpi-row {
        flex-direction: column;
    }
    .v4-kpi-card {
        min-width: 100%;
    }
    .v4-pr-bar-wrapper {
        width: 60px;
    }
    .v4-pr-name {
        max-width: 100px;
    }
    .v4-pr-cote {
        display: none;
    }
    #duel-container {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    #duel-container > div:not(.duel-card) {
        padding: 8px 0 !important;
        font-size: 1.3rem !important;
    }
    .indicator-grid {
        grid-template-columns: 1fr;
    }
    .tinder-card h3 {
        font-size: 1.15rem !important;
    }
}

@media (max-width: 480px) {
    .v4-pr-bar-wrapper {
        display: none;
    }
    .v4-pr-row {
        gap: 6px;
        padding: 8px 8px;
        font-size: 0.85rem;
    }
}
