/**
 * BINGO - Pulpeuse - Material Design 3 Expressive v3
 * Design System Ultra-Premium - Interface Vivante
 * Shape Morphing, Physics Animations & Living UI
 *
 * Philosophie: Chaque élément respire, réagit, et se transforme
 *，禁止任何 changement brutal - 一切都必须流动如水
 */

/* ════════════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES - Design Tokens M3 Expressive v3
   ════════════════════════════════════════════════════════════════════════ */

:root {
    /* ═══ Couleurs Primaires - Teinte Vibrante ═══ */
    --primary: #00e5cc;
    --primary-light: #6efff0;
    --primary-dark: #00bfa6;
    --primary-container: rgba(0, 229, 204, 0.12);
    --primary-container-vivid: rgba(0, 229, 204, 0.25);
    --on-primary: #003731;
    --on-primary-container: #a7f3ec;

    /* ═══ Couleurs Secondaires - Violet Expressif ═══ */
    --secondary: #b794f6;
    --secondary-light: #e9d5ff;
    --secondary-dark: #a78bfa;
    --secondary-container: rgba(183, 148, 246, 0.12);
    --secondary-container-vivid: rgba(183, 148, 246, 0.25);
    --on-secondary: #2d1b4e;
    --on-secondary-container: #e9d5ff;

    /* ═══ Couleurs Tertiaires - Energie Dynamique ═══ */
    --tertiary: #ff7b7b;
    --tertiary-light: #ffb4b4;
    --tertiary-dark: #ff6b6b;
    --tertiary-container: rgba(255, 123, 123, 0.12);
    --on-tertiary: #3f0000;

    /* ═══ Couleurs Quaternaires - Soleil Chaud ═══ */
    --quaternary: #ffd93d;
    --quaternary-container: rgba(255, 217, 61, 0.12);
    --on-quaternary: #2d2800;

    /* ═══ Couleurs Neutres - Surface Profonde ═══ */
    --surface: #0a0c10;
    --surface-dim: #050608;
    --surface-container: #141620;
    --surface-container-high: #1c1e2a;
    --surface-container-highest: #252836;
    --surface-container-low: #0f1117;
    --surface-container-lowest: #0a0c10;
    --on-surface: #e4e4e7;
    --on-surface-variant: #94969e;
    --on-surface-muted: #5c5e69;

    /* ═══ Borders & Outlines - Clarity ═══ */
    --outline: rgba(255, 255, 255, 0.1);
    --outline-strong: rgba(255, 255, 255, 0.2);
    --outline-variant: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.06);

    /* ═══ Couleurs Fonctionnelles - Feedback ═══ */
    --error: #ff7b7b;
    --error-container: rgba(255, 123, 123, 0.12);
    --on-error: #3f0000;
    --success: #6ee7b7;
    --success-container: rgba(110, 231, 183, 0.12);
    --on-success: #003d2e;
    --warning: #fcd34d;
    --warning-container: rgba(252, 211, 77, 0.12);
    --on-warning: #3d3000;
    --info: #7dd3fc;
    --info-container: rgba(125, 211, 252, 0.12);

    /* ═══ Gradients - Atmosphere Vivante ═══ */
    --gradient-primary: linear-gradient(135deg, #00e5cc 0%, #00bfa6 100%);
    --gradient-secondary: linear-gradient(135deg, #b794f6 0%, #7c3aed 100%);
    --gradient-tertiary: linear-gradient(135deg, #ff7b7b 0%, #ff4d6d 100%);
    --gradient-expressive: linear-gradient(
        135deg,
        #00e5cc 0%,
        #b794f6 50%,
        #ff7b7b 100%
    );
    --gradient-hero:
        radial-gradient(
            ellipse 80% 50% at 20% 0%,
            rgba(0, 229, 204, 0.18) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse 60% 40% at 80% 100%,
            rgba(183, 148, 246, 0.12) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse 50% 30% at 50% 50%,
            rgba(255, 123, 123, 0.06) 0%,
            transparent 50%
        );
    --gradient-card: linear-gradient(
        145deg,
        var(--surface-container) 0%,
        var(--surface-container-high) 100%
    );
    --gradient-glow: radial-gradient(
        circle,
        rgba(0, 229, 204, 0.15) 0%,
        transparent 70%
    );
    --gradient-shimmer: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );

    /* ═══ Shapes - M3 Expressive Corner Radius ═══ */
    --shape-none: 0px;
    --shape-extra-small: 4px;
    --shape-small: 8px;
    --shape-small-top: 12px 12px 0 0;
    --shape-medium: 12px;
    --shape-medium-top: 20px 20px 0 0;
    --shape-large: 16px;
    --shape-large-top: 28px 28px 0 0;
    --shape-extra-large: 24px;
    --shape-extra-large-top: 40px 40px 0 0;
    --shape-full: 28px;
    --shape-pill: 9999px;
    --shape-stadium: 500px;
    --shape-circle: 50%;

    /* ═══ Shapes Asymétriques - M3 Expressive Signature ═══ */
    /* Règle absolue : aucun coin droit (0°/90°). Toujours asymétrique ou arrondi */
    --shape-asym-card:       20px 6px 20px 6px;    /* cartes standard petit jeu */
    --shape-asym-card-sel:   26px 8px 26px 8px;    /* cartes sélectionnées */
    --shape-asym-grand:      24px 6px 24px 6px;    /* cartes grands jeux carousel */
    --shape-asym-grand-sel:  30px 10px 30px 10px;  /* grand jeu sélectionné */
    --shape-asym-hero:       28px 8px 28px 8px;    /* hero / composer-hero */
    --shape-asym-stage:      28px 8px 28px 8px;    /* composer-stage / panels */
    --shape-asym-toolbar:    20px 6px 20px 6px;    /* toolbar */
    --shape-asym-pill-start: 999px 16px 16px 999px; /* pill avec accent à gauche */
    --shape-asym-pill-end:   16px 999px 999px 16px; /* pill avec accent à droite */
    --shape-asym-eyebrow:    999px 12px 12px 999px; /* eyebrow labels */
    --shape-asym-badge:      12px 999px 999px 12px; /* badges counts */
    --shape-min:             12px;                  /* minimum absolu — aucun coin <12px */
    --shape-rail-bottom:     0 0 16px 8px;          /* workflow rail bas */
    --shape-surface:         32px 10px 32px 10px;  /* page-surface principale */

    /* ═══ Motion - Durées Expressives ═══ */
    --motion-duration-none: 0ms;
    --motion-duration-micro: 50ms;
    --motion-duration-shortest: 100ms;
    --motion-duration-short: 150ms;
    --motion-duration-medium: 250ms;
    --motion-duration-long: 350ms;
    --motion-duration-extra-long: 500ms;
    --motion-duration-ultra: 700ms;

    /* ═══ Motion - Easings Physics-Based ═══ */
    /* Spring Expressif - Overshoot naturel */
    --motion-easing-expressive: cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Spring Doux - Réception élégante */
    --motion-easing-emphasized: cubic-bezier(0.05, 0.7, 0.45, 1);
    /* Standard - Mouvement utilitaire */
    --motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
    /* Décélération - Arrivée douce */
    --motion-easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
    /* Accélération - Départ fluide */
    --motion-easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
    /* Legacy - Compatibilité */
    --motion-easing-legacy: cubic-bezier(0.4, 0, 0.2, 1);
    /* Elastic - Rebond organique */
    --motion-easing-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* Smooth bounce */
    --motion-easing-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* ═══ Shadows - Profondeur Dynamique ═══ */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-xl:
        0 16px 32px rgba(0, 0, 0, 0.35), 0 8px 16px rgba(0, 0, 0, 0.25);
    --shadow-glow-turquoise: 0 0 20px rgba(0, 229, 204, 0.25);
    --shadow-glow-violet: 0 0 20px rgba(183, 148, 246, 0.25);
    --shadow-glow-coral: 0 0 20px rgba(255, 123, 123, 0.25);
    --shadow-glow-primary: 0 4px 20px rgba(0, 229, 204, 0.35);
    --shadow-glow-secondary: 0 4px 20px rgba(183, 148, 246, 0.35);
    --shadow-inner-glow: inset 0 0 20px rgba(0, 229, 204, 0.1);

    /* ═══ Spacing & Layout ═══ */
    --content-padding: 20px;
    --content-padding-mobile: 16px;
    --card-gap: 12px;
    --card-gap-lg: 20px;
    --nav-height: 72px;
    --summary-height: 80px;
    --header-height: 64px;
    --max-width: 1200px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* ════════════════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS - M3 Expressive Motion System v3
   ════════════════════════════════════════════════════════════════════════ */

/* ─── 1. REVEAL ANIMATIONS - Apparition Vivante ─── */
@keyframes revealFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes revealFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes revealScale {
    from {
        opacity: 0;
        transform: scale(0.85);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes revealScaleSoft {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes revealBlur {
    from {
        opacity: 0;
        filter: blur(12px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes revealSlideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealSlideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealZoomIn {
    from {
        opacity: 0;
        transform: scale(0.5) translateZ(-100px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }
}

/* ─── 2. SHAPE MORPHING - Transformations Fluides ─── */

/* Morphing principal - expansion avec bounce */
@keyframes morphExpand {
    0% {
        border-radius: var(--shape-medium);
        transform: scale(1);
        box-shadow: var(--shadow-sm);
    }
    40% {
        border-radius: var(--shape-large);
        transform: scale(1.05);
        box-shadow: var(--shadow-lg);
    }
    70% {
        border-radius: var(--shape-extra-large);
        transform: scale(1.02);
        box-shadow: var(--shadow-glow-primary);
    }
    100% {
        border-radius: var(--shape-large);
        transform: scale(1);
        box-shadow: var(--shadow-md);
    }
}

/* Morphing pour sélection - plus expressif */
@keyframes morphSelect {
    0% {
        border-radius: var(--shape-medium);
        transform: scale(1) translateY(0);
        box-shadow: var(--shadow-sm);
        border-color: var(--outline);
    }
    30% {
        border-radius: var(--shape-large);
        transform: scale(1.08) translateY(-4px);
        box-shadow: 0 12px 40px rgba(0, 229, 204, 0.4);
        border-color: var(--primary);
    }
    60% {
        border-radius: var(--shape-extra-large);
        transform: scale(1.06) translateY(-2px);
    }
    100% {
        border-radius: var(--shape-full);
        transform: scale(1.02) translateY(0);
        box-shadow: var(--shadow-glow-primary);
        border-color: var(--primary);
    }
}

/* Morphing pour désélection - retour doux */
@keyframes morphDeselect {
    0% {
        border-radius: var(--shape-full);
        transform: scale(1.02);
        box-shadow: var(--shadow-glow-primary);
        border-color: var(--primary);
    }
    50% {
        border-radius: var(--shape-large);
        transform: scale(0.98);
        box-shadow: var(--shadow-sm);
        border-color: var(--outline);
    }
    100% {
        border-radius: var(--shape-medium);
        transform: scale(1);
        box-shadow: var(--shadow-sm);
        border-color: var(--outline);
    }
}

/* Pulse morphing - respiration vivante */
@keyframes morphPulse {
    0%,
    100% {
        border-radius: var(--shape-medium);
        transform: scale(1);
    }
    50% {
        border-radius: var(--shape-large);
        transform: scale(1.03);
    }
}

/* Border morphing - transition couleur */
@keyframes borderMorphIn {
    from {
        border-color: var(--outline);
        border-width: 1px;
        border-radius: var(--shape-small);
    }
    to {
        border-color: var(--primary);
        border-width: 2px;
        border-radius: var(--shape-large);
    }
}

@keyframes borderMorphOut {
    from {
        border-color: var(--primary);
        border-width: 2px;
        border-radius: var(--shape-large);
    }
    to {
        border-color: var(--outline);
        border-width: 1px;
        border-radius: var(--shape-small);
    }
}

/* ─── 3. FLOATING / LIVING ELEMENTS - Respiration ─── */

/* Float subtil - respiration lente */
@keyframes floatBreath {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-6px) scale(1.01);
    }
}

/* Float léger - micro-mouvement */
@keyframes floatGently {
    0%,
    100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(-3px);
    }
    75% {
        transform: translateY(-1px);
    }
}

/* Pulse glow - halo vivant */
@keyframes pulseGlow {
    0%,
    100% {
        box-shadow: 0 0 20px rgba(0, 229, 204, 0.2);
    }
    50% {
        box-shadow:
            0 0 40px rgba(0, 229, 204, 0.4),
            0 0 60px rgba(0, 229, 204, 0.2);
    }
}

@keyframes pulseGlowSoft {
    0%,
    100% {
        box-shadow: 0 0 15px rgba(0, 229, 204, 0.15);
        opacity: 0.8;
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 229, 204, 0.3);
        opacity: 1;
    }
}

@keyframes pulseGlowMulti {
    0%,
    100% {
        box-shadow:
            0 0 20px rgba(0, 229, 204, 0.2),
            0 0 40px rgba(183, 148, 246, 0.1);
    }
    33% {
        box-shadow:
            0 0 30px rgba(183, 148, 246, 0.3),
            0 0 50px rgba(255, 123, 123, 0.1);
    }
    66% {
        box-shadow:
            0 0 25px rgba(255, 123, 123, 0.25),
            0 0 45px rgba(0, 229, 204, 0.15);
    }
}

/* Shimmer - brillance fluide */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes shimmerSoft {
    0% {
        background-position: -100% 50%;
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
    100% {
        background-position: 100% 50%;
        opacity: 0.5;
    }
}

/* Pulse opacity - visibility vivante */
@keyframes pulseOpacity {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes pulseOpacitySoft {
    0%,
    100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Rotation subtile - énergie cinétique */
@keyframes rotateSubtle {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes rotateReverse {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

/* ─── 4. CELL ANIMATIONS - Mini-grid Bingo ─── */

@keyframes cellPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4);
    }
    75% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes cellPopSoft {
    0% {
        transform: scale(1);
    }
    40% {
        transform: scale(1.25);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes cellFadeIn {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes cellWave {
    0% {
        transform: scale(1);
        background: var(--primary);
    }
    50% {
        transform: scale(1.15);
        background: var(--primary-light);
    }
    100% {
        transform: scale(1);
        background: var(--primary);
    }
}

/* ─── 5. SPINNER & LOADING ─── */

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinSoft {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinSoftReverse {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

@keyframes spinDash {
    0% {
        stroke-dashoffset: 187;
        transform: rotate(0deg);
    }
    50% {
        stroke-dashoffset: 46.75;
        transform: rotate(135deg);
    }
    100% {
        stroke-dashoffset: 187;
        transform: rotate(360deg);
    }
}

@keyframes loadingDots {
    0%,
    20% {
        opacity: 0.2;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
    60%,
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
}

/* ─── 6. NAV ANIMATIONS ─── */

@keyframes navItemPop {
    0% {
        transform: scale(1) translateY(0);
    }
    40% {
        transform: scale(1.15) translateY(-6px);
    }
    100% {
        transform: scale(1.1) translateY(-4px);
    }
}

@keyframes navItemReturn {
    0% {
        transform: scale(1.1) translateY(-4px);
    }
    100% {
        transform: scale(1) translateY(0);
    }
}

@keyframes bottomNavSlide {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes bottomNavHide {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

@keyframes summarySlideUp {
    from {
        transform: translateY(150%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes summarySlideDown {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(150%) scale(0.9);
        opacity: 0;
    }
}

/* ─── 7. PAGE TRANSITIONS - Morphing Fluide ─── */

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
    to {
        opacity: 0;
        transform: translateY(-16px) scale(0.98);
        filter: blur(4px);
    }
}

@keyframes pageMorph {
    0% {
        clip-path: inset(100% 0 0 0);
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageSlideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

@keyframes pageSlideRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
        filter: blur(0);
    }
}

/* ─── 8. EXPANSION / COLLAPSE ─── */

@keyframes expandFromCard {
    from {
        border-radius: var(--shape-full);
        transform: scale(0.9) translateY(10%);
        opacity: 0;
    }
    to {
        border-radius: 0;
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes collapseToCard {
    from {
        border-radius: 0;
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        border-radius: var(--shape-full);
        transform: scale(0.9) translateY(10%);
        opacity: 0;
    }
}

@keyframes expandAccordion {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        max-height: 500px;
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── SECTION TRANSITIONS — Explosion OUT / Implosion IN ─── */

@keyframes sectionExplodeLeft {
    from { opacity:1; transform:translateX(0) scale(1); filter:blur(0); }
    to   { opacity:0; transform:translateX(-56px) scale(0.94); filter:blur(6px); }
}
@keyframes sectionExplodeRight {
    from { opacity:1; transform:translateX(0) scale(1); filter:blur(0); }
    to   { opacity:0; transform:translateX(56px) scale(0.94); filter:blur(6px); }
}
@keyframes sectionExplodeUp {
    from { opacity:1; transform:translateY(0) scale(1); filter:blur(0); }
    to   { opacity:0; transform:translateY(-48px) scale(0.95); filter:blur(6px); }
}
@keyframes sectionExplodeDown {
    from { opacity:1; transform:translateY(0) scale(1); filter:blur(0); }
    to   { opacity:0; transform:translateY(48px) scale(0.95); filter:blur(6px); }
}
@keyframes sectionImplodeFromLeft {
    from { opacity:0; transform:translateX(-64px) scale(0.93); filter:blur(8px); }
    to   { opacity:1; transform:translateX(0) scale(1); filter:blur(0); }
}
@keyframes sectionImplodeFromRight {
    from { opacity:0; transform:translateX(64px) scale(0.93); filter:blur(8px); }
    to   { opacity:1; transform:translateX(0) scale(1); filter:blur(0); }
}
@keyframes sectionImplodeFromTop {
    from { opacity:0; transform:translateY(-52px) scale(0.94); filter:blur(8px); }
    to   { opacity:1; transform:translateY(0) scale(1); filter:blur(0); }
}
@keyframes sectionImplodeFromBottom {
    from { opacity:0; transform:translateY(52px) scale(0.94); filter:blur(8px); }
    to   { opacity:1; transform:translateY(0) scale(1); filter:blur(0); }
}

.section-explode-left        { animation:sectionExplodeLeft        280ms cubic-bezier(.4,0,1,1)     forwards; pointer-events:none; }
.section-explode-right       { animation:sectionExplodeRight       280ms cubic-bezier(.4,0,1,1)     forwards; pointer-events:none; }
.section-explode-up          { animation:sectionExplodeUp          240ms cubic-bezier(.4,0,1,1)     forwards; pointer-events:none; }
.section-explode-down        { animation:sectionExplodeDown        240ms cubic-bezier(.4,0,1,1)     forwards; pointer-events:none; }
.section-implode-from-left   { animation:sectionImplodeFromLeft   380ms cubic-bezier(.05,.7,.45,1)  forwards; }
.section-implode-from-right  { animation:sectionImplodeFromRight  380ms cubic-bezier(.05,.7,.45,1)  forwards; }
.section-implode-from-top    { animation:sectionImplodeFromTop    340ms cubic-bezier(.05,.7,.45,1)  forwards; }
.section-implode-from-bottom { animation:sectionImplodeFromBottom 400ms cubic-bezier(.05,.7,.45,1)  forwards; }

/* ─── SHAPE MORPHING CARDS ─── */

@keyframes morphCardSelectGrand {
    0%   { border-radius:24px 6px 24px 6px;   transform:scale(1)    translateY(0);    box-shadow:0 8px 24px rgba(0,0,0,.22); }
    35%  { border-radius:30px 12px 22px 8px;  transform:scale(1.06) translateY(-4px); box-shadow:0 20px 50px rgba(0,229,204,.35); }
    65%  { border-radius:28px 10px 30px 6px;  transform:scale(1.04) translateY(-3px); }
    100% { border-radius:30px 10px 30px 10px; transform:scale(1.02) translateY(-2px); box-shadow:0 16px 40px rgba(0,229,204,.25); }
}
@keyframes morphCardDeselectGrand {
    0%   { border-radius:30px 10px 30px 10px; transform:scale(1.02) translateY(-2px); }
    50%  { border-radius:22px 4px 22px 4px;   transform:scale(0.98); }
    100% { border-radius:24px 6px 24px 6px;   transform:scale(1) translateY(0); box-shadow:0 8px 24px rgba(0,0,0,.22); }
}
@keyframes morphCardSelectPetit {
    0%   { border-radius:20px 6px 20px 6px;   transform:scale(1)    translateY(0);    box-shadow:0 8px 24px rgba(0,0,0,.22); }
    30%  { border-radius:26px 10px 18px 8px;  transform:scale(1.08) translateY(-5px); box-shadow:0 18px 44px rgba(183,148,246,.4); }
    60%  { border-radius:24px 8px 28px 6px;   transform:scale(1.05) translateY(-3px); }
    100% { border-radius:26px 8px 26px 8px;   transform:scale(1.02) translateY(-1px); box-shadow:0 12px 32px rgba(183,148,246,.25); }
}
@keyframes morphCardDeselectPetit {
    0%   { border-radius:26px 8px 26px 8px; transform:scale(1.02) translateY(-1px); }
    40%  { border-radius:18px 4px 18px 4px; transform:scale(0.97); }
    100% { border-radius:20px 6px 20px 6px; transform:scale(1) translateY(0); box-shadow:0 8px 24px rgba(0,0,0,.22); }
}

.game-card.morphing-select-grand   { animation:morphCardSelectGrand   460ms cubic-bezier(.34,1.56,.64,1) forwards; pointer-events:none; z-index:10; }
.game-card.morphing-deselect-grand { animation:morphCardDeselectGrand 300ms cubic-bezier(.05,.7,.45,1)   forwards; pointer-events:none; }
.game-card.morphing-select-petit   { animation:morphCardSelectPetit   460ms cubic-bezier(.34,1.56,.64,1) forwards; pointer-events:none; z-index:10; }
.game-card.morphing-deselect-petit { animation:morphCardDeselectPetit 300ms cubic-bezier(.05,.7,.45,1)   forwards; pointer-events:none; }

@keyframes dotExpand   { from{width:8px;border-radius:4px;} to{width:28px;border-radius:999px;} }
@keyframes dotContract { from{width:28px;border-radius:999px;} to{width:8px;border-radius:4px;} }

/* ─── 9. TOAST & NOTIFICATIONS ─── */

@keyframes toastEnter {
    from {
        transform: translateX(-50%) translateY(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastExit {
    from {
        transform: translateX(-50%) translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(-50%) translateY(100%) scale(0.9);
        opacity: 0;
    }
}

/* ─── 10. WIGGLE & SHAKE - Feedback ─── */

@keyframes wiggle {
    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }
    20% {
        transform: translateX(-4px) rotate(-2deg);
    }
    40% {
        transform: translateX(4px) rotate(2deg);
    }
    60% {
        transform: translateX(-4px) rotate(-2deg);
    }
    80% {
        transform: translateX(4px) rotate(2deg);
    }
}

@keyframes shake {
    0%,
    100% {
        transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-6px);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translateX(6px);
    }
}

@keyframes shakeSoft {
    0%,
    100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    75% {
        transform: translateX(3px);
    }
}

/* ─── 11. CHECK ANIMATION ─── */

@keyframes checkPop {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(0deg);
        opacity: 1;
    }
    70% {
        transform: scale(0.9) rotate(0deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ─── 12. STAGGER UTILITY CLASSES ─── */
.stagger-1 {
    animation-delay: 0ms !important;
}
.stagger-2 {
    animation-delay: 50ms !important;
}
.stagger-3 {
    animation-delay: 100ms !important;
}
.stagger-4 {
    animation-delay: 150ms !important;
}
.stagger-5 {
    animation-delay: 200ms !important;
}
.stagger-6 {
    animation-delay: 250ms !important;
}
.stagger-7 {
    animation-delay: 300ms !important;
}
.stagger-8 {
    animation-delay: 350ms !important;
}
.stagger-9 {
    animation-delay: 400ms !important;
}
.stagger-10 {
    animation-delay: 450ms !important;
}
.stagger-11 {
    animation-delay: 500ms !important;
}
.stagger-12 {
    animation-delay: 550ms !important;
}

/* ════════════════════════════════════════════════════════════════════════
   BASE STYLES
   ════════════════════════════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background: var(--surface);
    color: var(--on-surface);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

/* Ambient Background Glow - Atmosphère Vivante */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--gradient-hero);
    pointer-events: none;
    z-index: 0;
    animation: pulseOpacitySoft 12s ease-in-out infinite;
}

/* Subtle grain texture for premium feel */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 0;
}

/* Selection styling */
::selection {
    background: var(--primary-container-vivid);
    color: var(--on-primary-container);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY - Inter + Fredoka
   ════════════════════════════════════════════════════════════════════════ */

.font-display {
    font-family: "Fredoka One", "Comic Sans MS", cursive;
    letter-spacing: -0.02em;
}

.font-mono {
    font-family: "JetBrains Mono", "Fira Code", monospace;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-expressive {
    background: var(--gradient-expressive);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-secondary {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Typography Scale */
.text-display-lg {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.text-display-md {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.text-headline-lg {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    line-height: 1.3;
}

.text-headline-md {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 600;
    line-height: 1.4;
}

.text-title-lg {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.text-title-md {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.text-body-lg {
    font-size: 1rem;
    line-height: 1.6;
}

.text-body-md {
    font-size: 0.875rem;
    line-height: 1.6;
}

.text-body-sm {
    font-size: 0.8125rem;
    line-height: 1.5;
}

.text-label-lg {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.text-label-md {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.text-label-sm {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════════════
   APP LAYOUT
   ════════════════════════════════════════════════════════════════════════ */

.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--outline);
    padding: 0 var(--content-padding);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.app-main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--content-padding);
    padding-bottom: calc(var(--nav-height) + var(--summary-height) + 24px);
    width: 100%;
}

.page-content {
    animation: pageEnter var(--motion-duration-extra-long)
        var(--motion-easing-emphasized);
}

.page-section {
    animation: revealFromBottom var(--motion-duration-long)
        var(--motion-easing-emphasized) forwards;
    opacity: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   HEADER COMPONENTS
   ════════════════════════════════════════════════════════════════════════ */

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--on-surface);
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.app-logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--shape-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow-primary);
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.app-logo:hover .logo-icon {
    transform: rotate(8deg) scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 229, 204, 0.5);
}

.logo-text {
    font-family: "Fredoka One", cursive;
    font-size: 24px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--shape-circle);
    border: 1px solid var(--outline);
    background: transparent;
    color: var(--on-surface-variant);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.header-btn:hover {
    background: var(--surface-container);
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.1);
}

.header-btn:active {
    transform: scale(0.95);
}

/* ════════════════════════════════════════════════════════════════════════
   BOTTOM NAVIGATION BAR - M3 Expressive v3
   ════════════════════════════════════════════════════════════════════════ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    padding-bottom: var(--safe-area-bottom);
    background: rgba(20, 22, 32, 0.92);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-top: 1px solid var(--outline);
    border-radius: var(--shape-extra-large-top);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-left: 8px;
    padding-right: 8px;
    padding-top: 8px;
    z-index: 1000;
    transform: translateY(100%);
    opacity: 0;
    transition:
        transform var(--motion-duration-long) var(--motion-easing-emphasized),
        opacity var(--motion-duration-medium) var(--motion-easing-decelerate),
        border-radius var(--motion-duration-medium)
            var(--motion-easing-standard);
}

.bottom-nav.visible {
    transform: translateY(0);
    opacity: 1;
}

.bottom-nav.transitioning {
    transform: translateY(0);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    border-radius: var(--shape-large);
    cursor: pointer;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    position: relative;
    background: transparent;
    border: none;
    color: var(--on-surface-variant);
    min-width: 72px;
}

.nav-item::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--gradient-primary);
    opacity: 0;
    transform: scale(0.8);
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    z-index: -1;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--on-surface);
}

.nav-item:hover .nav-icon {
    transform: translateY(-3px);
}

.nav-item.active {
    color: var(--on-primary);
}

.nav-item.active::before {
    opacity: 1;
    transform: scale(1);
}

.nav-item.active .nav-icon {
    transform: scale(1.15) translateY(-5px);
    animation: floatGently 2.5s ease-in-out infinite;
}

.nav-item.activating .nav-icon {
    animation: navItemPop var(--motion-duration-medium)
        var(--motion-easing-bounce);
}

.nav-icon {
    font-size: 26px;
    transition: transform var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    line-height: 1;
}

.nav-icon svg {
    width: 26px;
    height: 26px;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all var(--motion-duration-short);
}

.nav-indicator {
    position: absolute;
    top: 2px;
    right: 14px;
    width: 8px;
    height: 8px;
    background: var(--tertiary);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all var(--motion-duration-short) var(--motion-easing-bounce);
}

.nav-item.active .nav-indicator {
    opacity: 1;
    transform: scale(1);
    animation: pulseGlowSoft 2s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════════════════
   SUMMARY PANEL - Barre Récapitulative Flottante v3
   ════════════════════════════════════════════════════════════════════════ */

.summary-panel {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 12px);
    left: 16px;
    right: 16px;
    background: rgba(28, 30, 42, 0.95);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--outline);
    border-radius: var(--shape-large);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    z-index: 90;
    transform: translateY(150%) scale(0.95);
    opacity: 0;
    transition:
        transform var(--motion-duration-extra-long)
            var(--motion-easing-emphasized),
        opacity var(--motion-duration-long) var(--motion-easing-decelerate);
    box-shadow:
        var(--shadow-xl),
        0 -4px 24px rgba(0, 0, 0, 0.3);
}

.summary-panel.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.summary-panel.always-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.summary-panel.entering {
    animation: summarySlideUp var(--motion-duration-extra-long)
        var(--motion-easing-emphasized) forwards;
}

.summary-content {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    flex: 1;
    overflow: hidden;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

.summary-item:nth-child(1) {
    animation: revealSlideLeft var(--motion-duration-medium)
        var(--motion-easing-emphasized) forwards;
    animation-delay: 0ms;
    opacity: 0;
}
.summary-item:nth-child(2) {
    animation: revealSlideLeft var(--motion-duration-medium)
        var(--motion-easing-emphasized) forwards;
    animation-delay: 80ms;
    opacity: 0;
}

.summary-panel.visible .summary-item {
    opacity: 1;
}

.summary-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--on-surface-muted);
    font-weight: 700;
}

.summary-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--on-surface);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-value.empty {
    color: var(--on-surface-muted);
    font-style: italic;
    font-weight: 400;
}

.summary-value .tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--shape-pill);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.summary-value .tag.grand {
    background: var(--secondary-container-vivid);
    color: var(--secondary);
}

.summary-value .tag.petit {
    background: var(--primary-container-vivid);
    color: var(--primary);
}

.summary-action {
    flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   SECTION HEADERS
   ════════════════════════════════════════════════════════════════════════ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--outline-variant);
}

.section-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--shape-medium);
    background: var(--primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
}

.section-title {
    font-family: "Fredoka One", cursive;
    font-size: 24px;
    color: var(--on-surface);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-subtitle {
    color: var(--on-surface-variant);
    font-size: 13px;
    margin-top: 2px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 14px;
    border-radius: var(--shape-pill);
    font-size: 12px;
    font-weight: 700;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    white-space: nowrap;
}

.count-badge.grand {
    background: var(--secondary-container-vivid);
    color: var(--secondary);
    border: 1px solid rgba(183, 148, 246, 0.3);
}

.count-badge.petit {
    background: var(--primary-container-vivid);
    color: var(--primary);
    border: 1px solid rgba(0, 229, 204, 0.3);
}

.count-badge.complete {
    background: var(--success-container);
    color: var(--success);
    border: 1px solid rgba(110, 231, 183, 0.3);
}

.count-badge.error {
    background: var(--error-container);
    color: var(--error);
    border: 1px solid rgba(255, 123, 123, 0.3);
}

/* ════════════════════════════════════════════════════════════════════════
   GAME CARDS - Cards Morphables avec Miniatures v3
   ════════════════════════════════════════════════════════════════════════ */

.games-section {
    margin-bottom: 32px;
}

/* ─── Carousel Horizontal Premium ─── */
.games-carousel-wrapper {
    position: relative;
    margin: 0 calc(var(--content-padding) * -1);
    padding: 0 var(--content-padding);
}

.games-carousel {
    display: flex;
    gap: var(--card-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 12px 4px 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* Momentum scrolling iOS */
    -webkit-overflow-scrolling: touch;
}

.games-carousel::-webkit-scrollbar {
    display: none;
}

/* Carousel Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: var(--shape-circle);
    background: var(--surface-container-high);
    border: 1px solid var(--outline);
    color: var(--on-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    box-shadow: var(--shadow-lg);
}

.carousel-nav:hover {
    background: var(--primary);
    color: var(--on-primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-glow-primary);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav.prev {
    left: 4px;
}
.carousel-nav.next {
    right: 4px;
}

.games-carousel-wrapper:hover .carousel-nav {
    opacity: 1;
}

.carousel-nav:disabled {
    opacity: 0.3 !important;
    cursor: not-allowed;
    pointer-events: none;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: var(--outline);
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    cursor: pointer;
}

.carousel-dot:hover {
    background: var(--on-surface-variant);
    transform: scale(1.2);
}

.carousel-dot.active {
    width: 24px;
    background: var(--primary);
    box-shadow: var(--shadow-glow-turquoise);
}

/* ─── Game Card ─── */
.game-card {
    position: relative;
    flex: 0 0 auto;
    width: 150px;
    min-height: 180px;
    background: var(--gradient-card);
    border: 2px solid var(--outline);
    border-radius: var(--shape-large);
    padding: 16px 14px;
    cursor: pointer;
    transition:
        all var(--motion-duration-long) var(--motion-easing-emphasized),
        border-radius var(--motion-duration-medium)
            var(--motion-easing-expressive),
        box-shadow var(--motion-duration-medium) var(--motion-easing-standard);
    overflow: hidden;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
}

.game-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-expressive);
    opacity: 0;
    transition: opacity var(--motion-duration-medium);
    z-index: 0;
    pointer-events: none;
}

.game-card:hover {
    border-color: var(--primary);
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        var(--shadow-glow-turquoise);
}

.game-card:hover::before {
    opacity: 0.04;
}

.game-card:hover .mini-cell.filled {
    animation: cellPopSoft var(--motion-duration-short)
        var(--motion-easing-bounce);
}

/* Card Selected State - MORPHING EXPRESSIF */
.game-card.selected,
.game-card[aria-selected="true"] {
    border-color: var(--primary);
    border-width: 3px;
    border-radius: var(--shape-full);
    background: linear-gradient(
        145deg,
        var(--primary-container-vivid),
        rgba(0, 229, 204, 0.05)
    );
    animation: morphSelect var(--motion-duration-extra-long)
        var(--motion-easing-bounce) forwards;
    box-shadow: var(--shadow-glow-primary);
}

.game-card.selected::before {
    opacity: 0.06;
}

.game-card.selected-petit {
    border-color: var(--secondary);
    border-width: 3px;
    border-radius: var(--shape-full);
    background: linear-gradient(
        145deg,
        var(--secondary-container-vivid),
        rgba(183, 148, 246, 0.05)
    );
    animation: morphSelect var(--motion-duration-extra-long)
        var(--motion-easing-bounce) forwards;
    box-shadow: var(--shadow-glow-secondary);
}

.game-card.selected-petit::before {
    opacity: 0.06;
    background: var(--gradient-secondary);
}

/* Animation de sélection */
.game-card.selecting {
    animation: morphSelect var(--motion-duration-extra-long)
        var(--motion-easing-bounce) forwards;
}

.game-card.deselecting {
    animation: morphDeselect var(--motion-duration-long)
        var(--motion-easing-emphasized) forwards;
}

/* Card Check Indicator */
.card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid var(--outline);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: transparent;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    z-index: 2;
}

.game-card.selected .card-check,
.game-card.selected-petit .card-check {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    animation: checkPop var(--motion-duration-medium)
        var(--motion-easing-bounce);
}

.game-card.selected-petit .card-check {
    background: var(--secondary);
    border-color: var(--secondary);
}

/* Squares Badge */
.squares-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: var(--shape-pill);
    font-size: 10px;
    font-weight: 700;
    background: var(--info-container);
    color: var(--info);
    border: 1px solid rgba(125, 211, 252, 0.2);
    z-index: 2;
}

/* Miniature Grid */
.mini-grid-container {
    position: relative;
    z-index: 1;
    margin: 4px auto 10px;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
    width: 70px;
    height: 70px;
}

.mini-cell {
    border-radius: 3px;
    transition: all var(--motion-duration-micro) var(--motion-easing-emphasized);
    position: relative;
}

.mini-cell.empty {
    background: rgba(255, 255, 255, 0.04);
}

.mini-cell.filled {
    background: var(--primary);
    box-shadow: 0 0 8px rgba(0, 229, 204, 0.5);
}

.mini-cell.center {
    background: linear-gradient(135deg, var(--tertiary), var(--quaternary));
    box-shadow: 0 0 12px rgba(255, 217, 61, 0.6);
    animation: pulseGlowSoft 2s ease-in-out infinite;
}

.game-card.selected .mini-cell.filled {
    background: var(--secondary);
    box-shadow: 0 0 10px rgba(183, 148, 246, 0.6);
}

.game-card.selected .mini-cell.center {
    background: linear-gradient(135deg, var(--tertiary), var(--quaternary));
}

.game-card.selected-petit .mini-cell.filled {
    background: var(--primary);
}

/* Game Name */
.game-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--on-surface);
    text-align: center;
    text-transform: capitalize;
    position: relative;
    z-index: 1;
    margin-top: auto;
    line-height: 1.3;
}

.game-type-badge {
    display: inline-block;
    font-size: 9px;
    padding: 3px 10px;
    border-radius: var(--shape-pill);
    margin-top: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.game-type-badge.grand-type {
    background: var(--secondary-container-vivid);
    color: var(--secondary);
}

/* Grand Game Special - Larger Cards */
.game-card.grand-card {
    width: 180px;
    min-height: 200px;
}

.mini-grid-king {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
    width: 90px;
    height: 30px;
    margin: 4px auto;
}

.mini-grid-king .mini-cell.filled {
    background: var(--secondary);
    box-shadow: 0 0 4px rgba(183, 148, 246, 0.4);
}

/* Double Grid Display for Bingo/Ohana */
.double-grid-display {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 4px 0;
}

.double-grid-display .mini-grid {
    width: 55px;
    height: 55px;
    margin: 0;
}

/* Grid Selection Animation */
.game-card.selected .mini-grid,
.game-card.selected-petit .mini-grid {
    animation: pulseGlowSoft 3s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════════════════
   FILTER BAR - Filtres Morphables
   ════════════════════════════════════════════════════════════════════════ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.filter-label {
    font-size: 13px;
    color: var(--on-surface-variant);
    font-weight: 600;
    margin-right: 4px;
}

.filter-pill {
    padding: 8px 16px;
    border-radius: var(--shape-pill);
    border: 1px solid var(--outline);
    background: transparent;
    color: var(--on-surface-variant);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    font-family: inherit;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.filter-pill::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--motion-duration-medium);
    z-index: -1;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--on-surface-variant);
    color: var(--on-surface);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 229, 204, 0.3);
}

.filter-pill.active::before {
    opacity: 0.15;
}

.filter-pill.active::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        90deg,
        var(--primary),
        var(--secondary),
        var(--tertiary)
    );
    z-index: -2;
    opacity: 0;
    animation: shimmer 2.5s linear infinite;
    background-size: 200% 100%;
}

/* ════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS - Inputs & Buttons
   ════════════════════════════════════════════════════════════════════════ */

/* Text Input */
.text-input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--outline);
    border-radius: var(--shape-medium);
    color: var(--on-surface);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    outline: none;
}

.text-input:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(0, 229, 204, 0.15),
        var(--shadow-inner-glow);
    background: rgba(255, 255, 255, 0.08);
}

.text-input:focus:hover {
    border-color: var(--primary);
}

.text-input::placeholder {
    color: var(--on-surface-muted);
}

/* Primary Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--shape-medium);
    background: var(--gradient-primary);
    color: var(--on-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    box-shadow: var(--shadow-glow-primary);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: translateX(-100%);
    transition: transform var(--motion-duration-long);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 32px rgba(0, 229, 204, 0.45);
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary:disabled::before {
    display: none;
}

/* Secondary Button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid var(--outline);
    border-radius: var(--shape-medium);
    background: transparent;
    color: var(--on-surface);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: var(--primary-container);
    color: var(--primary);
}

/* FAB - Floating Action Button */
.fab {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--summary-height) + 20px);
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: var(--shape-large);
    background: var(--gradient-primary);
    border: none;
    color: var(--on-primary);
    font-size: 26px;
    cursor: pointer;
    z-index: 80;
    box-shadow: var(--shadow-glow-primary);
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 12px 48px rgba(0, 229, 204, 0.5);
}

.fab:active {
    transform: scale(0.95);
}

.fab.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* ════════════════════════════════════════════════════════════════════════
   CARDS & PANELS
   ════════════════════════════════════════════════════════════════════════ */

.card {
    background: var(--surface-container);
    border: 1px solid var(--outline);
    border-radius: var(--shape-large);
    padding: 24px;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.card:hover {
    border-color: var(--outline-variant);
    box-shadow: var(--shadow-lg);
}

.panel {
    background: var(--surface-container);
    border: 1px solid var(--outline);
    border-radius: var(--shape-large);
    padding: 28px;
    margin-bottom: 24px;
}

/* Model Name Section */
.model-name-section {
    background: var(--surface-container);
    border: 1px solid var(--outline);
    border-radius: var(--shape-large);
    padding: 24px;
    margin-bottom: 28px;
}

.model-name-section label {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--on-surface);
}

.model-name-section .label-icon {
    margin-right: 8px;
}

/* ════════════════════════════════════════════════════════════════════════
   LOADING STATES
   ════════════════════════════════════════════════════════════════════════ */

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--outline);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.spinner-lg {
    width: 64px;
    height: 64px;
    border-width: 4px;
}

.spinner-gradient {
    background: conic-gradient(
        from 0deg,
        var(--primary),
        var(--secondary),
        var(--tertiary),
        var(--primary)
    );
    animation: spin 1.5s linear infinite;
}

.loading-text {
    color: var(--on-surface-variant);
    font-size: 14px;
    animation: pulseOpacitySoft 2s ease-in-out infinite;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-container) 25%,
        var(--surface-container-high) 50%,
        var(--surface-container) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
    border-radius: var(--shape-small);
}

.skeleton-card {
    width: 150px;
    height: 180px;
    border-radius: var(--shape-large);
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-top: 8px;
}

.skeleton-text.short {
    width: 60%;
}

/* ════════════════════════════════════════════════════════════════════════
   VALIDATION & FEEDBACK
   ════════════════════════════════════════════════════════════════════════ */

.validation-msg {
    display: none;
    padding: 14px 20px;
    border-radius: var(--shape-medium);
    font-size: 14px;
    font-weight: 600;
    margin-top: 16px;
    align-items: center;
    gap: 10px;
    animation: revealFromBottom var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.validation-msg.show {
    display: flex;
}

.validation-msg.error {
    background: var(--error-container);
    color: var(--error);
    border: 1px solid rgba(255, 123, 123, 0.3);
}

.validation-msg.success {
    background: var(--success-container);
    color: var(--success);
    border: 1px solid rgba(110, 231, 183, 0.3);
}

.validation-msg.info {
    background: var(--info-container);
    color: var(--info);
    border: 1px solid rgba(125, 211, 252, 0.3);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--summary-height) + 60px);
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: var(--surface-container-highest);
    border: 1px solid var(--outline);
    border-radius: var(--shape-large);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-xl);
    z-index: 200;
    opacity: 0;
    transition: all var(--motion-duration-long) var(--motion-easing-emphasized);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 18px;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* ════════════════════════════════════════════════════════════════════════
   EXPANDABLE ACCORDION SECTIONS
   ════════════════════════════════════════════════════════════════════════ */

.accordion-section {
    margin-bottom: 20px;
    border-radius: var(--shape-large);
    overflow: hidden;
    background: var(--surface-container);
    border: 1px solid var(--outline);
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.accordion-section:hover {
    border-color: var(--outline-strong);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: var(--on-surface);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.accordion-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--shape-medium);
    background: var(--primary-container);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 20px;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.accordion-section.expanded .accordion-icon {
    background: var(--primary);
    color: var(--on-primary);
    transform: scale(1.1);
}

.accordion-title {
    font-weight: 700;
    font-size: 16px;
}

.accordion-subtitle {
    font-size: 13px;
    color: var(--on-surface-variant);
    margin-top: 2px;
}

.accordion-chevron {
    width: 24px;
    height: 24px;
    color: var(--on-surface-variant);
    transition: transform var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.accordion-section.expanded .accordion-chevron {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--motion-duration-extra-long)
        var(--motion-easing-emphasized);
}

.accordion-section.expanded .accordion-content {
    max-height: 2000px;
}

.accordion-content-inner {
    padding: 0 24px 24px;
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN - Breakpoints Premium
   ════════════════════════════════════════════════════════════════════════ */

/* Mobile < 640px */
@media (max-width: 640px) {
    :root {
        --content-padding: var(--content-padding-mobile);
        --nav-height: 68px;
        --summary-height: 72px;
    }

    .summary-panel {
        left: 12px;
        right: 12px;
        padding: 14px 16px;
    }

    .summary-content {
        gap: 16px;
    }

    .summary-item {
        min-width: 100px;
    }

    .game-card {
        width: 140px;
        min-height: 170px;
    }

    .section-title {
        font-size: 20px;
    }

    .bottom-nav {
        border-radius: var(--shape-extra-large-top);
    }
}

/* Tablet 640px - 1024px */
@media (min-width: 640px) and (max-width: 1024px) {
    :root {
        --content-padding: 24px;
    }

    .game-card {
        width: 160px;
    }

    .carousel-nav {
        opacity: 1;
    }
}

/* Desktop > 1024px */
@media (min-width: 1024px) {
    :root {
        --content-padding: 32px;
    }

    .app-container {
        padding-bottom: 0;
    }

    .app-main {
        padding-bottom: 100px;
    }

    /* Navigation latérale sur desktop */
    .bottom-nav {
        position: fixed;
        left: 0;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%) translateX(-100%);
        width: 80px;
        height: auto;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        border-radius: 0 var(--shape-large) var(--shape-large) 0;
        border-top: 1px solid var(--outline);
        border-right: 1px solid var(--outline);
        border-bottom: 1px solid var(--outline);
        border-left: none;
        padding: 16px 8px;
    }

    .bottom-nav.visible {
        transform: translateY(-50%) translateX(0);
    }

    .summary-panel {
        left: 100px;
        right: 24px;
    }

    .game-card {
        width: 165px;
        min-height: 185px;
    }

    .game-card.grand-card {
        width: 190px;
        min-height: 210px;
    }

    .games-carousel {
        padding: 12px 24px 20px;
        margin: 0 -24px;
    }

    .carousel-nav {
        opacity: 1;
    }
}

/* Large Desktop > 1440px */
@media (min-width: 1440px) {
    :root {
        --content-padding: 48px;
        --max-width: 1400px;
    }
}

/* ════════════════════════════════════════════════════════════════════════
   UTILITIES
   ════════════════════════════════════════════════════════════════════════ */

/* Display */
.hidden {
    display: none !important;
}
.invisible {
    visibility: hidden;
    pointer-events: none;
}
.visible {
    visibility: visible;
    pointer-events: auto;
}

/* Cursor */
.cursor-pointer {
    cursor: pointer;
}
.cursor-grab {
    cursor: grab;
}
.cursor-grabbing {
    cursor: grabbing;
}

/* Selection */
.no-select {
    user-select: none;
    -webkit-user-select: none;
}

/* Scroll */
.scroll-x {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}
.scroll-y {
    overflow-y: auto;
}

/* Hide scrollbar */
.hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Flex */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.flex-col {
    display: flex;
    flex-direction: column;
}
.flex-wrap {
    flex-wrap: wrap;
}
.flex-1 {
    flex: 1;
}
.flex-shrink-0 {
    flex-shrink: 0;
}

/* Spacing */
.gap-1 {
    gap: 4px;
}
.gap-2 {
    gap: 8px;
}
.gap-3 {
    gap: 12px;
}
.gap-4 {
    gap: 16px;
}
.gap-5 {
    gap: 20px;
}
.gap-6 {
    gap: 24px;
}

/* Margin */
.mt-1 {
    margin-top: 4px;
}
.mt-2 {
    margin-top: 8px;
}
.mt-3 {
    margin-top: 12px;
}
.mt-4 {
    margin-top: 16px;
}
.mt-5 {
    margin-top: 20px;
}
.mt-6 {
    margin-top: 24px;
}
.mb-1 {
    margin-bottom: 4px;
}
.mb-2 {
    margin-bottom: 8px;
}
.mb-3 {
    margin-bottom: 12px;
}
.mb-4 {
    margin-bottom: 16px;
}
.mb-5 {
    margin-bottom: 20px;
}
.mb-6 {
    margin-bottom: 24px;
}

/* Transitions */
.transition-all {
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}
.transition-transform {
    transition: transform var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}
.transition-opacity {
    transition: opacity var(--motion-duration-medium)
        var(--motion-easing-decelerate);
}
.transition-colors {
    transition:
        color var(--motion-duration-short),
        background-color var(--motion-duration-short),
        border-color var(--motion-duration-short);
}
.transition-shadow {
    transition: box-shadow var(--motion-duration-medium)
        var(--motion-easing-standard);
}

/* Animation Classes */
.animate-reveal {
    animation: revealFromBottom var(--motion-duration-long)
        var(--motion-easing-emphasized) forwards;
}
.animate-scale {
    animation: revealScale var(--motion-duration-medium)
        var(--motion-easing-emphasized) forwards;
}
.animate-pulse {
    animation: morphPulse var(--motion-duration-extra-long)
        var(--motion-easing-emphasized) infinite;
}
.animate-float {
    animation: floatBreath var(--motion-duration-ultra)
        var(--motion-easing-emphasized) infinite;
}
.animate-glow {
    animation: pulseGlowSoft 2s ease-in-out infinite;
}
.animate-spin {
    animation: spin 1s linear infinite;
}

/* Text Colors */
.text-primary {
    color: var(--primary);
}
.text-secondary {
    color: var(--secondary);
}
.text-muted {
    color: var(--on-surface-muted);
}
.text-success {
    color: var(--success);
}
.text-error {
    color: var(--error);
}
.text-warning {
    color: var(--warning);
}

/* ════════════════════════════════════════════════════════════════════════
   SPA & SMART SHELVES - Nouveaux Composants v3.1
   ════════════════════════════════════════════════════════════════════════ */

.input-field-m3 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 20px;
    font-size: 20px;
    pointer-events: none;
    transition: transform var(--motion-duration-medium)
        var(--motion-easing-emphasized);
}

.input-wrapper:focus-within .input-icon {
    transform: scale(1.2) rotate(-5deg);
    color: var(--primary);
}

.text-input {
    width: 100%;
    height: 60px;
    padding: 8px 20px 8px 56px;
    background: var(--surface-container-high);
    border: 2px solid transparent;
    border-radius: var(--shape-large);
    color: var(--on-surface);
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface-container-highest);
    box-shadow:
        0 0 0 4px rgba(0, 229, 204, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.game-explorer-container {
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.games-section {
    animation: revealFromBottom 600ms var(--motion-easing-emphasized) backwards;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--outline-variant);
}

.heading-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "Fredoka One", cursive;
    letter-spacing: 0.5px;
    color: var(--on-surface);
}

.count-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    background: var(--surface-container-highest);
    color: var(--on-surface-variant);
    transition: all var(--motion-duration-medium) var(--motion-easing-bounce);
    border: 1px solid var(--outline-variant);
}

.count-badge.grand.complete {
    background: var(--primary-container);
    color: var(--on-primary-container);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 229, 204, 0.3);
}

.count-badge.petit.complete {
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(230, 77, 156, 0.3);
}

/* --- Game Cards Premium --- */

.game-card {
    position: relative;
    flex: 0 0 160px;
    aspect-ratio: 0.85;
    background: var(--surface-container-low);
    border-radius: var(--shape-extra-large);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--motion-duration-medium)
        var(--motion-easing-emphasized);
    border: 1px solid var(--outline-variant);
    box-shadow: var(--shadow-1);
    scroll-snap-align: start;
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: var(--surface-container-high);
    border-color: var(--outline);
    box-shadow: var(--shadow-3);
    z-index: 10;
}

.game-card.selected {
    background: var(--primary-container);
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(0, 229, 204, 0.25);
}
/* ══════════════════════════════════════════════════════════
   A4 PREVIEW (WYSIWYG) - M3 Expressive
   ══════════════════════════════════════════════════════════ */
.a4-preview-container {
    background: var(--surface-container-highest);
    padding: 60px 20px;
    border-radius: var(--radius-xl);
    display: flex;
    justify-content: center;
    overflow-x: auto;
    margin-top: 24px;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.2);
}

.a4-paper {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    color: #1a1c1e;
    padding: 15mm;
    display: flex;
    flex-direction: column;
    font-family: "Inter", sans-serif;
    transform: scale(0.9);
    transform-origin: top center;
}

@media (max-width: 900px) {
    .a4-paper {
        transform: scale(0.5);
    }
    .a4-preview-container {
        padding: 20px 10px;
    }
}

.a4-header {
    border-bottom: 2px solid #e1e2e5;
    padding-bottom: 10mm;
    margin-bottom: 10mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.a4-brand {
    font-weight: 900;
    font-size: 24px;
    color: #1a1c1e;
    letter-spacing: -1px;
}
.brand-v {
    color: var(--primary);
    font-size: 14px;
    vertical-align: super;
}
.a4-model-name {
    font-weight: 700;
    color: #40474f;
    font-size: 18px;
}

.a4-content {
    flex: 1;
}

/* Grilles Preview */
.preview-section-grand {
    margin-bottom: 20mm;
    text-align: center;
}
.preview-label {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 800;
    color: #71777f;
    margin-bottom: 5mm;
    letter-spacing: 1.5px;
}

.grid-wrap-major {
    display: flex;
    justify-content: center;
}
.preview-grid.major {
    display: grid;
    grid-template-columns: repeat(5, 50px);
    grid-template-rows: repeat(5, 50px);
    gap: 4px;
    padding: 10px;
    background: #f1f3f7;
    border: 2px solid #e1e2e5;
}

.petits-grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10mm;
}

.grid-wrap-minor {
    display: flex;
    justify-content: center;
}
.preview-grid.minor {
    display: grid;
    grid-template-columns: repeat(5, 20px);
    grid-template-rows: repeat(5, 20px);
    gap: 2px;
    padding: 5px;
    background: #f9fafc;
    border: 1px solid #e1e2e5;
}

.p-cell {
    border-radius: 2px;
}
.p-cell.empty {
    background: #ffffff;
    border: 1px solid #e1e2e5;
}
.p-cell.filled {
    background: #1a1c1e;
}
.p-cell.center {
    background: #ffb4ab;
}

.a4-footer {
    border-top: 1px solid #e1e2e5;
    padding-top: 5mm;
    font-size: 10px;
    color: #71777f;
    display: flex;
    justify-content: space-between;
}

/* Generation Card */
.generation-card {
    padding: 32px;
    border-radius: var(--radius-xl);
}
.gen-header {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 32px;
}
.gen-icon {
    font-size: 48px;
}
.gen-inputs {
    margin-bottom: 32px;
}
.quantity-selector {
    display: flex;
    gap: 4px;
    max-width: 300px;
    margin: 0 auto;
}
.q-btn {
    width: 48px;
    border: none;
    background: var(--secondary-container);
    color: var(--on-secondary-container);
    border-radius: var(--radius-md);
    font-size: 20px;
    cursor: pointer;
}
.gen-presets {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 12px;
}
.chip {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--outline);
    background: transparent;
    color: var(--on-surface);
    font-size: 13px;
    cursor: pointer;
}
.chip:hover {
    background: var(--surface-container);
}

.gen-progress-container {
    margin-top: 24px;
    text-align: center;
}
.progress-bar {
    height: 8px;
    background: var(--surface-container-highest);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.progress-fill {
    width: 40%;
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    animation: progressAnim 2s infinite ease-in-out;
}

@keyframes progressAnim {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(250%);
    }
}
.game-card.selected-petit {
    background: var(--secondary-container);
    border-color: var(--secondary);
    box-shadow: 0 12px 24px rgba(230, 77, 156, 0.25);
}

.card-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        var(--primary),
        transparent 70%
    );
    opacity: 0;
    transition: opacity var(--motion-duration-long)
        var(--motion-easing-emphasized);
    pointer-events: none;
    mix-blend-mode: color-dodge;
}

.game-card.selected .card-glow {
    opacity: 0.3;
}

.game-card.selected-petit .card-glow {
    background: radial-gradient(
        circle at center,
        var(--secondary),
        transparent 70%
    );
    opacity: 0.3;
}

.selection-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    transform: scale(0) rotate(-45deg);
    transition: transform var(--motion-duration-medium)
        var(--motion-easing-bounce);
    box-shadow: 0 4px 12px rgba(0, 229, 204, 0.4);
    z-index: 5;
}

.game-card.selected-petit .selection-indicator {
    background: var(--secondary);
}

.game-card.selected .selection-indicator,
.game-card.selected-petit .selection-indicator {
    transform: scale(1) rotate(0deg);
}

.game-card.popping {
    animation: cardPop 260ms var(--motion-easing-emphasized);
}

@keyframes cardPop {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(0.965);
    }
    100% {
        transform: scale(1);
    }
}

/* --- Mini Grids --- */

.mini-grid-container {
    min-height: 110px;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        border-color 200ms ease,
        background 200ms ease;
    overflow: hidden;
}
.game-card:hover .mini-grid-container {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.1);
}
.mini-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    width: 100%;
    aspect-ratio: 1;
    max-width: 90px;
}
.mini-cell {
    border-radius: 3px;
    aspect-ratio: 1;
    transition:
        background 180ms ease,
        transform 180ms ease;
}
.mini-cell.empty {
    background: rgba(255, 255, 255, 0.06);
}
.mini-cell.filled {
    background: var(--primary);
    box-shadow: 0 0 4px rgba(0, 229, 204, 0.2);
}
.game-card.selected .mini-cell.filled {
    background: var(--primary-light);
    box-shadow: 0 0 5px rgba(0, 229, 204, 0.35);
}
.game-card.selected-petit .mini-cell.filled {
    background: var(--secondary);
    box-shadow: 0 0 5px rgba(183, 148, 246, 0.35);
}
.mini-cell.center {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.game-card.selected .mini-cell.center,
.game-card.selected-petit .mini-cell.center {
    background: rgba(255, 255, 255, 0.25);
}
/* Accentuation spéciale king */
.mini-cell.king-accent {
    background: var(--quaternary);
    box-shadow: 0 0 5px rgba(255, 217, 61, 0.35);
}
/* Double pour ohana */
.mini-cell.double {
    background: var(--secondary);
    box-shadow: 0 0 4px rgba(183, 148, 246, 0.25);
}

.game-info {
    width: 100%;
    text-align: center;
    margin-top: 12px;
}

.game-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.game-meta {
    color: var(--on-surface-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* --- Summary Panel Advanced --- */

.summary-panel {
    background: rgba(18, 20, 24, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.summary-value {
    transition: all 400ms var(--motion-easing-bounce);
}

.summary-value.empty {
    color: var(--on-surface-muted);
    font-style: italic;
    opacity: 0.6;
}

/* --- Transitions Clips --- */

#pageContent {
    transition: clip-path 600ms var(--motion-easing-emphasized);
}

.view-transition-morph {
    clip-path: circle(0% at center);
}

.view-transition-active {
    clip-path: circle(150% at center);
}

/* Utils pour la recherche */
.empty-search {
    padding: 60px 24px;
    text-align: center;
    color: var(--on-surface-muted);
    font-size: 1.2rem;
    font-style: italic;
    background: var(--surface-container-low);
    border-radius: var(--shape-extra-large);
    border: 2px dashed var(--outline-variant);
}

.game-card.selected .selection-indicator,
.game-card.selected-petit .selection-indicator {
    transform: scale(1);
}

.game-card.selected-petit .selection-indicator {
    background: var(--secondary);
    box-shadow: 0 4px 12px rgba(183, 148, 246, 0.4);
}

/* Animations Particulières */
@keyframes popping {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.92);
    }
    100% {
        transform: scale(1);
    }
}

.popping {
    animation: popping 400ms var(--motion-easing-emphasized);
}

.pulse-glow {
    animation: pulseGlowBtn 2s infinite;
}

@keyframes pulseGlowBtn {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 229, 204, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 229, 204, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 204, 0);
    }
}

/* Page Transition Helpers */
#pageContent {
    will-change: transform, opacity, filter;
}

/* ==========================================================================
   Guided Composer Overrides v4
   ========================================================================== */

.composer-hero,
.composer-fields,
.explorer-panel,
.composer-sidepanel,
.preview-empty,
.search-library,
.library-draft-card {
    background: linear-gradient(
        180deg,
        rgba(24, 27, 37, 0.96),
        rgba(16, 18, 26, 0.92)
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(0, 229, 204, 0.12);
    color: var(--primary-light);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.composer-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
    gap: 24px;
    padding: clamp(24px, 3vw, 36px);
    border-radius: 32px;
    overflow: hidden;
}

.composer-hero::before,
.explorer-panel::before,
.composer-sidepanel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(
            circle at top left,
            rgba(0, 229, 204, 0.1),
            transparent 36%
        ),
        radial-gradient(
            circle at bottom right,
            rgba(183, 148, 246, 0.12),
            transparent 40%
        );
}

.composer-hero,
.explorer-panel,
.composer-sidepanel {
    position: relative;
}

.composer-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.hero-stat {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hero-stat-value {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--on-surface);
}

.hero-stat-label {
    color: var(--on-surface-variant);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

.composer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
    gap: 24px;
    align-items: start;
    margin-top: 28px;
}

.composer-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(240px, 0.75fr);
    gap: 16px;
    padding: 18px;
    border-radius: 28px;
}

.composer-field-wide {
    min-width: 0;
}

.composer-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.composer-step {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--on-surface);
    text-align: left;
    transition:
        transform var(--motion-duration-medium) var(--motion-easing-emphasized),
        background var(--motion-duration-medium) var(--motion-easing-emphasized),
        border-color var(--motion-duration-medium)
            var(--motion-easing-emphasized);
}

.composer-step:hover {
    transform: translateY(-2px);
}
.composer-step.active {
    background: rgba(0, 229, 204, 0.12);
    border-color: rgba(0, 229, 204, 0.45);
}
.composer-step.done {
    box-shadow: inset 0 0 0 1px rgba(110, 231, 183, 0.35);
}
.composer-step-title {
    display: block;
    font-weight: 800;
    font-size: 1rem;
}
.composer-step-meta {
    display: block;
    margin-top: 6px;
    color: var(--on-surface-variant);
}

.explorer-panel {
    margin-top: 18px;
    padding: 22px;
    border-radius: 30px;
}

.explorer-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.explorer-counter {
    min-width: 88px;
    padding: 12px 16px;
    border-radius: 999px;
    text-align: center;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05);
}

.explorer-counter.grand {
    color: var(--primary-light);
}
.explorer-counter.petit {
    color: var(--secondary-light);
}

.category-rail {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 8px;
    margin-bottom: 18px;
    scrollbar-width: none;
}

.category-rail::-webkit-scrollbar {
    display: none;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 8px 10px;
    border-radius: var(--shape-pill);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--on-surface-variant);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition:
        background var(--motion-duration-short) var(--motion-easing-emphasized),
        border-color var(--motion-duration-short)
            var(--motion-easing-emphasized),
        color var(--motion-duration-short) var(--motion-easing-emphasized),
        transform var(--motion-duration-short) var(--motion-easing-expressive);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.category-chip:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}
.category-chip.active {
    background: var(--primary-container-vivid);
    border-color: rgba(0, 229, 204, 0.4);
    color: var(--primary-light);
    box-shadow:
        0 0 0 1px rgba(0, 229, 204, 0.12),
        0 4px 14px rgba(0, 229, 204, 0.12);
}
.category-chip:active {
    transform: scale(0.97);
}

.cat-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
}
.cat-label {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.cat-count {
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    padding: 2px 6px;
    border-radius: var(--shape-pill);
    background: rgba(255, 255, 255, 0.08);
    color: var(--on-surface-variant);
    text-align: center;
}
.category-chip.active .cat-count {
    background: rgba(0, 229, 204, 0.18);
    color: var(--primary-light);
}

.selection-tray {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 24px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.selection-group {
    display: grid;
    gap: 10px;
}
.selection-group-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--on-surface-variant);
}
.selection-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.selection-placeholder {
    color: var(--on-surface-muted);
}

.selection-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 0;
    font-weight: 700;
}

.selection-pill span {
    font-size: 18px;
    line-height: 1;
}
.selection-pill.primary {
    background: rgba(0, 229, 204, 0.18);
    color: var(--primary-light);
}
.selection-pill.secondary {
    background: rgba(183, 148, 246, 0.18);
    color: var(--secondary-light);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 14px;
}

.game-card {
    width: auto;
    min-height: 0;
    aspect-ratio: 0.86;
    padding: 14px;
    border-radius: 28px;
}

.game-card.grand-card {
    aspect-ratio: 0.92;
}
.game-card .mini-grid-container {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 22px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
}
.card-chip-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}
.card-type-badge,
.card-order-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}
.card-type-badge {
    background: rgba(255, 255, 255, 0.07);
    color: var(--on-surface-variant);
}
.card-order-badge {
    background: rgba(255, 255, 255, 0.06);
    color: var(--on-surface-muted);
    transform: scale(0.9);
    opacity: 0.75;
}
.card-order-badge.visible {
    background: var(--primary);
    color: var(--on-primary);
    transform: scale(1);
    opacity: 1;
}
.game-card.selected-petit .card-order-badge.visible {
    background: var(--secondary);
    color: var(--on-secondary);
}
.game-meta {
    color: var(--on-surface-variant);
}

.composer-sidepanel {
    padding: 22px;
    border-radius: 30px;
    position: sticky;
    top: 88px;
}

.recap-stack {
    display: grid;
    gap: 14px;
    margin: 18px 0;
}
.recap-card {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.recap-card.filled {
    background: rgba(255, 255, 255, 0.05);
}
.recap-kicker {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--on-surface-variant);
}
.recap-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}
.recap-card p {
    margin: 0;
    color: var(--on-surface-variant);
}

.inline-preview-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.04),
        rgba(255, 255, 255, 0.02)
    );
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.inline-preview-card.ready {
    border-color: rgba(0, 229, 204, 0.35);
    box-shadow:
        0 0 0 1px rgba(0, 229, 204, 0.16),
        0 16px 36px rgba(0, 0, 0, 0.22);
}
.preview-empty,
.search-library {
    padding: 28px;
    border-radius: 28px;
}
.library-draft-card {
    margin-top: 20px;
    padding: 20px;
    border-radius: 24px;
}
.preview-header-block {
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .composer-layout,
    .composer-hero,
    .composer-fields {
        grid-template-columns: 1fr;
    }

    .composer-sidepanel {
        position: static;
        top: auto;
    }
}

@media (max-width: 640px) {
    .composer-hero,
    .composer-fields,
    .explorer-panel,
    .composer-sidepanel,
    .preview-empty,
    .search-library {
        border-radius: 24px;
    }

    .composer-hero-stats,
    .composer-steps {
        grid-template-columns: 1fr;
    }

    .game-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .explorer-head,
    .summary-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .summary-action .btn-primary,
    #jumpToPreview {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Premium Expressive v5 Overrides
   ========================================================================== */

.bottom-nav {
    justify-content: center;
    gap: 10px;
}

.nav-item {
    min-width: 92px;
}

.compact-summary-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    overflow: hidden;
}

.workflow-rail {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin: 18px 0 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.workflow-rail::-webkit-scrollbar {
    display: none;
}

.workflow-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--on-surface-variant);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition:
        transform 180ms ease,
        background 180ms ease,
        border-color 180ms ease,
        color 180ms ease;
    white-space: nowrap;
    flex: 0 0 auto;
}

.workflow-chip:hover,
.workflow-chip:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--on-surface);
    transform: translateY(-1px);
}

.workflow-chip.active {
    background: linear-gradient(
        135deg,
        rgba(0, 229, 204, 0.18),
        rgba(183, 148, 246, 0.16)
    );
    border-color: rgba(0, 229, 204, 0.28);
    color: var(--on-surface);
}

.summary-scroll {
    overflow-x: auto;
    scrollbar-width: none;
}

.summary-scroll::-webkit-scrollbar {
    display: none;
}

.summary-track {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
    white-space: nowrap;
}

.summary-pill {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    min-width: 132px;
    padding: 12px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-pill.status.info {
    border-color: rgba(255, 255, 255, 0.1);
}

.summary-pill.status.warning {
    background: rgba(255, 217, 61, 0.12);
    border-color: rgba(255, 217, 61, 0.35);
}

.summary-pill.status.ready {
    background: rgba(0, 229, 204, 0.14);
    border-color: rgba(0, 229, 204, 0.35);
}

.summary-pill-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--on-surface-muted);
}

.summary-pill-value {
    color: var(--on-surface);
    font-weight: 700;
}

.composer-toolbar,
.composer-stage,
.generate-hero,
.generate-summary-shell,
.library-hero,
.library-search-panel,
.library-panel {
    background: linear-gradient(
        180deg,
        rgba(24, 27, 37, 0.96),
        rgba(16, 18, 26, 0.92)
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.composer-toolbar,
.composer-stage,
.generate-hero,
.generate-summary-shell,
.library-hero,
.library-search-panel,
.library-panel,
.preview-empty {
    border-radius: 30px;
}

.composer-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
    gap: 16px;
    padding: 18px;
    margin-top: 20px;
}

.toolbar-field-wide {
    min-width: 0;
}

.composer-stage,
.generate-summary-shell,
.library-panel {
    padding: 22px;
}

.stage-header,
.library-panel-head,
.generate-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.stage-header-petit {
    margin-bottom: 14px;
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 12px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--on-surface);
    font-weight: 800;
}

.grand-stage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.selection-inline {
    margin-bottom: 16px;
}

.selection-inline-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

.selection-inline-row::-webkit-scrollbar {
    display: none;
}

.selection-inline-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.selection-pills-wrap {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

@media(max-width: 639px) {
    #selectionInline {
        position: fixed;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        right: 12px;
        z-index: 60;
        margin-bottom: 0 !important;
        pointer-events: none; /* Let clicks pass through empty space */
    }
    
    @keyframes slideUpInline {
        from { transform: translateY(20px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .selection-inline-row {
        background: rgba(14, 16, 22, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.12);
        padding: 12px;
        justify-content: center;
        margin-bottom: 0px;
        pointer-events: auto; /* Re-enable clicks for the buttons */
        /* Animation fluide pour l'apparition */
        animation: slideUpInline 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
}

.selection-inline-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--on-surface-muted);
    font-weight: 800;
}

/* ═══ Carrousel Mini-Jeux M3 Expressive Snap ═══ */
.petit-catalog {
    min-height: 200px;
    position: relative;
}

.mini-carousel {
    position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   CINEMATIC DEPTH REVEAL — Desktop (>=640px)

   Principe :
   • Sortante  → balaye vers le côté en restant au premier plan,
                 légère rotation Y (comme retirer une carte du dessus
                 d'un jeu), accélération propre (ease-in sharp).
   • Entrante  → positionnée instantanément en profondeur (derrière),
                 angle Y directionnel selon prev/next, puis glisse
                 silencieusement vers l'avant — expo-out pur, zéro rebond.
   ═══════════════════════════════════════════════════════════════ */
.mini-carousel-track {
    position: relative;
    overflow: visible;
    /* La perspective est posée ici pour que les enfants absolute
       héritent du même espace 3D que la slide active */
    perspective: 1100px;
    perspective-origin: 50% 38%;
}

/* ── Repos : hors du flux, ne perturbe pas la hauteur de la piste ── */
.mini-carousel-slide {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
    transform-origin: center center;
    will-change: transform, opacity;
}

/* ── Active : dans le flux, détermine la hauteur ── */
.mini-carousel-slide.active {
    display: grid;
    position: relative;
    opacity: 1;
    pointer-events: auto;
    transform: translateZ(0) scale(1);
    z-index: 2;
    /* Transition utilisée si active est définie directement (ex. goTo(0)) */
    transition:
        opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Propriétés communes aux états de transition ──
   Superposées via position:absolute — n'affectent pas la hauteur du flux */
.mini-carousel-slide.slide-exit-left,
.mini-carousel-slide.slide-exit-right,
.mini-carousel-slide.slide-enter-from-behind,
.mini-carousel-slide.slide-enter-from-behind.from-next,
.mini-carousel-slide.slide-enter-from-behind.from-prev,
.mini-carousel-slide.slide-enter-active {
    display: grid;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ── EXIT gauche (navigation → suivant) ──
   La carte reste en premier plan et file vers la gauche.
   Légère rotation Y sur son bord droit : effet "retrait d'une carte". */
.mini-carousel-slide.slide-exit-left {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-106%) rotateY(12deg);
    z-index: 3;
    transition:
        opacity 340ms cubic-bezier(0.55, 0, 1, 0.45),
        transform 340ms cubic-bezier(0.55, 0, 1, 0.45);
}

/* ── EXIT droite (navigation → précédent) ── */
.mini-carousel-slide.slide-exit-right {
    opacity: 0;
    pointer-events: none;
    transform: translateX(106%) rotateY(-12deg);
    z-index: 3;
    transition:
        opacity 340ms cubic-bezier(0.55, 0, 1, 0.45),
        transform 340ms cubic-bezier(0.55, 0, 1, 0.45);
}

/* ── ENTER FROM BEHIND : positionnement instantané sans animation ──
   État de départ commun (fallback si pas de classe directionnelle). */
.mini-carousel-slide.slide-enter-from-behind {
    opacity: 0;
    pointer-events: none;
    transform: translateZ(-180px) scale(0.87);
    z-index: 1;
    transition: none;
}

/* Vient du côté droit (navigation → suivant) :
   légèrement à droite + face gauche visible en 3D */
.mini-carousel-slide.slide-enter-from-behind.from-next {
    transform: translateZ(-180px) translateX(20px) rotateY(-14deg) scale(0.87);
}

/* Vient du côté gauche (navigation → précédent) :
   légèrement à gauche + face droite visible en 3D */
.mini-carousel-slide.slide-enter-from-behind.from-prev {
    transform: translateZ(-180px) translateX(-20px) rotateY(14deg) scale(0.87);
}

/* ── ENTER ACTIVE : la carte avance vers le premier plan ──
   cubic-bezier(0.16, 1, 0.3, 1) = Expo Out — démarre vite,
   décélère de façon très fluide, s'arrête précisément. Zéro rebond. */
.mini-carousel-slide.slide-enter-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateZ(0) translateX(0) rotateY(0deg) scale(1);
    z-index: 2;
    transition:
        opacity 520ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 520ms cubic-bezier(0.16, 1, 0.3, 1);
}
.mini-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    background: rgba(14, 16, 22, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--on-surface);
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition:
        transform var(--motion-duration-short) var(--motion-easing-expressive),
        background var(--motion-duration-short) var(--motion-easing-emphasized),
        border-color var(--motion-duration-short)
            var(--motion-easing-emphasized);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.mini-carousel-nav:hover {
    background: rgba(183, 148, 246, 0.18);
    border-color: rgba(183, 148, 246, 0.45);
    transform: translateY(-50%) scale(1.08);
}
.mini-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}
.mini-carousel-nav.prev {
    left: -14px;
}
.mini-carousel-nav.next {
    right: -14px;
}
.mini-carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mini-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 4px 0;
}
.mini-carousel-dot {
    width: 8px;
    height: 8px;
    border: 0;
    border-radius: var(--shape-pill);
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    padding: 0;
    transition:
        width var(--motion-duration-medium) var(--motion-easing-expressive),
        background var(--motion-duration-medium) var(--motion-easing-emphasized);
}
.mini-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.4);
}
.mini-carousel-dot.active {
    width: 22px;
    background: var(--secondary);
    box-shadow: 0 0 6px rgba(183, 148, 246, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   GALLERY FOCUS — Mobile (<640px)
   Concept : 1 carte par snap-point, grille héros 180px (cellules
   36px), peek symétrique ±32px, spring scale 0.85 → 1.0
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 639px) {
    /* 1. Conteneur : clip le dépassement latéral des cartes voisines */
    .petit-catalog {
        overflow: hidden;
        /* Négatif pour absorber le scroll-padding de la piste */
        margin-inline: 0;
    }

    .mini-carousel {
        display: block;
        position: relative;
    }

    /* 2. Piste de défilement : snap start + scroll-padding pour le peek gauche */
    .mini-carousel-track {
        display: flex !important;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Slides à hauteur naturelle — pas d'étirement cross-axis */
        align-items: flex-start;
        gap: 14px;
        padding: 10px 32px 10px 20px;
        scroll-padding-left: 20px;
    }
    .mini-carousel-track::-webkit-scrollbar {
        display: none;
    }

    /* 3. Slide : une seule carte, largeur fixe en vw pour échapper
          au % du flex-container et garantir la même taille partout */
    .mini-carousel-slide {
        /* calc(100vw) − app-padding(24px) − stage-padding(44px)
           − track-padding-left(20px) − peek-right(32px) − gap(14px) = ~108px de moins */
        flex: 0 0 calc(100vw - 124px);
        min-width: 0;
        max-width: 300px;
        height: auto;
        display: block !important;
        scroll-snap-align: start;
        /* Cartes inactives : légèrement rétractées */
        opacity: 0.55;
        transform: scale(0.86) translateZ(0);
        transform-origin: left center;
        transition:
            opacity 320ms var(--motion-easing-emphasized),
            transform 380ms var(--motion-easing-expressive);
    }

    /* Carte active : plein régime */
    .mini-carousel-slide.active {
        opacity: 1;
        transform: scale(1) translateZ(0);
    }

    /* 4. Carte : block simple — pas de flex colonne, pas d'étirement */
    .mini-carousel-slide .game-card {
        display: block !important;
        padding: 14px !important;
        border-radius: 28px !important;
        height: auto !important;
        min-height: unset !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* Badge de catégorie + indicateur d'ordre */
    .mini-carousel-slide .card-chip-row {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px !important;
        gap: 8px;
    }
    .mini-carousel-slide .card-type-badge {
        font-size: 10px !important;
        padding: 5px 10px !important;
        letter-spacing: 0.07em !important;
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mini-carousel-slide .card-order-badge {
        flex-shrink: 0;
        min-width: 28px !important;
        min-height: 28px !important;
        font-size: 12px !important;
        border-radius: 50% !important;
    }

    /* 5. Container grille : aspect-ratio 1:1 = toujours carré, jamais d'espace vide */
    .mini-carousel-slide .mini-grid-container {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        /* Carré automatique : hauteur = largeur, peu importe le contexte */
        aspect-ratio: 1 / 1 !important;
        width: calc(100% - 0px) !important;
        max-height: calc(100vw - 110px) !important;
        max-width: 216px !important;
        /* Annule tout héritage de hauteur fixe ou min-height */
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        flex: unset !important;
        /* Centrage horizontal dans la carte (display:block parent) */
        margin: 0 auto 14px auto !important;
        padding: 12px !important;
        border-radius: 22px !important;
        background: rgba(255, 255, 255, 0.055) !important;
        border: 1px solid rgba(255, 255, 255, 0.09) !important;
        transition:
            background 200ms ease,
            border-color 200ms ease;
    }

    /* Carte sélectionnée : grille avec teinte accentuée */
    .mini-carousel-slide .game-card.selected-petit .mini-grid-container {
        background: rgba(183, 148, 246, 0.1) !important;
        border-color: rgba(183, 148, 246, 0.22) !important;
    }

    /* 6. Grille héros : remplit le container carré — cellules ~38px */
    .mini-carousel-slide .mini-grid {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        aspect-ratio: 1 / 1 !important;
        gap: 4px !important;
        margin: 0 !important;
    }

    /* Cellules héros */
    .mini-carousel-slide .mini-cell {
        border-radius: 4px !important;
    }
    .mini-carousel-slide .mini-cell.empty {
        background: rgba(255, 255, 255, 0.08) !important;
    }
    .mini-carousel-slide .mini-cell.filled {
        background: var(--primary) !important;
        box-shadow: 0 0 6px rgba(0, 229, 204, 0.28) !important;
    }
    .mini-carousel-slide .game-card.selected-petit .mini-cell.filled {
        background: var(--secondary) !important;
        box-shadow: 0 0 7px rgba(183, 148, 246, 0.38) !important;
    }
    .mini-carousel-slide .mini-cell.center {
        background: rgba(255, 255, 255, 0.22) !important;
        border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
    }

    /* 7. Infos en bas : centrées, lisibles */
    .mini-carousel-slide .game-info {
        text-align: center;
        margin-top: 10px;
    }
    .mini-carousel-slide .game-name {
        font-size: 16px !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        color: var(--on-surface) !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 3px;
    }
    .mini-carousel-slide .game-meta {
        font-size: 11px !important;
        color: var(--on-surface-variant) !important;
        text-align: center;
    }

    /* 8. Indicateur de sélection repositionné pour la mise en page portrait */
    .mini-carousel-slide .selection-indicator {
        position: absolute;
        top: 12px !important;
        right: 12px !important;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: var(--primary);
        color: var(--on-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px !important;
        font-weight: 900;
        box-shadow: 0 2px 8px rgba(0, 229, 204, 0.4);
    }

    /* 9. Masquer les nav arrows sur mobile (le swipe suffit) */
    .mini-carousel-nav {
        display: none !important;
    }

    /* 10. Compteur "3 / 23" à la place des dots */
    .mini-carousel-dots {
        display: none !important;
    }
}

/* ── Compteur mobile : affiché sous le carousel ── */
.carousel-counter {
    display: none; /* caché par défaut */
}
@media (max-width: 639px) {
    .carousel-counter {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        margin-top: 12px;
        height: 28px;
        user-select: none;
    }
    .counter-current {
        font-size: 18px;
        font-weight: 900;
        color: var(--primary-light);
        line-height: 1;
        min-width: 24px;
        text-align: right;
        transition: color 200ms ease;
    }
    .counter-sep {
        font-size: 13px;
        font-weight: 600;
        color: var(--on-surface-muted);
        line-height: 1;
    }
    .counter-total {
        font-size: 13px;
        font-weight: 700;
        color: var(--on-surface-variant);
        line-height: 1;
        min-width: 24px;
        text-align: left;
    }
}

.catalog-empty,
.library-error {
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.14);
    color: var(--on-surface-variant);
}

.catalog-empty {
    display: grid;
    gap: 4px;
}

.game-card.promo {
    min-height: 240px;
}

.grand-preview-frame {
    padding: 14px;
}

.grand-preview {
    width: 100%;
    display: grid;
    gap: 8px;
}

.grand-preview.twin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grand-preview.king {
    gap: 10px;
}

.king-strip {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 3px;
}

.king-cell {
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    background: rgba(0, 229, 204, 0.9);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15) inset;
}

.king-cell.soft {
    background: rgba(183, 148, 246, 0.7);
}

.ohana-grid .mini-cell.filled {
    background: linear-gradient(
        135deg,
        rgba(183, 148, 246, 1),
        rgba(0, 229, 204, 0.85)
    );
}

.mini-cell.double {
    /* Combine glow + inset border for ohana double-grid cells */
    box-shadow:
        0 0 5px rgba(183, 148, 246, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

/* King pattern : grille 5×5 réelle (motif K) */
.grand-preview.king-proper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.grand-preview.king-proper .mini-grid {
    max-width: 96px;
    width: 100%;
}

.generate-summary-bar {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
}

.generate-summary-bar::-webkit-scrollbar {
    display: none;
}

.generate-summary-pill {
    min-width: 180px;
    padding: 14px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.generate-summary-label,
.generate-selection-label,
.library-card-kicker {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--on-surface-muted);
    font-weight: 800;
}

.generate-summary-value {
    color: var(--on-surface);
}

.generate-panels,
.library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.generate-panel {
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.generate-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 12px;
}

.generate-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.generate-selection-card {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.generate-selection-card.grand {
    grid-column: 1 / -1;
}

.generate-selection-preview {
    margin-bottom: 12px;
}

.library-cards {
    display: grid;
    gap: 12px;
}

.library-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.library-card-copy h3 {
    margin: 0 0 10px;
}

.library-card-copy p {
    margin: 0 0 6px;
    color: var(--on-surface-variant);
}

.library-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 1024px) {
    .composer-toolbar,
    .generate-panels,
    .library-grid,
    .grand-stage-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .composer-toolbar,
    .composer-stage,
    .generate-hero,
    .generate-summary-shell,
    .library-hero,
    .library-search-panel,
    .library-panel,
    .preview-empty {
        border-radius: 24px;
    }

    .selection-inline-row,
    .library-card {
        flex-direction: column;
        align-items: stretch;
    }

    .generate-selection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grand-preview.twin {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PULPEUSE EXCLUSIVE THEME - VIBRANT & EXPRESSIVE
   ========================================================================== */

/* ── 1. Animated Bi-Color Blurred Background Orbs ── */
.pulpeuse-background-blur {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(ellipse at 20% 10%, #170a30 0%, #090412 100%);
}

.pulpeuse-background-blur .blob {
    position: absolute;
    border-radius: 50%;
    will-change: transform, filter;
}

.pulpeuse-background-blur .blob-1 {
    width: 65vw;
    height: 65vw;
    background: radial-gradient(circle at 40% 40%, #FF4DA6, #D6006A 60%);
    top: -15vw;
    left: -15vw;
    filter: blur(90px);
    opacity: 0.65;
    animation: blob-drift-a 20s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.pulpeuse-background-blur .blob-2 {
    width: 55vw;
    height: 55vw;
    background: radial-gradient(circle at 60% 60%, #FFA040, #E06000 60%);
    bottom: -12vw;
    right: -12vw;
    filter: blur(100px);
    opacity: 0.55;
    animation: blob-drift-b 26s infinite alternate-reverse cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

/* Third orb — Cyan — via pseudo-element */
.pulpeuse-background-blur::after {
    content: '';
    position: absolute;
    width: 42vw;
    height: 42vw;
    background: radial-gradient(circle at 50% 50%, #00E5CC, #00796B 70%);
    filter: blur(110px);
    top: 28vh;
    left: 38vw;
    opacity: 0.28;
    border-radius: 50%;
    animation: blob-drift-c 30s infinite linear;
}

@keyframes blob-drift-a {
    0%   { transform: translate(0vw,  0vh)  scale(1);    }
    25%  { transform: translate(12vw, 8vh)  scale(1.08); }
    50%  { transform: translate(5vw,  18vh) scale(0.93); }
    75%  { transform: translate(-8vw, 12vh) scale(1.05); }
    100% { transform: translate(4vw, -4vh)  scale(1.02); }
}

@keyframes blob-drift-b {
    0%   { transform: translate(0vw,   0vh)  scale(1);    }
    30%  { transform: translate(-10vw,-12vh) scale(1.1);  }
    60%  { transform: translate(-18vw,  5vh) scale(0.9);  }
    100% { transform: translate(-5vw,  10vh) scale(1.04); }
}

@keyframes blob-drift-c {
    0%   { transform: translate(0vw, 0vh)    rotate(0deg);   }
    33%  { transform: translate(-14vw, 12vh) rotate(120deg); }
    66%  { transform: translate(10vw,  18vh) rotate(240deg); }
    100% { transform: translate(0vw, 0vh)    rotate(360deg); }
}

/* Light mode adjustments */
[data-theme="light"] .pulpeuse-background-blur {
    background: #faf8ff;
}
[data-theme="light"] .pulpeuse-background-blur .blob-1 {
    background: radial-gradient(circle, #FF88C8, #FF4481 60%);
    opacity: 0.35;
}
[data-theme="light"] .pulpeuse-background-blur .blob-2 {
    background: radial-gradient(circle, #FFBB66, #FF8800 60%);
    opacity: 0.3;
}
[data-theme="light"] .pulpeuse-background-blur::after {
    background: radial-gradient(circle, #40E0D0, #00796B 70%);
    opacity: 0.22;
}

/* ── 2. Logo Pulpeuse — animated nail polish emoji ── */
.pulpeuse-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 22px;
    line-height: 1;
}
.pulpeuse-logo span {
    display: inline-block;
    animation: emoji-shimmy 6s ease-in-out infinite;
    transform-origin: bottom right;
}
@keyframes emoji-shimmy {
    0%, 55%, 100% { transform: rotate(0deg) scale(1);    }
    10%            { transform: rotate(16deg) scale(1.1); }
    20%            { transform: rotate(-10deg) scale(1);  }
    30%            { transform: rotate(14deg) scale(1.08);}
    40%            { transform: rotate(-4deg) scale(1);   }
    50%            { transform: rotate(8deg) scale(1.05); }
}

/* Logo text — gradient shimmer on hover */
.app-logo .logo-text {
    background: linear-gradient(90deg, var(--on-surface) 30%, #FF007F 50%, var(--on-surface) 70%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: background-position 0.4s ease;
}
.app-logo:hover .logo-text {
    background-position: right center;
}

/* ── 3. Header Action Button — base style (missing before!) ── */
.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    transition:
        transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        background 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

/* ── 4. Help Button — pulsing glow ring ── */
.pulpeuse-help-btn {
    color: var(--on-surface);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}
/* animated border pulse via box-shadow */
.pulpeuse-help-btn::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 999px;
    background: linear-gradient(135deg, #FF007F, #FF8C00, #00E5CC, #FF007F);
    background-size: 300% 300%;
    animation: border-spin 4s linear infinite;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.pulpeuse-help-btn:hover::before,
.pulpeuse-help-btn:focus-visible::before {
    opacity: 1;
}
.pulpeuse-help-btn:hover {
    transform: scale(1.06) translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 20px rgba(255, 0, 127, 0.35), 0 4px 16px rgba(0, 0, 0, 0.2);
}
.pulpeuse-help-btn:active {
    transform: scale(0.97);
}
.pulpeuse-help-btn .action-label {
    display: inline; /* visible on larger screens */
}
@media (max-width: 400px) {
    .pulpeuse-help-btn .action-label { display: none; }
}

@keyframes border-spin {
    0%   { background-position: 0% 50%;   }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%;   }
}

/* ── 5. Onboarding Dialog — full glassmorphism ── */
.pulpeuse-onboarding {
    /* Reset native dialog styles */
    margin: auto;
    border: none;
    background: transparent;
    padding: 0;
    overflow: visible;
    outline: none;
    /* Sizing */
    max-width: 440px;
    width: 92%;
    z-index: 9999;
    color: var(--on-surface);
}

.pulpeuse-onboarding::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    animation: backdrop-in 0.35s ease-out both;
}

@keyframes backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.pulpeuse-onboarding[open] {
    animation: modal-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: translateY(32px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Glassmorphism card */
.onboarding-content {
    position: relative;
    /* Glass background */
    background: rgba(18, 12, 32, 0.72);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-radius: 36px;
    overflow: hidden;
    padding: 36px 28px 28px;
    text-align: center;
    /* Layered shadow & inset shimmer border */
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.55),
        0 8px 32px rgba(255, 0, 127, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

/* Animated gradient border ring behind the card */
.onboarding-content::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 38px;
    background: linear-gradient(135deg, #FF007F, #FF8C00, #00E5CC, #FF007F);
    background-size: 300% 300%;
    animation: border-spin 5s linear infinite;
    z-index: -1;
    filter: blur(2px);
    opacity: 0.7;
}

/* Shine ribbon that sweeps across on open */
.onboarding-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 80%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.07) 50%,
        transparent 80%
    );
    animation: shine-sweep 2.5s 0.5s ease-out forwards;
    pointer-events: none;
}
@keyframes shine-sweep {
    from { left: -120%; }
    to   { left:  160%; }
}

[data-theme="light"] .onboarding-content {
    background: rgba(255, 255, 255, 0.82);
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.15),
        0 8px 32px rgba(255, 0, 127, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    color: #111;
}

/* ── Close button ── */
.onboarding-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: var(--on-surface);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
}
.onboarding-close:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(1.15) rotate(90deg);
    border-color: rgba(255, 255, 255, 0.25);
}
[data-theme="light"] .onboarding-close {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .onboarding-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ── Floating emoji hero ── */
.onboarding-emoji {
    display: inline-block;
    font-size: 72px;
    line-height: 1;
    margin-bottom: 20px;
    animation: emoji-float 3.5s ease-in-out infinite;
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.25));
}
@keyframes emoji-float {
    0%, 100% { transform: translateY(0px) scale(1)   rotate(-2deg); }
    40%       { transform: translateY(-14px) scale(1.06) rotate(2deg);  }
    80%       { transform: translateY(-6px)  scale(1.02) rotate(-1deg); }
}

/* ── Title ── */
.pulpeuse-onboarding h2 {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.6px;
    margin: 0 0 6px;
    line-height: 1.15;
    /* Animated gradient text */
    background: linear-gradient(90deg, #FF007F, #FF8C00, #FF007F);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: title-shimmer 4s linear infinite;
}
@keyframes title-shimmer {
    to { background-position: 200% center; }
}

/* ── Subtitle / page indicator ── */
.onboarding-subtitle {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.38);
    margin: 0 0 22px;
    /* Gradient pill */
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .onboarding-subtitle {
    color: rgba(0, 0, 0, 0.45);
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.07);
}

/* ── Description with step formatting ── */
.onboarding-desc {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
    text-align: left;
}
[data-theme="light"] .onboarding-desc {
    color: rgba(0, 0, 0, 0.65);
}
.onboarding-desc strong {
    color: #fff;
    font-weight: 800;
}
[data-theme="light"] .onboarding-desc strong {
    color: #111;
}
/* Circle step numbers ① ② ③ */
.onboarding-desc br + strong::before,
.onboarding-desc br + span::before {
    speak: none;
}

/* ── CTA button ── */
.onboarding-start-btn {
    width: 100%;
    padding: 17px 24px;
    border-radius: 999px;
    border: none;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #fff;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    /* Layered gradient */
    background: linear-gradient(135deg, #FF007F 0%, #FF5500 50%, #FF007F 100%);
    background-size: 200% auto;
    animation:
        cta-gradient-shift 3s linear infinite,
        cta-pulse 2.2s ease-in-out infinite;
    transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.28s ease;
    box-shadow:
        0 8px 28px rgba(255, 0, 127, 0.45),
        0 2px 8px rgba(0, 0, 0, 0.2);
}
/* Shine streak on the button */
.onboarding-start-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(105deg, transparent 20%, rgba(255,255,255,0.28) 50%, transparent 80%);
    animation: btn-shine 3s 1.5s ease-in-out infinite;
}
@keyframes btn-shine {
    0%, 100% { left: -75%; }
    50%       { left:  130%; }
}
.onboarding-start-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 14px 40px rgba(255, 0, 127, 0.65),
        0 4px 12px rgba(0, 0, 0, 0.25);
}
.onboarding-start-btn:active {
    transform: translateY(1px) scale(0.98);
}

@keyframes cta-gradient-shift {
    to { background-position: 200% center; }
}
@keyframes cta-pulse {
    0%, 100% { box-shadow: 0 8px 28px rgba(255, 0, 127, 0.45), 0 2px 8px rgba(0,0,0,0.2); }
    50%       { box-shadow: 0 8px 40px rgba(255, 0, 127, 0.7), 0 2px 8px rgba(0,0,0,0.2); }
}

/* ── Modal open/close animations ── */
@keyframes slide-up-fade {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Confetti system ── */
.pulpeuse-confetti-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}
.pulpeuse-confetti {
    position: absolute;
    top: -20px;
    pointer-events: none;
    animation: confetti-fall linear forwards;
    border-radius: 2px;
}
/* Horizontal drift via --drift; initial rotation via --init-rotate */
@keyframes confetti-fall {
    0% {
        transform: translateY(-20px) translateX(0px) rotate(var(--init-rotate, 0deg)) scale(1);
        opacity: 1;
    }
    80% { opacity: 1; }
    100% {
        transform: translateY(105vh) translateX(var(--drift, 0px)) rotate(calc(var(--init-rotate, 0deg) + 720deg)) scale(0.8);
        opacity: 0;
    }
}

/* fin */
