/*
 * Rendu du résultat (carré, radar, barres, jauge, podium) : variables de thème génériques, sans référence à un quiz ni à un domaine.
 * Chaque variable a une valeur claire ici et une valeur sombre plus bas ; le thème de l'hôte (Tailwind, Phoenix/Bootstrap...) les
 * surcharge dans sa propre feuille, sans toucher aux gabarits :
 *
 *   :root { --series-1: #0b6e4f; --map-y: #b3261e; }
 *   [data-bs-theme="dark"] { --series-1: #6fd6b0; }
 *
 * Mode sombre : attribut data-bs-theme="dark" (Bootstrap, Phoenix), classe .dark (Tailwind) ou, sans aucun réglage de l'hôte,
 * préférence du système.
 */

:root {
    --map-y: #c8553d;
    --map-x: #2a7f9e;
    --map-both: #6a4c93;
    --map-none: #9aa0a6;

    --series-1: #3b6fb6;
    --series-2: #c8553d;
    --series-3: #2f8f5b;
    --series-4: #8a5cc2;
    --series-5: #b8860b;
    --series-6: #1f8a99;
    --series-7: #a8456b;
    --series-8: #5b6770;

    --line: #cfcfd6;
    --fg: #1c1b1f;
    --muted: #5f6368;
    --bg: #ffffff;
}

[data-bs-theme="dark"],
.dark {
    --map-y: #ee8a74;
    --map-x: #62b6d4;
    --map-both: #b99be6;
    --map-none: #8a8f96;

    --series-1: #7aa7e6;
    --series-2: #ee8a74;
    --series-3: #5fc28b;
    --series-4: #b99be6;
    --series-5: #e0b84a;
    --series-6: #62c5d3;
    --series-7: #e07aa0;
    --series-8: #a6b1ba;

    --line: #4a4a55;
    --fg: #ece9f1;
    --muted: #b0aeb9;
    --bg: #16151a;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme]):not(.light):not(.dark) {
        --map-y: #ee8a74;
        --map-x: #62b6d4;
        --map-both: #b99be6;
        --map-none: #8a8f96;

        --series-1: #7aa7e6;
        --series-2: #ee8a74;
        --series-3: #5fc28b;
        --series-4: #b99be6;
        --series-5: #e0b84a;
        --series-6: #62c5d3;
        --series-7: #e07aa0;
        --series-8: #a6b1ba;

        --line: #4a4a55;
        --fg: #ece9f1;
        --muted: #b0aeb9;
        --bg: #16151a;
    }
}

.arv {
    margin: 0;
    color: var(--fg);
}

.arv:focus-visible {
    outline: 3px solid var(--series-1);
    outline-offset: 4px;
    border-radius: 4px;
}

.arv__caption {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.arv__graphic {
    display: block;
}

.arv__svg {
    display: block;
    width: 100%;
    max-width: 560px;
    height: auto;
    margin: 0 auto;
    font-family: inherit;
}

.arv--quadrant .arv__svg {
    max-width: 420px;
}

.arv__legend {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
    text-align: center;
}

.arv__primary {
    margin: 0.75rem 0 0;
    font-weight: 600;
}

.arv__nuance {
    color: var(--muted);
    font-weight: 400;
}

.arv__series {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin: 0.5rem 0 0;
    padding: 0;
    color: var(--fg);
    font-size: 0.8125rem;
    list-style: none;
}

.arv__series svg {
    vertical-align: -2px;
}

.arv__list {
    margin: 0;
    padding-left: 1.25rem;
}

.arv__list-primary {
    font-weight: 700;
}

.arv--share .arv__caption {
    display: none;
}

.arv-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .arv__bar,
    .arv__point {
        transition: width 0.4s ease, transform 0.4s ease;
    }
}

/* Aperçu de l'éditeur : mêmes variables, largeur de téléphone en option. */
.arv-preview {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    color: var(--fg);
}

.arv-preview[data-width="phone"] {
    max-width: 360px;
    margin-right: auto;
    margin-left: auto;
}

