/* =============================================================================
   JE TESTE MON TÉLÉPHONE - pages publiques (v2.0.0)
   Même visuel que le mode joueur de Roadbook 1.17 : écran sombre, police Manrope,
   accent violet du thème Roadbook en production (#7c3aed), boutons plats, pastilles.
   L'administration garde style.css (ce fichier n'est chargé que par index, tests,
   demo et result).
   ============================================================================= */

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #a78bfa;
    --primary-rgb: 124, 58, 237;
    --success: #28a745;
    --success-light: #6fdc8c;
    --warning: #ffc107;
    --danger: #dc3545;
    --danger-light: #ff8a8a;
    --abg: #0d0f15;
    --asf: #161a24;
    --asf2: #1f2431;
    --atx: #f3f4f8;
    --amu: #9aa1b1;
    --aln: #2a3040;
    --aglass: rgba(255, 255, 255, 0.08);
    --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--abg);
    color: var(--atx);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary-light); }
svg { fill: currentColor; }
.muted { color: var(--amu); }
.small { font-size: 0.82rem; }
.center { text-align: center; }

.container { max-width: 520px; margin: 0 auto; padding: 0.5rem 1rem 2rem; }

/* --- Bandeau (façon HUD Roadbook) --- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    background: rgba(13, 15, 21, 0.92);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--aln);
}
.app-header-inner { display: flex; justify-content: space-between; align-items: center; gap: 8px; max-width: 520px; margin: 0 auto; }
.app-logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1rem; color: var(--atx); text-decoration: none; }
.app-logo-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); display: grid; place-items: center; font-size: 0.95rem; }
.header-actions { display: flex; align-items: center; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 999px;
    background: var(--aglass);
    color: var(--atx);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    border: 0;
    cursor: pointer;
}
.chip svg { width: 15px; height: 15px; }
.btn-quit { color: var(--danger-light); }

/* --- Titres d'écran --- */
.kicker { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-light); font-weight: 800; }
.screen-title { font-size: 1.5rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; margin: 2px 0 6px; }
.screen-head { margin: 14px 0 12px; }
.text { color: var(--amu); font-size: 0.95rem; line-height: 1.45; }
.text strong { color: var(--atx); }

/* --- Boutons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius);
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; box-shadow: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.35); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 10px 24px rgba(40, 167, 69, 0.3); }
.btn-warning { background: var(--warning); color: #3d2a00; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: var(--asf2); color: var(--atx); }
.btn-ghost { background: transparent; color: var(--amu); min-height: 44px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 60px; font-size: 1.08rem; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 0.88rem; border-radius: 12px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1 1 0; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 1.25rem; }

/* --- Cartes, alertes --- */
.card, .result-card, .step-card, .score-container, .bench-card, .welcome-box {
    background: var(--asf);
    border: 1px solid var(--aln);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 14px;
}
.result-card h3, .bench-card h3 {
    font-size: 0.98rem;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; font-size: 0.92rem; line-height: 1.4; border: 1px solid transparent; }
.alert-success { background: rgba(40, 167, 69, 0.16); color: var(--success-light); }
.alert-error { background: rgba(220, 53, 69, 0.18); color: var(--danger-light); }
.alert-warning { background: rgba(255, 193, 7, 0.14); color: var(--warning); border-color: rgba(255, 193, 7, 0.35); }
.alert-info { background: rgba(var(--primary-rgb), 0.16); color: #d8ccff; }
.alert a { color: inherit; font-weight: 800; }
.card-ok { border-color: rgba(40, 167, 69, 0.55); }
.card-ko { border-color: rgba(220, 53, 69, 0.6); }

/* =============================================================================
   Accueil
   ============================================================================= */
.welcome-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(24px + env(safe-area-inset-top)) 16px 24px;
    background: radial-gradient(120% 60% at 50% 0%, rgba(var(--primary-rgb), 0.35), transparent 70%), var(--abg);
}
.welcome-icon {
    width: 84px; height: 84px;
    border-radius: 26px;
    background: var(--primary);
    display: grid; place-items: center;
    font-size: 2.6rem;
    margin-bottom: 16px;
    box-shadow: 0 18px 40px rgba(var(--primary-rgb), 0.45);
}
.welcome-title { font-size: 1.7rem; font-weight: 800; text-align: center; letter-spacing: -0.01em; }
.welcome-subtitle { color: var(--amu); text-align: center; margin: 4px 0 22px; }
.welcome-box { width: 100%; max-width: 440px; padding: 20px; }
.welcome-box h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 12px; }
.device-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.device-info p { background: var(--asf2); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; font-size: 0.92rem; font-weight: 700; }
.device-info strong { color: var(--amu); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 800; }
.feature-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 18px; }
.feature-chips span { padding: 5px 11px; border-radius: 999px; background: rgba(var(--primary-rgb), 0.18); color: #d8ccff; font-size: 0.78rem; font-weight: 700; }
.ok-text { color: var(--success-light); }
.ko-text { color: var(--danger-light); }
.admin-link { display: block; margin-top: 18px; text-align: center; color: var(--amu); font-size: 0.8rem; text-decoration: none; }
.version-tag { margin-top: 14px; font-size: 0.7rem; color: var(--amu); }
.scroll-hint { margin-top: 18px; text-align: center; }
.scroll-hint a { color: var(--amu); text-decoration: none; font-size: 0.85rem; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.scroll-arrow { font-size: 1.2rem; animation: bounce-arrow 1.5s ease infinite; }
@keyframes bounce-arrow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* =============================================================================
   Autorisations GPS / appareil photo (préparation du test)
   ============================================================================= */
.perm-card { background: var(--asf); border: 1px solid var(--aln); border-radius: 20px; padding: 16px; margin-bottom: 14px; }
.perm-list { list-style: none; display: grid; gap: 8px; margin: 10px 0 12px; }
.perm-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--asf2); }
.perm-ico { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--primary-rgb), 0.22); color: var(--primary-light); flex: 0 0 auto; }
.perm-ico svg { width: 20px; height: 20px; }
.perm-label { font-weight: 800; flex: 1; }
.perm-state { font-size: 0.78rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--aglass); color: var(--amu); white-space: nowrap; }
.perm-item[data-state="granted"] .perm-state { background: rgba(40, 167, 69, 0.18); color: var(--success-light); }
.perm-item[data-state="denied"] .perm-state,
.perm-item[data-state="off"] .perm-state { background: rgba(220, 53, 69, 0.18); color: var(--danger-light); }
.perm-item[data-state="prompt"] .perm-state { background: rgba(255, 193, 7, 0.16); color: var(--warning); }
.perm-item[data-state="granted"] .perm-ico { background: rgba(40, 167, 69, 0.2); color: var(--success-light); }

/* Aide pour débloquer (Android / iPhone) */
.unlock {
    margin-top: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.4);
    display: grid;
    gap: 10px;
}
.unlock[hidden] { display: none; }
.unlock-title { font-weight: 800; color: var(--danger-light); display: flex; align-items: center; gap: 8px; }
.unlock-steps { padding-left: 1.2rem; color: var(--atx); font-size: 0.9rem; display: grid; gap: 4px; }
.unlock-steps b { color: #fff; }
.unlock-note { color: var(--amu); font-size: 0.8rem; line-height: 1.4; }
.unlock .btn { min-height: 48px; font-size: 0.95rem; }
/* Panneau « Autorisation nécessaire » (remonte du bas de l'écran) */
.set-sheet-bd { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, 0.6); }
.set-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 901;
    max-width: 560px;
    margin: 0 auto;
    background: var(--asf);
    border-top: 1px solid var(--aln);
    border-radius: 24px 24px 0 0;
    padding: 10px 18px calc(18px + env(safe-area-inset-bottom));
    display: grid;
    gap: 12px;
    animation: setUp 0.25s ease;
}
@keyframes setUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.set-sheet[hidden], .set-sheet-bd[hidden], .set-sheet [hidden] { display: none !important; }
.set-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--aln); margin: 0 auto 4px; }
.set-title { font-size: 1.2rem; font-weight: 800; }
.set-sheet .unlock-steps:empty { display: none; }
.kbd { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--asf2); border: 1px solid var(--aln); font-weight: 800; }

/* =============================================================================
   Tests de compatibilité
   ============================================================================= */
.progress-bar { width: 100%; height: 6px; border-radius: 999px; background: var(--aln); overflow: hidden; margin: 10px 0 6px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.5s ease; }
.progress-fill.good { background: var(--success); }
.progress-fill.medium { background: var(--warning); }
.progress-fill.bad { background: var(--danger); }
.progress-text { text-align: center; font-size: 0.78rem; color: var(--amu); font-weight: 700; margin-bottom: 12px; }

.tests-list { display: grid; gap: 8px; }
.test-item {
    background: var(--asf);
    border: 1px solid var(--aln);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}
.test-item.pending { opacity: 0.55; }
.test-item.running { border-color: rgba(var(--primary-rgb), 0.7); }
.test-item.passed { border-color: rgba(40, 167, 69, 0.55); }
.test-item.partial { border-color: rgba(255, 193, 7, 0.55); }
.test-item.failed { border-color: rgba(220, 53, 69, 0.65); }
.test-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; flex: 0 0 auto; background: var(--asf2); }
.test-icon.running { background: rgba(var(--primary-rgb), 0.25); animation: pulse 1.5s infinite; }
.test-icon.passed { background: rgba(40, 167, 69, 0.22); }
.test-icon.partial { background: rgba(255, 193, 7, 0.2); }
.test-icon.failed { background: rgba(220, 53, 69, 0.22); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.test-info { flex: 1; min-width: 0; }
.test-name { font-weight: 800; font-size: 0.98rem; }
.test-detail { font-size: 0.8rem; color: var(--amu); overflow-wrap: anywhere; }
.test-item.passed .test-detail { color: var(--success-light); }
.test-item.failed .test-detail { color: var(--danger-light); }
.test-item.partial .test-detail { color: var(--warning); }
.test-badge { font-size: 0.72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--aglass); color: var(--amu); }
.test-badge.ok { background: rgba(40, 167, 69, 0.2); color: var(--success-light); }
.test-badge.warn { background: rgba(255, 193, 7, 0.18); color: var(--warning); }
.test-badge.ko { background: rgba(220, 53, 69, 0.2); color: var(--danger-light); }
.test-item .unlock { flex: 1 1 100%; margin-top: 2px; }

.score-container { text-align: center; padding: 22px 18px; margin-top: 14px; }
.score-circle {
    width: 120px; height: 120px;
    border-radius: 50%;
    display: grid; place-items: center;
    margin: 0 auto 12px;
    font-size: 2rem; font-weight: 800; color: #fff;
    background: var(--asf2);
    box-shadow: 0 0 0 6px var(--asf), 0 0 0 8px var(--aln);
}
.score-circle.good { background: var(--success); box-shadow: 0 0 0 6px var(--asf), 0 0 0 8px rgba(40, 167, 69, 0.5), 0 18px 40px rgba(40, 167, 69, 0.3); }
.score-circle.medium { background: #c98f00; box-shadow: 0 0 0 6px var(--asf), 0 0 0 8px rgba(255, 193, 7, 0.5); }
.score-circle.bad { background: var(--danger); box-shadow: 0 0 0 6px var(--asf), 0 0 0 8px rgba(220, 53, 69, 0.5); }
.score-label { font-size: 1.05rem; font-weight: 800; }
.score-message { color: var(--amu); font-size: 0.9rem; margin-top: 4px; }

/* =============================================================================
   Parcours démo
   ============================================================================= */
.step-nav { display: flex; justify-content: center; gap: 6px; margin: 14px 0; }
.step-dot { width: 26px; height: 5px; border-radius: 3px; background: var(--aln); transition: all 0.3s; }
.step-dot.active { background: var(--primary-light); width: 42px; }
.step-dot.completed { background: var(--success); }
.step-card { padding: 0; overflow: hidden; }
.step-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--aln); }
.step-number { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-light); font-weight: 800; }
.step-status { font-size: 0.78rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--aglass); color: var(--amu); }
.step-body { padding: 16px; }
.step-body h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; }
.step-body p { color: var(--amu); }
.tab-bar { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--asf2); margin-bottom: 12px; }
.tab-btn { flex: 1; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--amu); font: inherit; font-weight: 800; font-size: 0.85rem; cursor: pointer; }
.tab-btn.active { background: rgba(var(--primary-rgb), 0.3); color: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.directions-box { background: var(--asf2); border-radius: 14px; padding: 14px; margin-bottom: 12px; border-left: 4px solid var(--primary); }
.directions-box h4 { color: var(--primary-light); margin-bottom: 6px; }
.directions-box p { color: var(--atx); }
.nav-buttons { display: flex; gap: 8px; margin-top: 12px; }
.nav-buttons .btn { flex: 1; min-height: 50px; font-size: 0.92rem; }
.camera-section { text-align: center; }
.camera-preview-area { background: #000; border-radius: 18px; min-height: 200px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; overflow: hidden; position: relative; }
.camera-preview-area video { width: 100%; height: 100%; object-fit: cover; }
.camera-preview-area img { width: 100%; max-height: 300px; object-fit: contain; }
.camera-placeholder { color: var(--amu); font-size: 3rem; }
.camera-fullscreen-overlay { display: none; position: fixed; inset: 0; background: #000; z-index: 10000; flex-direction: column; }
.camera-fullscreen-overlay.active { display: flex; }
.camera-fullscreen-header { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 16px 14px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent); color: #fff; font-weight: 800; position: relative; z-index: 2; }
.camera-close-btn { background: rgba(255, 255, 255, 0.16); border: 0; color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; display: grid; place-items: center; }
.camera-fullscreen-video { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-top: -70px; }
.camera-fullscreen-video video { width: 100%; height: 100%; object-fit: cover; }
.camera-fullscreen-actions { padding: 28px 24px calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); display: flex; justify-content: center; margin-top: -120px; position: relative; z-index: 2; }
.camera-capture-btn { width: 82px; height: 82px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, 0.45); background: #fff; background-clip: padding-box; box-shadow: 0 0 0 3px #fff, 0 10px 30px rgba(0, 0, 0, 0.5); color: transparent; font-size: 0; cursor: pointer; display: block; padding: 0; }
.camera-capture-btn:active { transform: scale(0.92); }
.question-item { background: var(--asf2); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.question-text { font-weight: 800; margin-bottom: 10px; font-size: 1.02rem; color: var(--atx); }
.question-options { display: grid; gap: 8px; }
.option-btn { width: 100%; padding: 13px 14px; border: 2px solid var(--aln); border-radius: 14px; background: var(--asf); color: var(--atx); font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.option-btn:hover, .option-btn.selected { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.18); }
.option-btn.correct { border-color: var(--success); background: rgba(40, 167, 69, 0.18); }
.question-input { width: 100%; min-height: 52px; padding: 0 14px; border: 2px solid var(--aln); border-radius: 14px; background: var(--asf2); color: var(--atx); font: inherit; font-size: 1rem; font-weight: 700; }
.question-input::placeholder { color: var(--amu); font-weight: 500; }
.question-input:focus { border-color: var(--primary); outline: none; }
.stability-tests { display: grid; gap: 10px; }
.stability-item { background: var(--asf2); border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.stability-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.2rem; flex: 0 0 auto; background: rgba(var(--primary-rgb), 0.2); }
.stability-info { flex: 1; }
.stability-info h4 { font-size: 0.95rem; font-weight: 800; }
.stability-info p { font-size: 0.8rem; color: var(--amu); }
.stability-status { font-weight: 800; font-size: 0.85rem; color: var(--amu); }
.chrono-display { background: var(--abg); color: #fff; font-variant-numeric: tabular-nums; font-size: 2.4rem; font-weight: 800; text-align: center; padding: 16px; border-radius: 14px; margin: 10px 0; letter-spacing: 0.04em; border: 1px solid var(--aln); }
.chrono-controls { display: flex; gap: 8px; justify-content: center; }
.chrono-controls .btn { flex: 1; }
.photo-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: 0.85rem; font-weight: 700; margin-top: 8px; }
.photo-status.success { background: rgba(40, 167, 69, 0.16); color: var(--success-light); }
.photo-status.error { background: rgba(220, 53, 69, 0.18); color: var(--danger-light); }
.gps-coords { background: var(--abg); color: var(--success-light); font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: 0.8rem; padding: 10px 12px; border-radius: 12px; margin-top: 8px; border: 1px solid var(--aln); }
.feedback-ok { color: var(--success-light); font-weight: 700; }
.feedback-ko { color: var(--danger-light); font-weight: 700; }

/* =============================================================================
   Rapport
   ============================================================================= */
.result-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--aln); }
.result-item:last-child { border-bottom: 0; }
.result-label { font-weight: 700; }
.result-crit { font-size: 0.68rem; color: var(--danger-light); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.result-value { font-size: 0.78rem; color: var(--amu); text-align: right; max-width: 62%; overflow-wrap: anywhere; }
.result-status { font-weight: 800; font-size: 0.78rem; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.result-status.ok { background: rgba(40, 167, 69, 0.18); color: var(--success-light); }
.result-status.partial { background: rgba(255, 193, 7, 0.16); color: var(--warning); }
.result-status.ko { background: rgba(220, 53, 69, 0.18); color: var(--danger-light); }
.result-status.na { background: var(--aglass); color: var(--amu); }
.verdict-box { text-align: center; padding: 20px 16px; border-radius: 20px; margin: 10px 0 14px; background: var(--asf); border: 1px solid var(--aln); }
.verdict-box.compatible { border-color: rgba(40, 167, 69, 0.6); background: linear-gradient(160deg, rgba(40, 167, 69, 0.18), var(--asf) 70%); }
.verdict-box.partial-compatible { border-color: rgba(255, 193, 7, 0.6); background: linear-gradient(160deg, rgba(255, 193, 7, 0.16), var(--asf) 70%); }
.verdict-box.incompatible { border-color: rgba(220, 53, 69, 0.6); background: linear-gradient(160deg, rgba(220, 53, 69, 0.18), var(--asf) 70%); }
.verdict-icon { font-size: 2.8rem; margin-bottom: 4px; }
.verdict-title { font-size: 1.45rem; font-weight: 800; }
.verdict-message { color: var(--amu); font-size: 0.92rem; }
.problem-list { padding-left: 1.2rem; color: var(--danger-light); display: grid; gap: 4px; }
.event-box { background: rgba(var(--primary-rgb), 0.16); border-radius: 14px; padding: 12px; text-align: center; margin-bottom: 12px; }
.event-box span { color: var(--amu); font-size: 0.78rem; }
.event-box strong { display: block; color: #fff; font-size: 1.05rem; }
.field { margin-bottom: 10px; }
.field label { display: block; margin-bottom: 4px; font-weight: 800; font-size: 0.78rem; color: var(--amu); text-transform: uppercase; letter-spacing: 0.08em; }
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.success-block { text-align: center; padding: 10px 0; }
.success-block .big { font-size: 2.4rem; }
.success-block p:first-of-type { font-weight: 800; color: var(--success-light); font-size: 1.05rem; }

/* =============================================================================
   Benchmark (bas de l'accueil)
   ============================================================================= */
.benchmark-section { padding: 26px 16px 40px; background: var(--abg); border-top: 1px solid var(--aln); }
.benchmark-container { max-width: 520px; margin: 0 auto; }
.benchmark-header { text-align: center; margin-bottom: 16px; }
.benchmark-header h2 { font-size: 1.25rem; font-weight: 800; }
.benchmark-header p { font-size: 0.8rem; color: var(--amu); }
.benchmark-refresh { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--amu); margin-top: 6px; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--aln); border-radius: 50%; border-top-color: var(--primary-light); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bench-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.bench-stat { background: var(--asf); border: 1px solid var(--aln); border-radius: 16px; padding: 12px; text-align: center; }
.bench-stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.bench-stat-value.blue { color: var(--primary-light); }
.bench-stat-value.green { color: var(--success-light); }
.bench-stat-value.orange { color: var(--warning); }
.bench-stat-value.red { color: var(--danger-light); }
.bench-stat-label { font-size: 0.68rem; color: var(--amu); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; margin-top: 2px; }
.bench-bar-item { margin-bottom: 10px; }
.bench-bar-item:last-child { margin-bottom: 0; }
.bench-bar-label { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.85rem; }
.bench-bar-name { font-weight: 700; }
.bench-bar-pct { font-weight: 800; font-size: 0.8rem; }
.bench-bar-pct.ok { color: var(--success-light); }
.bench-bar-pct.mid { color: var(--warning); }
.bench-bar-pct.ko { color: var(--danger-light); }
.bench-bar-track { height: 8px; background: var(--aln); border-radius: 999px; overflow: hidden; display: flex; }
.bench-bar-fill-ok { height: 100%; background: var(--success); transition: width 0.6s ease; }
.bench-bar-fill-partial { height: 100%; background: var(--warning); transition: width 0.6s ease; }
.bench-platforms { display: grid; gap: 4px; }
.bench-platform-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--aln); }
.bench-platform-row:last-child { border-bottom: 0; }
.bench-platform-icon { font-size: 1.2rem; width: 28px; text-align: center; }
.bench-platform-name { flex: 1; font-weight: 700; font-size: 0.9rem; }
.bench-platform-count { font-weight: 800; font-size: 0.85rem; color: var(--primary-light); min-width: 30px; text-align: right; }
.bench-platform-score { font-size: 0.75rem; font-weight: 800; padding: 3px 8px; border-radius: 999px; min-width: 44px; text-align: center; }
.bench-platform-score.ok { background: rgba(40, 167, 69, 0.18); color: var(--success-light); }
.bench-platform-score.mid { background: rgba(255, 193, 7, 0.16); color: var(--warning); }
.bench-platform-score.ko { background: rgba(220, 53, 69, 0.18); color: var(--danger-light); }
.bench-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.bench-table th { font-weight: 800; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--amu); padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--aln); }
.bench-table th:first-child, .bench-table td:first-child { text-align: left; }
.bench-table td { padding: 8px 4px; text-align: center; border-bottom: 1px solid var(--aln); }
.bench-table .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.bench-table .dot.ok { background: var(--success); }
.bench-table .dot.partial { background: var(--warning); }
.bench-table .dot.ko { background: var(--danger); }
.bench-table .dot.na { background: var(--aln); }
.mini-badge { display: inline-block; padding: 3px 6px; border-radius: 8px; font-size: 0.62rem; font-weight: 800; line-height: 1.15; max-width: 62px; white-space: normal; text-align: center; }
.mini-badge.ok { background: rgba(40, 167, 69, 0.2); color: var(--success-light); }
.mini-badge.warn { background: rgba(255, 193, 7, 0.18); color: var(--warning); }
.mini-badge.ko { background: rgba(220, 53, 69, 0.2); color: var(--danger-light); }
.mini-badge.na { color: var(--amu); }
.bench-table .score-cell { font-weight: 800; }
.bench-table .score-cell.ok { color: var(--success-light); }
.bench-table .score-cell.mid { color: var(--warning); }
.bench-table .score-cell.ko { color: var(--danger-light); }
.bench-daily { display: flex; align-items: flex-end; gap: 4px; height: 90px; padding-top: 6px; }
.bench-daily-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.bench-daily-fill { width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(to top, var(--primary), var(--primary-light)); min-height: 2px; transition: height 0.6s ease; }
.bench-daily-label { font-size: 0.6rem; color: var(--amu); white-space: nowrap; }
.bench-daily-count { font-size: 0.65rem; font-weight: 800; }
.bench-empty { text-align: center; padding: 26px 10px; color: var(--amu); font-size: 0.9rem; }
.bench-empty-icon { font-size: 2.4rem; opacity: 0.5; margin-bottom: 6px; }

@media (min-width: 400px) { .bench-stats { grid-template-columns: repeat(4, 1fr); } .bench-stat-value { font-size: 1.4rem; } }
@media (max-width: 360px) { .welcome-title { font-size: 1.35rem; } .screen-title { font-size: 1.3rem; } .device-info { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
