/* ═══════════════════════════════════════════════════════════════════
   MOOOTS — SYSTÈME DE DESIGN v1.0
   ═══════════════════════════════════════════════════════════════════

   Chargé avant index.css : les tokens définis dans :root sont
   disponibles dans toute la chaîne de styles.

   ARCHITECTURE
   ────────────
   1. Tokens étendus    — variables CSS manquantes dans index.css
   2. Utilitaires       — classes .is-* / .has-* / accessibilité
   3. Composants
      3a. Progression   — .progress-bar, .progress-labeled
      3b. Étiquettes    — .label-chip, .score-pill, .badge, .badge-wrap
      3c. Identité      — .avatar
      3d. Listes        — .list-row, .list-rows, .settings-row, .settings-rows
      3e. États         — .spinner, .skeleton, .empty-state
      3f. Formulaires   — .switch
      3g. Structure     — .divider, .section-header, .card
      3h. Jeu           — .stat-block, .stat-blocks, .achievement-card,
                          .level-badge, .multiplier-display
   4. Keyframes
   5. Reduced motion

   CONVENTIONS (identiques à index.css)
   ─────────────────────────────────────
   • Modificateurs      → .is-* (couleur/taille/état)
   • Sous-éléments      → .composant-element (tiret simple)
   • Variantes visuelles→ .is-blue / .is-green / .is-gold / .is-red
   • Tailles            → .is-sm / .is-md / .is-lg
   • Imbrication CSS    → & (native nesting)
   • Valeurs fluides    → clamp() pour les tailles responsives
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────────────────────────────────────────────────────────────
   1. TOKENS ÉTENDUS
   ─────────────────────────────────────────────────────────────────── */

:root {
    /* ──── Fondations couleur (source de vérité) ──── */

    --color-white: #ffffff;

    --color-ink-950: #070d22;
    --color-navy-900: #101a3f;
    --color-navy-850: #182455;
    --color-navy-800: #1d2c64;
    --color-navy-700: #2b3c79;
    --color-navy-600: #34488f;
    --color-navy-550: #293a80;
    --color-navy-500: #324794;

    --color-blue-500: #438af3;
    --color-blue-700: #0055b4;

    --color-green-500: #249563;
    --color-green-700: #18724a;

    --color-red-500: #d52d1d;
    --color-red-700: #861f15;

    --color-gold-500: #ffc400;
    --color-gold-600: #f4960a;

    --color-purple-500: #8b5cf6;
    --color-purple-700: #6d28d9;

    --color-sand-200: #f1d3b4;
    --color-sand-500: #c4a07a;
    --color-brown-900: #3d2925;

    --color-silver-400: #c8cdd6;
    --color-bronze-500: #cd7c46;

    /* ──── Couleurs alpha / overlays ──── */

    --alpha-white-06: rgba(255, 255, 255, 0.06);
    --alpha-white-10: rgba(255, 255, 255, 0.1);
    --alpha-white-15: rgba(255, 255, 255, 0.15);
    --alpha-white-45: rgba(159, 176, 211, 0.45);
    --alpha-white-88: rgba(255, 255, 255, 0.88);

    --overlay-backdrop: rgba(7, 13, 34, 0.78);
    --overlay-inverse-strong: rgba(0, 0, 0, 0.7);

    /* ──── Surfaces sémantiques ──── */

    --surface-deep: var(--color-ink-950);
    --surface-void: var(--color-navy-900);
    --surface-panel: var(--color-navy-850);
    --surface-page: var(--color-navy-800);
    --surface-card: var(--color-navy-700);
    --surface-raised: var(--color-navy-600);
    --surface-inset: rgba(16, 26, 63, 0.55);
    --surface-inset-ghost: rgba(16, 26, 63, 0.18);
    --surface-accent-soft: rgba(67, 138, 243, 0.14);
    --surface-blue-soft: rgba(67, 138, 243, 0.2);
    --surface-green-soft: rgba(36, 149, 99, 0.2);
    --surface-green-strong: rgba(36, 149, 99, 0.22);
    --surface-red-soft: rgba(213, 45, 29, 0.2);
    --surface-red-strong: rgba(213, 45, 29, 0.22);
    --surface-gold-soft: rgba(255, 196, 0, 0.18);
    --surface-gold-strong: rgba(255, 196, 0, 0.2);
    --surface-gold-subtle: rgba(255, 196, 0, 0.1);
    --surface-warning-soft: rgba(245, 158, 11, 0.18);
    --surface-purple-soft: rgba(139, 92, 246, 0.18);

    /* ──── Texte sémantique ──── */

    --text-primary: #edf2f4;
    --text-secondary: #9fb0d3;
    --text-tertiary: #6d85b8;
    --text-helper: #b1bcdd;
    --text-disabled: var(--alpha-white-45);
    --text-placeholder: var(--alpha-white-88);
    --text-on-accent: var(--color-white);
    --text-on-gold: var(--color-brown-900);
    --text-rank-silver: var(--color-silver-400);
    --text-rank-bronze: var(--color-bronze-500);

    /* ──── Bordures sémantiques ──── */

    --border-ghost: var(--alpha-white-06);
    --border-subtle: var(--alpha-white-10);
    --border-muted: #2a428f;
    --border-default: #294099;
    --border-strong: #3b58c4;
    --border-focus: var(--color-blue-500);
    --border-contrast: var(--alpha-white-15);
    --border-gold-soft: rgba(255, 196, 0, 0.22);

    /* ──── Ombres ──── */

    --shadow-sm: 0 2px 8px rgba(7, 13, 34, 0.28);
    --shadow-md: 0 6px 18px rgba(7, 13, 34, 0.34);
    --shadow-lg: 0 10px 28px rgba(7, 13, 34, 0.42);
    --shadow-xl: 0 18px 48px rgba(7, 13, 34, 0.52);
    --shadow-toast: 0 10px 24px rgba(7, 13, 34, 0.22);
    --shadow-glow-blue: 0 0 22px rgba(67, 138, 243, 0.38);
    --shadow-glow-gold: 0 0 22px rgba(255, 196, 0, 0.38);
    --shadow-glow-green: 0 0 22px rgba(36, 149, 99, 0.38);
    --shadow-glow-red: 0 0 22px rgba(213, 45, 29, 0.38);

    /* ──── Layers ──── */

    --layer-base: 0;
    --layer-raised: 10;
    --layer-sticky: 20;
    --layer-fab: 30;
    --layer-overlay: 60;
    --layer-toast: 80;
    --layer-modal: 100;
    --layer-top: 1000;

    /* ──── Espacement (base 4 dp) ──── */

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 64px;

    /* ──── Rayons ──── */

    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 30px;
    --radius-full: 9999px;

    /* ──── Typographie ──── */

    --font-size-title-lg: clamp(1.75rem, 5.5vw, 2.05rem);
    --font-size-title-md: clamp(1.35rem, 4.6vw, 1.82rem);
    --font-size-body-lg: clamp(1rem, 3.8vw, 1.06rem);
    --font-size-body-md: clamp(0.94rem, 3.3vw, 1rem);
    --font-size-body-sm: clamp(0.84rem, 3vw, 0.92rem);
    --font-size-label: 0.82rem;
    --font-leading-tight: 1.08;
    --font-leading-copy: 1.45;
    --font-tracking-label: 0.08em;

    /* ──── Motion ──── */

    --motion-duration-instant: 80ms;
    --motion-duration-fast: 150ms;
    --motion-duration-normal: 220ms;
    --motion-duration-slow: 350ms;
    --motion-duration-enter: 260ms;
    --motion-duration-exit: 180ms;
    --motion-duration-shake: 280ms;
    --motion-duration-pulse: 550ms;
    --motion-duration-skeleton: 1500ms;
    --motion-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --motion-ease-in: cubic-bezier(0.64, 0, 0.78, 0);
    --motion-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --motion-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    /* ──── Layout / composants ──── */

    --layout-page-gutter: clamp(12px, 4vw, 24px);
    --component-panel-padding: clamp(12px, 4vw, 20px);
    --component-panel-radius: clamp(16px, 4vw, 20px);
    --component-board-padding: clamp(12px, 4vw, 20px);
    --component-board-gap: clamp(8px, 2.8vw, 15px);
    --component-button-height: clamp(46px, 12vw, 54px);
    --component-tile-depth: clamp(5px, 1.8vw, 7px);
    --component-tile-radius: clamp(8px, 2vw, 10px);
    --component-tile-letter-size: clamp(1.7rem, 7vw, 2.5rem);
    --component-tile-meta-size: clamp(0.72rem, 2.8vw, 1rem);
    --component-tile-surface: var(--color-sand-200);
    --component-tile-edge: var(--color-sand-500);
    --component-tile-text: var(--color-brown-900);
    --component-profile-icon-bg: var(--color-navy-550);
    --component-profile-icon-hover: var(--color-navy-500);
}

/* ───────────────────────────────────────────────────────────────────
   2. UTILITAIRES
   ─────────────────────────────────────────────────────────────────── */

/* Couleurs de texte supplémentaires (étend les sélecteurs de index.css) */
.is-warning {
    color: var(--color-gold-600) !important;
}
.is-purple {
    color: var(--color-purple-500) !important;
}
.is-muted {
    color: var(--text-secondary);
}

/* Fonds sémantiques */
.has-bg-panel {
    background-color: var(--surface-panel);
}
.has-bg-card {
    background-color: var(--surface-card);
}
.has-bg-inset {
    background-color: var(--surface-inset);
}

/* Texte uniquement pour lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Masque sans décaler le layout */
.is-invisible {
    opacity: 0;
    pointer-events: none;
}

/* ───────────────────────────────────────────────────────────────────
   3a. PROGRESSION
   ─────────────────────────────────────────────────────────────────── */

.progress-bar {
    width: 100%;
    height: clamp(6px, 2vw, 10px);
    background: var(--surface-void);
    border-radius: var(--radius-full);
    overflow: hidden;

    .progress-bar-fill {
        height: 100%;
        border-radius: var(--radius-full);
        background: linear-gradient(
            90deg,
            var(--color-green-700),
            var(--color-green-500)
        );
        transition: width var(--motion-duration-slow) var(--motion-ease-out);
        min-width: 4px;
    }

    &.is-blue .progress-bar-fill {
        background: linear-gradient(
            90deg,
            var(--color-blue-700),
            var(--color-blue-500)
        );
    }

    &.is-gold .progress-bar-fill {
        background: linear-gradient(
            90deg,
            var(--color-gold-600),
            var(--color-gold-500)
        );
    }

    &.is-red .progress-bar-fill {
        background: linear-gradient(
            90deg,
            var(--color-red-700),
            var(--color-red-500)
        );
    }
}

/* Barre de progression avec libellés au-dessus */
.progress-labeled {
    display: grid;
    gap: var(--space-2);

    .progress-bar-meta {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: var(--space-3);
        font-size: var(--font-size-body-sm);
        color: var(--text-secondary);

        strong {
            color: var(--text-primary);
            font-weight: 800;
        }
    }
}

/* ───────────────────────────────────────────────────────────────────
   3b. ÉTIQUETTES
   ─────────────────────────────────────────────────────────────────── */

/* Étiquette inline — type de bonus, effet, catégorie */
.label-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.22em 0.6em;
    border-radius: var(--radius-full);
    font-size: var(--font-size-label);
    font-weight: 800;
    line-height: 1;
    letter-spacing: var(--font-tracking-label);
    text-transform: uppercase;
    white-space: nowrap;
    background: var(--surface-inset);
    color: var(--text-secondary);

    i {
        font-size: 0.85em;
        line-height: 1;
    }

    &.is-blue {
        background: var(--surface-blue-soft);
        color: var(--color-blue-500);
    }

    &.is-green {
        background: var(--surface-green-soft);
        color: var(--color-green-500);
    }

    &.is-red {
        background: var(--surface-red-soft);
        color: var(--color-red-500);
    }

    &.is-gold {
        background: var(--surface-gold-soft);
        color: var(--color-gold-500);
    }

    &.is-warning {
        background: var(--surface-warning-soft);
        color: var(--color-gold-600);
    }

    &.is-purple {
        background: var(--surface-purple-soft);
        color: var(--color-purple-500);
    }
}

/* Pill de score inline — "+50 pts", "×2", "-10" */
.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    padding: 0.18em 0.55em;
    border-radius: var(--radius-full);
    font-size: var(--font-size-body-sm);
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    background: var(--surface-green-strong);
    color: var(--color-green-500);

    &.is-negative {
        background: var(--surface-red-strong);
        color: var(--color-red-500);
    }

    &.is-multiplier {
        background: var(--surface-gold-strong);
        color: var(--color-gold-500);
    }

    &.is-neutral {
        background: var(--surface-inset);
        color: var(--text-secondary);
    }
}

/* Badge de notification (nombre ou point) sur une icône */
.badge {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.22rem;
    border-radius: var(--radius-full);
    background: var(--color-red-500);
    color: var(--text-on-accent);
    font-size: 0.55rem;
    font-weight: 900;
    line-height: 1.1rem;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;

    &.is-gold {
        background: var(--color-gold-500);
        color: var(--text-on-gold);
    }

    &.is-dot {
        min-width: 0.55rem;
        width: 0.55rem;
        height: 0.55rem;
        padding: 0;
    }
}

/* Wrapper pour poser un .badge sur un élément */
.badge-wrap {
    position: relative;
    display: inline-flex;
}

/* ───────────────────────────────────────────────────────────────────
   3c. IDENTITÉ
   ─────────────────────────────────────────────────────────────────── */

/* Avatar circulaire — initiales ou image */
.avatar {
    --avatar-size: 40px;

    flex-shrink: 0;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: var(--radius-full);
    background: var(--surface-card);
    color: var(--text-primary);
    font-weight: 800;
    font-size: calc(var(--avatar-size) * 0.38);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    user-select: none;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    &.is-sm {
        --avatar-size: 32px;
    }
    &.is-md {
        --avatar-size: 40px;
    }
    &.is-lg {
        --avatar-size: 52px;
    }
    &.is-xl {
        --avatar-size: 64px;
    }

    &.is-blue {
        background: var(--color-blue-500);
        color: var(--text-on-accent);
    }
    &.is-green {
        background: var(--color-green-500);
        color: var(--text-on-accent);
    }
    &.is-gold {
        background: var(--color-gold-500);
        color: var(--text-on-gold);
    }
    &.is-red {
        background: var(--color-red-500);
        color: var(--text-on-accent);
    }
    &.is-purple {
        background: var(--color-purple-500);
        color: var(--text-on-accent);
    }
}

/* ───────────────────────────────────────────────────────────────────
   3d. LISTES
   ─────────────────────────────────────────────────────────────────── */

/* Ligne générique — classement, historique, contacts */
.list-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    min-height: 52px;
    background: var(--surface-card);
    transition: background var(--motion-duration-fast) var(--motion-ease-out);

    &.is-interactive {
        cursor: pointer;

        &:hover {
            background: var(--surface-raised);
        }

        &:active {
            transform: scale(0.99);
        }
    }

    .list-row-rank {
        min-width: 1.6rem;
        font-size: var(--font-size-body-sm);
        font-weight: 800;
        color: var(--text-secondary);
        text-align: center;

        &.is-1st {
            color: var(--color-gold-500);
        }
        &.is-2nd {
            color: var(--text-rank-silver);
        }
        &.is-3rd {
            color: var(--text-rank-bronze);
        }
    }

    .list-row-body {
        flex: 1;
        min-width: 0;

        .list-row-title {
            color: var(--text-primary);
            font-weight: 700;
            font-size: var(--font-size-body-md);
            line-height: 1.25;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .list-row-subtitle {
            color: var(--text-secondary);
            font-size: var(--font-size-body-sm);
            line-height: 1.3;
            margin-top: 0.1rem;
        }
    }

    .list-row-value {
        flex-shrink: 0;
        color: var(--text-primary);
        font-weight: 800;
        font-size: var(--font-size-body-md);
        text-align: right;
    }

    .list-row-action {
        flex-shrink: 0;
        color: var(--text-tertiary);
        font-size: 1rem;
        line-height: 1;
    }
}

/* Grille de lignes avec espacement uniforme */
.list-rows {
    display: grid;
    gap: var(--space-2);
}

/* Ligne de paramètre — settings, préférences */
.settings-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    min-height: 52px;
    background: var(--surface-card);
    cursor: pointer;
    transition: background var(--motion-duration-fast) var(--motion-ease-out);

    &:hover {
        background: var(--surface-raised);
    }

    &.is-readonly {
        cursor: default;

        &:hover {
            background: var(--surface-card);
        }
    }

    .settings-row-icon {
        flex-shrink: 0;
        width: 2rem;
        height: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-sm);
        background: var(--surface-inset);
        color: var(--text-secondary);
        font-size: 1rem;
        line-height: 1;
    }

    .settings-row-body {
        flex: 1;
        min-width: 0;

        .settings-row-label {
            color: var(--text-primary);
            font-weight: 600;
            font-size: var(--font-size-body-md);
            line-height: 1.25;
        }

        .settings-row-desc {
            color: var(--text-secondary);
            font-size: var(--font-size-body-sm);
            line-height: 1.3;
            margin-top: 0.1rem;
        }
    }

    .settings-row-end {
        flex-shrink: 0;
        color: var(--text-tertiary);
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: var(--space-2);
    }
}

.settings-rows {
    display: grid;
    gap: var(--space-2);
}

/* ───────────────────────────────────────────────────────────────────
   3e. ÉTATS
   ─────────────────────────────────────────────────────────────────── */

/* Spinner de chargement circulaire */
.spinner {
    --spinner-size: 24px;
    --spinner-width: 3px;
    --spinner-color: var(--text-primary);

    width: var(--spinner-size);
    height: var(--spinner-size);
    flex-shrink: 0;
    border-radius: var(--radius-full);
    border: var(--spinner-width) solid var(--border-contrast);
    border-top-color: var(--spinner-color);
    animation: ds-spinner-rotate var(--motion-duration-slow) linear infinite;

    &.is-sm {
        --spinner-size: 16px;
        --spinner-width: 2px;
    }
    &.is-lg {
        --spinner-size: 36px;
        --spinner-width: 4px;
    }

    &.is-blue {
        --spinner-color: var(--color-blue-500);
    }
    &.is-green {
        --spinner-color: var(--color-green-500);
    }
    &.is-gold {
        --spinner-color: var(--color-gold-500);
    }
}

/* Bloc squelette — placeholder pendant le chargement */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-card) 25%,
        var(--surface-raised) 50%,
        var(--surface-card) 75%
    );
    background-size: 200% 100%;
    animation: ds-skeleton-shimmer var(--motion-duration-skeleton) ease-in-out
        infinite;
    border-radius: var(--radius-sm);

    &.is-text {
        height: 0.9em;
        border-radius: var(--radius-xs);
    }
    &.is-title {
        height: 1.4em;
        border-radius: var(--radius-xs);
    }
    &.is-circle {
        border-radius: var(--radius-full);
    }
    &.is-card {
        height: 80px;
        border-radius: var(--radius-md);
    }
    &.is-button {
        height: var(--component-button-height);
        border-radius: var(--radius-md);
    }
}

/* État vide — liste vide, aucun résultat, onboarding */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-9) var(--space-6);
    text-align: center;

    .empty-state-icon {
        font-size: 3rem;
        line-height: 1;
        opacity: 0.35;
        color: var(--text-secondary);
    }

    .empty-state-title {
        margin: 0;
        font-size: var(--font-size-title-md);
        font-weight: 800;
        color: var(--text-primary);
        line-height: var(--font-leading-tight);
        text-wrap: balance;
    }

    .empty-state-body {
        margin: 0;
        font-size: var(--font-size-body-md);
        line-height: var(--font-leading-copy);
        color: var(--text-secondary);
        text-wrap: balance;
        max-width: 28ch;
    }

    .empty-state-action {
        margin-top: var(--space-2);
    }
}

/* ───────────────────────────────────────────────────────────────────
   3f. FORMULAIRES
   ─────────────────────────────────────────────────────────────────── */

/* Toggle switch — paramètres, préférences */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;

    input[type="checkbox"] {
        position: absolute;
        opacity: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        cursor: pointer;
        z-index: 1;
    }

    .switch-track {
        width: 48px;
        height: 28px;
        border-radius: var(--radius-full);
        background: var(--surface-inset);
        border: 2px solid var(--border-muted);
        position: relative;
        pointer-events: none;
        transition:
            background var(--motion-duration-fast) var(--motion-ease-out),
            border-color var(--motion-duration-fast) var(--motion-ease-out);

        &::after {
            content: "";
            position: absolute;
            top: 2px;
            left: 2px;
            width: 20px;
            height: 20px;
            border-radius: var(--radius-full);
            background: var(--text-secondary);
            transition: transform var(--motion-duration-fast)
                var(--motion-ease-spring);
        }
    }

    input:checked + .switch-track {
        background: var(--color-blue-500);
        border-color: var(--color-blue-700);

        &::after {
            transform: translateX(20px);
            background: var(--text-on-accent);
        }
    }

    input:focus-visible + .switch-track {
        outline: 2px solid var(--border-focus);
        outline-offset: 2px;
    }

    input:disabled + .switch-track {
        opacity: 0.45;
        cursor: not-allowed;
    }
}

/* ───────────────────────────────────────────────────────────────────
   3g. STRUCTURE
   ─────────────────────────────────────────────────────────────────── */

/* Séparateur horizontal */
.divider {
    width: 100%;
    height: 1px;
    background: var(--border-subtle);
    border: none;
    margin: var(--space-4) 0;

    &.is-labeled {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        height: auto;
        background: none;

        &::before,
        &::after {
            content: "";
            flex: 1;
            height: 1px;
            background: var(--border-subtle);
        }

        span {
            font-size: var(--font-size-label);
            font-weight: 700;
            color: var(--text-tertiary);
            letter-spacing: var(--font-tracking-label);
            text-transform: uppercase;
            white-space: nowrap;
        }
    }
}

/* En-tête de section dans un panel */
.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);

    .section-header-title {
        flex: 1;
        margin: 0;
        font-size: var(--font-size-label);
        font-weight: 800;
        color: var(--text-secondary);
        letter-spacing: var(--font-tracking-label);
        text-transform: uppercase;
        line-height: 1;
    }

    .section-header-action {
        font-size: var(--font-size-body-sm);
        font-weight: 600;
        color: var(--color-blue-500);
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        line-height: 1;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
            text-underline-offset: 0.15em;
        }
    }
}

/* Carte générique — remplace les valeurs ad-hoc dans les futures vues */
.card {
    background: var(--surface-card);
    border-radius: var(--radius-md);
    padding: var(--space-4);

    &.is-panel {
        background: var(--surface-panel);
        border-radius: var(--radius-lg);
        padding: clamp(16px, 4vw, 24px);
    }

    &.is-interactive {
        cursor: pointer;
        transition:
            background var(--motion-duration-fast) var(--motion-ease-out),
            transform var(--motion-duration-fast) var(--motion-ease-out);

        &:hover {
            background: var(--surface-raised);
        }
        &:active {
            transform: scale(0.98);
        }
    }

    &.is-outlined {
        background: transparent;
        border: 2px solid var(--border-muted);
    }

    &.is-glow-gold {
        box-shadow: var(--shadow-glow-gold);
    }
    &.is-glow-blue {
        box-shadow: var(--shadow-glow-blue);
    }
    &.is-glow-green {
        box-shadow: var(--shadow-glow-green);
    }
}

/* ───────────────────────────────────────────────────────────────────
   3h. COMPOSANTS DE JEU
   ─────────────────────────────────────────────────────────────────── */

/* Bloc statistique — valeur mise en avant + libellé */
.stat-block {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;

    .stat-block-value {
        font-size: var(--font-size-title-md);
        font-weight: 900;
        color: var(--text-primary);
        line-height: var(--font-leading-tight);
    }

    .stat-block-label {
        font-size: var(--font-size-label);
        font-weight: 700;
        color: var(--text-secondary);
        letter-spacing: var(--font-tracking-label);
        text-transform: uppercase;
        line-height: 1;
    }

    &.is-gold .stat-block-value {
        color: var(--color-gold-500);
    }
    &.is-green .stat-block-value {
        color: var(--color-green-500);
    }
    &.is-blue .stat-block-value {
        color: var(--color-blue-500);
    }
    &.is-red .stat-block-value {
        color: var(--color-red-500);
    }
}

/* Grille de stat-blocks */
.stat-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--space-3);
}

/* Carte d'achievement — débloqué / verrouillé */
.achievement-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    background: var(--surface-card);
    transition: background var(--motion-duration-fast) var(--motion-ease-out);

    .achievement-icon {
        flex-shrink: 0;
        width: 3rem;
        height: 3rem;
        border-radius: var(--radius-md);
        background: var(--surface-inset);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        color: var(--text-secondary);
        transition:
            background var(--motion-duration-fast) var(--motion-ease-out),
            color var(--motion-duration-fast) var(--motion-ease-out);
    }

    .achievement-body {
        flex: 1;
        min-width: 0;

        .achievement-title {
            margin: 0 0 0.2rem;
            font-size: var(--font-size-body-md);
            font-weight: 800;
            color: var(--text-primary);
            line-height: 1.2;
        }

        .achievement-desc {
            margin: 0;
            font-size: var(--font-size-body-sm);
            color: var(--text-secondary);
            line-height: var(--font-leading-copy);
        }
    }

    .achievement-progress {
        flex-shrink: 0;
        font-size: var(--font-size-body-sm);
        font-weight: 800;
        color: var(--text-secondary);
        text-align: right;
        white-space: nowrap;
    }

    /* État verrouillé */
    &.is-locked {
        opacity: 0.52;

        .achievement-icon {
            filter: grayscale(1);
        }
    }

    /* État débloqué */
    &.is-unlocked {
        background: linear-gradient(
            135deg,
            var(--surface-gold-subtle),
            rgba(244, 150, 10, 0.05)
        );
        border: 1px solid var(--border-gold-soft);

        .achievement-icon {
            background: var(--surface-gold-soft);
            color: var(--color-gold-500);
        }
    }
}

/* Badge de niveau — dans le HUD ou les résultats */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.3em 0.75em;
    border-radius: var(--radius-full);
    background: var(--surface-card);
    font-size: var(--font-size-body-sm);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;

    i {
        font-size: 0.9em;
    }

    /* Lorsqu'un nouveau niveau est atteint */
    &.is-new-level {
        background: linear-gradient(
            135deg,
            var(--color-gold-600),
            var(--color-gold-500)
        );
        color: var(--text-on-gold);
        animation: ds-level-badge-pulse var(--motion-duration-pulse)
            var(--motion-ease-spring) both;
    }
}

/* Affichage de multiplicateur en jeu */
.multiplier-display {
    display: inline-flex;
    align-items: baseline;
    gap: 0.1em;
    font-weight: 900;
    color: var(--color-gold-500);
    line-height: 1;

    .multiplier-symbol {
        font-size: 0.7em;
        opacity: 0.75;
    }

    .multiplier-value {
        font-size: var(--font-size-title-md);
    }
}

/* ───────────────────────────────────────────────────────────────────
   4. KEYFRAMES
   ─────────────────────────────────────────────────────────────────── */

@keyframes ds-spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

@keyframes ds-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes ds-level-badge-pulse {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }
    65% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ───────────────────────────────────────────────────────────────────
   5. REDUCED MOTION
   ─────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .spinner,
    .skeleton,
    .level-badge {
        animation: none;
    }

    .progress-bar .progress-bar-fill,
    .switch .switch-track,
    .switch .switch-track::after,
    .list-row,
    .settings-row,
    .card.is-interactive,
    .achievement-card,
    .achievement-card .achievement-icon {
        transition: none;
    }
}
