/* CSS Reset et base - Liquid Glass iOS 26 */

/* Cacher extra-tools sur mobile par défaut */
.extra-tools {
    display: none;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Fond avec fallback pour navigateurs ne supportant pas backdrop-filter */
    background: linear-gradient(180deg, 
        #4a90e2 0%, 
        #7b68ee 25%, 
        #9966cc 50%, 
        #ba55d3 75%, 
        #da70d6 100%);
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* Support des safe areas iOS (notch, barres système) */
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}


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

/* Particules flottantes pour effet liquid glass */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 40% 60%, rgba(103, 126, 234, 0.06) 0%, transparent 30%),
        radial-gradient(circle at 70% 30%, rgba(118, 75, 162, 0.04) 0%, transparent 35%),
        radial-gradient(circle at 20% 80%, rgba(240, 147, 251, 0.05) 0%, transparent 20%);
    animation: particlesFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes particlesFloat {
    0%, 100% {
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.8;
    }
    25% {
        transform: translateY(-20px) translateX(10px) scale(1.1);
        opacity: 0.9;
    }
    50% {
        transform: translateY(-10px) translateX(-15px) scale(0.9);
        opacity: 1;
    }
    75% {
        transform: translateY(-30px) translateX(8px) scale(1.05);
        opacity: 0.85;
    }
}

/* Container principal - Liquid Glass */
.editor-container {
    display: flex;
    flex-direction: column;
    /* Hauteur dynamique avec support multiple navigateurs */
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Safari iOS */
    min-height: 100dvh; /* Navigateurs modernes */
    width: 100vw;
    width: -webkit-fill-available;
    /* Fallback avec couleur opaque pour navigateurs sans backdrop-filter */
    background: rgba(240, 240, 255, 0.95);
    /* Backdrop-filter avec préfixes pour compatibilité */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    /* Amélioration avec @supports pour navigateurs modernes */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 16px));
    /* Safe areas iOS pour ne pas être caché par les encoches */
    padding: max(4px, env(safe-area-inset-top, 4px)) 
             max(4px, env(safe-area-inset-right, 4px)) 
             max(6px, env(safe-area-inset-bottom, 0px)) 
             max(4px, env(safe-area-inset-left, 4px));
    margin: 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: containerGlow 3s ease-in-out infinite alternate;
}

/* Amélioration pour navigateurs supportant backdrop-filter */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .editor-container {
        background: rgba(255, 255, 255, 0.1);
    }
}

@keyframes containerGlow {
    0% { 
        box-shadow: 
            0 8px 32px rgba(0, 0, 0, 0.1),
            0 2px 8px rgba(0, 0, 0, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    100% { 
        box-shadow: 
            0 12px 48px rgba(103, 126, 234, 0.2),
            0 4px 16px rgba(118, 75, 162, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* Project info optimisé avec menu hamburger - Liquid Glass */
.project-info {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 6px 10px;
    /* Fallback pour navigateurs sans backdrop-filter */
    background: linear-gradient(135deg,
        rgba(28, 58, 148, 0.9),
        rgba(123, 31, 162, 0.85)
    );
    backdrop-filter: blur(15px) saturate(200%);
    -webkit-backdrop-filter: blur(15px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    margin: calc(2px + env(safe-area-inset-top, 0px)) 4px 4px;
    color: #f4f6ff;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Amélioration pour navigateurs supportant backdrop-filter */
@supports (backdrop-filter: blur(15px)) or (-webkit-backdrop-filter: blur(15px)) {
    .project-info {
        background: linear-gradient(135deg,
            rgba(28, 58, 148, 0.75),
            rgba(123, 31, 162, 0.7)
        );
    }
}

.menu-hamburger {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0; /* Masquer le texte */
    width: 44px;
    height: 44px;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* Créer les icônes avec du CSS pur pour un alignement parfait */
.menu-hamburger::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: white;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    -webkit-transform: translate(-50%, -50%);
    -webkit-transform-origin: center center;
    box-shadow: 
        0 -6px 0 white,
        0 6px 0 white;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
}

/* Style quand le menu est ouvert (croix) */
.menu-hamburger.open::before {
    background: white;
    box-shadow: none;
    transform: translate(-50%, -50%) rotate(45deg);
    -webkit-transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: center center;
    -webkit-transform-origin: center center;
}

.menu-hamburger.open::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: white;
    transform: translate(-50%, -50%) rotate(-45deg);
    -webkit-transform: translate(-50%, -50%) rotate(-45deg);
    transform-origin: center center;
    -webkit-transform-origin: center center;
    margin: 0;
    padding: 0;
}

.menu-hamburger:hover, .menu-hamburger:active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(103, 126, 234, 0.3),
        0 4px 12px rgba(118, 75, 162, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}


.project-info h2 {
    font-size: 1.1rem;
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    flex: 1;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.3px;
}

.project-info .user-profile,
.project-info .logout-btn {
    display: none !important;
}

/* Toolbar principal avec boutons liquid glass - cachée par défaut */
.toolbar {
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    margin: 6px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.toolbar.visible {
    padding: 8px 6px;
    max-height: clamp(200px, 60vh, 400px);
    overflow: visible;
    opacity: 1;
    transform: translateY(0);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(103, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Outils avec boutons optimisés et compacts */
.tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    grid-auto-rows: minmax(44px, auto);
    gap: 4px;
    justify-content: center;
    align-content: start;
    width: 100%;
}

.tools button {
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: white;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    touch-action: manipulation;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 36px;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tools .logout-btn-mobile {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-height: 44px;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #ff5f6d 0%, #ffc371 100%);
    border: none;
    box-shadow: 0 8px 24px rgba(255, 95, 109, 0.35);
}

.tools .logout-btn-mobile:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(255, 95, 109, 0.4);
}

.tools button:hover {
    transform: translateY(-2px) scale(1.02);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 6px 20px rgba(103, 126, 234, 0.3),
        0 3px 10px rgba(118, 75, 162, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tools button:active {
    transform: translateY(0) scale(0.98);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Style spécial pour le bouton play/stop - Liquid Glass */
#previewBtn {
    font-size: 1.2rem !important;
    background: linear-gradient(135deg, 
        rgba(40, 167, 69, 0.8), 
        rgba(32, 201, 151, 0.8)) !important;
    backdrop-filter: blur(15px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(15px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 20px !important;
    color: white !important;
    font-weight: bold !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    min-width: 50px !important;
    box-shadow: 
        0 4px 16px rgba(40, 167, 69, 0.3),
        0 2px 8px rgba(32, 201, 151, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

#previewBtn:hover {
    background: linear-gradient(135deg, 
        rgba(33, 136, 56, 0.9), 
        rgba(26, 188, 156, 0.9)) !important;
    transform: translateY(-3px) scale(1.05) !important;
    box-shadow: 
        0 8px 32px rgba(40, 167, 69, 0.4),
        0 4px 16px rgba(32, 201, 151, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

#previewBtn:active {
    transform: translateY(-1px) scale(0.98) !important;
    background: linear-gradient(135deg, 
        rgba(30, 126, 52, 0.9), 
        rgba(23, 162, 184, 0.9)) !important;
    box-shadow: 
        0 4px 16px rgba(40, 167, 69, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Animation pulsante quand l'animation est en cours */
#previewBtn.playing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* Interface compacte mobile - Liquid Glass */
.tools-compact {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    padding: 8px;
    padding-left: calc(8px + env(safe-area-inset-left, 0px));
    padding-right: calc(8px + env(safe-area-inset-right, 0px));
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    margin: 0 0 8px;
    box-sizing: border-box;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(103, 126, 234, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    z-index: 1100;
}

body.is-mobile .editor-container {
    padding-top: max(4px, env(safe-area-inset-top, 4px));
}

.compact-tools {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Section couleur supprimée - plus nécessaire */

/* Ligne principale des outils */
.compact-main-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

/* Outils de gauche : Gomme + Couleur actuelle */
.compact-left-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Outils de droite : Undo/Redo */
.compact-right-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Container pour la couleur actuelle avec sélecteur caché */
.compact-current-color-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sélecteur de couleur invisible mais cliquable */
.compact-color-picker {
    position: absolute;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    z-index: 2;
}

/* Indicateur de couleur actuelle */
.compact-current-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background-color: #000000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    pointer-events: none;
    z-index: 1;
}

.compact-eraser-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.compact-eraser-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Bouton pipette compact */
.compact-eyedropper-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.compact-eyedropper-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.compact-eyedropper-btn.active {
    background: rgba(0, 122, 255, 0.3);
    border-color: rgba(0, 122, 255, 0.6);
    box-shadow: 0 0 12px rgba(0, 122, 255, 0.4);
}

.compact-eyedropper-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* Bouton valider couleur mobile */
.compact-validate-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border: 1px solid rgba(0, 255, 100, 0.4);
    border-radius: 8px;
    background: rgba(0, 255, 100, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.compact-validate-btn:hover:not(:disabled) {
    background: rgba(0, 255, 100, 0.3);
    border-color: rgba(0, 255, 100, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 255, 100, 0.3);
}

.compact-validate-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.compact-validate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.compact-undo-redo-btn {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.compact-undo-redo-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.3));
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.compact-undo-redo-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.compact-undo-redo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border-color: rgba(255, 255, 255, 0.2);
    transform: none;
}

.compact-undo-redo-btn:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Styles supprimés - plus de bouton de personnalisation */

/* Couleurs preset compactes */
.compact-preset-colors {
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) rgba(255, 255, 255, 0.1);
    -webkit-overflow-scrolling: touch;
    /* Espace pour la scrollbar en bas */
    padding-bottom: 8px;
    margin-bottom: -4px;
}

/* Style de la scrollbar pour WebKit (Chrome, Safari, Edge) */
.compact-preset-colors::-webkit-scrollbar {
    height: 6px;
}

.compact-preset-colors::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.compact-preset-colors::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.compact-preset-colors::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

.compact-color-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    max-width: 32px;
    max-height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

.compact-color-btn.custom-color {
    border-color: #007AFF;
    box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.3), 0 2px 6px rgba(0, 122, 255, 0.25);
}

.compact-color-btn.custom-color::after {
    content: '★';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #007AFF;
    color: #007AFF;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.compact-color-btn:hover {
    transform: scale(1.1);
    border-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.compact-color-btn.selected {
    border: 3px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* ========================================
   MODAL FPS
   ======================================== */

.fps-control {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

.fps-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.fps-value {
    font-size: 48px;
    color: #667eea;
}

.fps-label {
    font-size: 20px;
    color: #666;
}

.fps-desc {
    font-size: 16px;
    color: #999;
    font-weight: normal;
}

.fps-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.fps-slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #667eea, #764ba2);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.fps-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.fps-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 3px solid #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.fps-min, .fps-max {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.fps-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.fps-presets-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    width: 100%;
    margin-bottom: 5px;
}

.fps-preset-btn {
    flex: 1;
    min-width: 70px;
    padding: 10px 8px;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #667eea;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.fps-preset-btn small {
    display: block;
    font-size: 10px;
    margin-top: 2px;
    opacity: 0.7;
}

.fps-preset-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.fps-preset-btn.active {
    background: #667eea;
    color: white;
}

.fps-info {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
    color: #666;
}

.fps-info p {
    margin: 5px 0;
}

/* Modal de personnalisation de palette */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    /* Centrer le contenu du modal */
    align-items: center;
    justify-content: center;
}

/* Afficher le modal centré */
.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    /* Le margin n'est plus nécessaire car le modal est centré avec flexbox */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    color: white;
    margin: 0;
    font-size: 18px;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.palette-customizer {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.palette-colors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.palette-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.palette-color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.palette-color-preview:hover {
    transform: scale(1.1);
    border-color: white;
}

.palette-color-input {
    width: 100%;
    height: 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.palette-color-label {
    color: white;
    font-size: 12px;
    text-align: center;
    font-weight: 500;
}

.palette-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.reset-btn, .save-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reset-btn {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6464;
    border: 1px solid rgba(255, 100, 100, 0.3);
}

.reset-btn:hover {
    background: rgba(255, 100, 100, 0.3);
    transform: translateY(-1px);
}

.save-btn {
    background: rgba(100, 255, 100, 0.2);
    color: #64ff64;
    border: 1px solid rgba(100, 255, 100, 0.3);
}

.save-btn:hover {
    background: rgba(100, 255, 100, 0.3);
    transform: translateY(-1px);
}

/* Personnalisateur de couleur individuel */
.color-customizer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.current-color-preview {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.color-picker-full {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.color-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    width: 100%;
}

/* Section secondaire cachée sur mobile - utiliser l'interface compacte */
.tools-secondary {
    display: none;
}

/* Amélioration pour navigateurs supportant backdrop-filter */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .tools-secondary {
        background: rgba(255, 255, 255, 0.08);
    }
}

/* Styles pour les lignes d'outils */
.tools-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* Style spécial pour la ligne avec undo + couleurs + redo */
.tools-row:has(.preset-colors) {
    gap: 4px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 0;
}

/* Palette de couleurs compacte */
.color-palette {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

#colorPicker {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    cursor: pointer;
    outline: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#colorPicker:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.validate-color-btn {
    padding: 6px 8px;
    border: 2px solid #007AFF;
    border-radius: 4px;
    background-color: #007AFF;
    color: white;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.1s ease;
    min-height: 30px;
    min-width: 30px;
}

.validate-color-btn:hover {
    background-color: #0056b3;
    border-color: #0056b3;
    transform: scale(1.05);
}

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

.validate-color-btn:disabled {
    background-color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.undo-redo-btn {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 40px;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.undo-redo-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.undo-redo-btn:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.undo-redo-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.eraser-btn {
    padding: 10px 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-height: 40px;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.eraser-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.eraser-btn:active, .eraser-btn.active {
    background: rgba(255, 107, 107, 0.8);
    color: white;
    border-color: rgba(255, 82, 82, 0.8);
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 2px 8px rgba(255, 107, 107, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.preset-colors {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    overflow-x: auto;
    padding: 2px 0;
    flex: 1;
    min-width: 0;
}

.color-btn {
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px) saturate(180%);
    -webkit-backdrop-filter: blur(5px) saturate(180%);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.color-btn:hover {
    transform: scale(1.1) translateY(-2px);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.color-btn:active {
    transform: scale(0.95) translateY(0);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Styles pour les couleurs de base */
.color-btn.default-color {
    border: 2px solid #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.color-btn.default-color:hover {
    border-color: #999;
    transform: scale(1.05);
}

/* Styles pour les couleurs personnalisées */
.color-btn.custom-color {
    border: 2px solid #007AFF;
    box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.3), 0 2px 4px rgba(0, 122, 255, 0.2);
    position: relative;
}

.color-btn.custom-color::after {
    content: '★';
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6rem;
    color: #007AFF;
    background: white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #007AFF;
    font-weight: bold;
}

.color-btn.custom-color:hover {
    border-color: #0056b3;
    transform: scale(1.05);
}

/* Container de la grille - Liquid Glass */
.grid-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    margin: 4px;
    min-height: 200px;
    max-height: calc(100vh - 200px); /* Réduit pour desktop */
    max-height: clamp(280px, calc(100dvh - 180px), 600px); /* Ajuste pour les barres système mobiles */
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Grille de pixels - GARANTIE 32x32 cases exactes sur toutes plateformes */
#pixelGrid {
    display: grid;
    grid-template-columns: repeat(32, 1fr);
    grid-template-rows: repeat(32, 1fr);
    gap: 0;
    /* Fallback pour navigateurs sans backdrop-filter */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    aspect-ratio: 1 / 1; /* Garantir que la grille reste carrée */
    position: relative;
    margin: 0 auto;
    
    /* Calcul EXACT pour 32x32 cases avec clamp() pour plus de stabilité
       formule: (taille_case * 32) + border */
    --cell-size: clamp(
        8px,  /* Minimum absolu pour lisibilité */
        min(
            calc((100vw - max(20px, env(safe-area-inset-right, 0px) + env(safe-area-inset-left, 0px)) - 4px) / 32),
            calc((100vh - max(120px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) - 4px) / 32)
        ),
        18px  /* Maximum pour mobile standard */
    );
    
    width: calc(var(--cell-size) * 32);
    height: calc(var(--cell-size) * 32);
    
    /* Contraintes absolues pour éviter les déformations */
    min-width: calc(8px * 32);
    min-height: calc(8px * 32);
    max-width: calc(15px * 32);
    max-height: calc(15px * 32);
    
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(103, 126, 234, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Amélioration pour navigateurs supportant backdrop-filter */
@supports (backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px)) {
    #pixelGrid {
        background: rgba(255, 255, 255, 0.15);
    }
}

#pixelGrid:hover {
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.2),
        0 6px 24px rgba(103, 126, 234, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.pixel {
    width: 100%;
    height: 100%;
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
    background-color: #FFFFFF;
    cursor: crosshair;
    position: relative;
    transition: none;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Pour respecter les angles arrondis de la grille */
}

.pixel:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

/* Angles arrondis pour les pixels aux coins de la grille sur mobile */
#pixelGrid .pixel:nth-child(1) {
    border-top-left-radius: 5px; /* 8px - 2px de border - 1px de marge */
}

#pixelGrid .pixel:nth-child(32) {
    border-top-right-radius: 5px;
}

#pixelGrid .pixel:nth-child(993) {
    border-bottom-left-radius: 5px; /* 32 * 31 + 1 = 993 */
}

#pixelGrid .pixel:nth-child(1024) {
    border-bottom-right-radius: 5px; /* 32 * 32 = 1024 */
}

.pixel:active {
    outline: 1px solid #007AFF;
}

/* Mode pipette - curseur spécial */
#pixelGrid.eyedropper-mode .pixel {
    cursor: crosshair;
}

#pixelGrid.eyedropper-mode .pixel:hover,
#pixelGrid.eyedropper-mode .pixel:active {
    border-color: rgba(0, 122, 255, 0.6);
    border-width: 2px;
    box-shadow: 0 0 8px rgba(0, 122, 255, 0.4);
}

/* Bouton pipette actif */
.eyedropper-btn.active,
#eyedropperBtn.active {
    background: rgba(0, 122, 255, 0.3) !important;
    border-color: rgba(0, 122, 255, 0.6) !important;
    box-shadow: 0 0 12px rgba(0, 122, 255, 0.4) !important;
}

/* Animations pour les notifications pipette */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    15%, 85% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Container de frames optimisé - Liquid Glass */
.frames-container {
    /* Fallback pour navigateurs sans backdrop-filter */
    background: rgba(240, 240, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 12px;
    /* Marge bottom adaptative pour bannière pub + safe area */
    margin: 6px 6px 12px 6px;
    min-height: 120px;
    max-height: 160px;
    overflow-y: auto;
    flex-shrink: 0;
    position: relative;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Amélioration pour navigateurs supportant backdrop-filter */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .frames-container {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* Styles pour l'aide */
.help-content {
    padding: 20px;
    line-height: 1.6;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.help-content h2 {
    color: #007AFF;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    border-bottom: 2px solid #007AFF;
    padding-bottom: 10px;
}

.help-section {
    margin-bottom: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    border-left: 4px solid #007AFF;
}

.help-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-item {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.help-item:last-child {
    border-bottom: none;
}

.help-item strong {
    color: #007AFF;
    font-weight: 600;
}

.help-item kbd {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.9rem;
    margin: 0 2px;
}

.help-item ul {
    margin: 8px 0 0 20px;
    padding: 0;
}

.help-item li {
    margin: 4px 0;
}

/* Améliorer l'affichage sur mobile */
@media (max-width: 768px) {
    .editor-container {
        height: auto;
        min-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }
    
    .toolbar.visible {
        max-height: none;
        height: auto;
        overflow: visible;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    }
}

@media (max-width: 600px) {
    .help-content {
        padding: 15px;
    }
    
    .help-content h2 {
        font-size: 1.3rem;
    }
    
    .help-section h3 {
        font-size: 1.1rem;
    }
    
    .help-section {
        padding: 12px;
        margin-bottom: 20px;
    }
}

/* Styles pour le partage */
.share-content {
    padding: 20px;
    text-align: center;
}

.share-content h3 {
    color: #007AFF;
    margin-bottom: 15px;
}

.share-options {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-option {
    background: #f8f9fa;
    border: 2px solid #007AFF;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.share-option:hover {
    background: #007AFF;
    color: white;
    transform: translateY(-2px);
}

.share-option small {
    display: block;
    margin-top: 5px;
    opacity: 0.7;
    font-size: 0.9rem;
}

.share-instructions {
    background: #f0f8ff;
    border: 1px solid #007AFF;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: left;
}

.share-instructions code {
    background: #e6f3ff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

/* Drag & Drop styles */
body.drag-over {
    background-color: rgba(0, 122, 255, 0.1);
}

body.drag-over::before {
    content: '📤 Déposez votre fichier .pixelart ici pour l\'importer !';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 122, 255, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 10000;
    text-align: center;
    padding: 20px;
}

/* Animation pour le feedback drag & drop */
@keyframes dragPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

body.drag-over .grid-container {
    animation: dragPulse 1s infinite;
}

/* Styles pour l'interface de chargement */
.load-content {
    padding: 20px;
    text-align: center;
}

.load-content h3 {
    color: #007AFF;
    margin-bottom: 15px;
}

.load-options {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.load-option {
    background: #f8f9fa;
    border: 2px solid #007AFF;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.load-option:hover {
    background: #007AFF;
    color: white;
    transform: translateY(-2px);
}

.load-option small {
    display: block;
    margin-top: 5px;
    opacity: 0.7;
    font-size: 0.9rem;
}

.drop-zone {
    background: #f0f8ff;
    border: 2px dashed #007AFF;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    color: #007AFF;
    font-weight: 500;
    transition: all 0.2s ease;
}

.drop-zone.drag-active {
    background: #007AFF;
    color: white;
    transform: scale(1.02);
}

.load-instructions {
    background: #f0f8ff;
    border: 1px solid #007AFF;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: left;
}

.load-instructions ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.load-instructions li {
    margin: 8px 0;
    line-height: 1.4;
}

/* Améliorer les styles de partage pour iOS */
.share-option:first-child {
    background: linear-gradient(135deg, #007AFF, #0056b3);
    color: white;
    border-color: #0056b3;
    font-weight: 600;
}

.share-option:first-child:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

#addFrameBtn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, 
        rgba(40, 167, 69, 0.8), 
        rgba(32, 201, 151, 0.8));
    backdrop-filter: blur(15px) saturate(200%);
    -webkit-backdrop-filter: blur(15px) saturate(200%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    min-height: 44px;
    touch-action: manipulation;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 
        0 4px 16px rgba(40, 167, 69, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#addFrameBtn:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, 
        rgba(33, 136, 56, 0.9), 
        rgba(26, 188, 156, 0.9));
    box-shadow: 
        0 8px 24px rgba(40, 167, 69, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#addFrameBtn:active {
    transform: translateY(0) scale(0.98);
    background: linear-gradient(135deg, 
        rgba(30, 126, 52, 0.9), 
        rgba(23, 162, 184, 0.9));
    box-shadow: 
        0 2px 8px rgba(40, 167, 69, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ========================================
   BOUTONS FRAME ACTIONS (Copier/Coller)
   ======================================== */

.frame-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 5px;
}

.frame-action-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    backdrop-filter: blur(15px) saturate(200%);
    -webkit-backdrop-filter: blur(15px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.frame-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.frame-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.copy-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
}

.paste-btn {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
}

#addFrameBtn {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px) saturate(200%);
    -webkit-backdrop-filter: blur(15px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#addFrameBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#addFrameBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#framesList {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 4px 0;
    min-height: 50px; /* Hauteur minimale garantie */
}

/* Espace publicitaire réservé - Barre visible sans référence publicitaire */
.ad-space {
    height: 72px;
    background: rgba(240, 240, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: static;
    margin: 12px 6px 0 6px;
    padding: 0 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
    flex-shrink: 0;
    box-shadow: 
        0 -4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Amélioration pour navigateurs supportant backdrop-filter */
@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .ad-space {
        background: rgba(255, 255, 255, 0.08);
    }
}

/* Masquer tout contenu texte dans la barre */
.ad-space span,
.ad-space * {
    display: none;
    visibility: hidden;
}

/* Styles pour les frames */
.frame-container {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.frame-preview {
    padding: 2px;
    background-color: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    touch-action: manipulation;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.frame-preview.active {
    border-color: #007AFF;
    background-color: #e3f2fd;
    box-shadow: 0 0 0 1px rgba(0, 122, 255, 0.3);
}

/* Styles pour les miniatures de frames */
.frame-thumbnail {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    grid-template-rows: repeat(16, 1fr);
    width: 36px;
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 1px;
    overflow: hidden;
    position: relative;
    background: white;
}

.thumbnail-pixel {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

/* Numéro de frame pour les frames vides */
.frame-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: bold;
    color: #666;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.insert-frame-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

/* Dialogues et modales mobiles - Liquid Glass */
.save-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: modalBackdropFadeIn 0.3s ease;
}

.save-dialog-content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 
        0 16px 64px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(103, 126, 234, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
    animation: modalContentSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalContentSlideIn {
    from { 
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.save-dialog h3 {
    margin: 0 0 20px 0;
    text-align: center;
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.save-dialog input {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 16px;
    font-size: 1rem;
    margin-bottom: 20px;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.save-dialog input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.save-dialog input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 6px 20px rgba(103, 126, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.dialog-buttons {
    display: flex;
    gap: 12px;
}

.dialog-buttons button {
    flex: 1;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    touch-action: manipulation;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

#dialogSave {
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.8), 
        rgba(0, 86, 179, 0.8));
    color: white;
    box-shadow: 
        0 4px 16px rgba(0, 122, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#dialogSave:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(135deg, 
        rgba(0, 122, 255, 0.9), 
        rgba(0, 86, 179, 0.9));
    box-shadow: 
        0 8px 24px rgba(0, 122, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

#dialogCancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#dialogCancel:hover {
    transform: translateY(-1px) scale(1.01);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Marqueurs de pixels */
.previous-pixel-marker {
    position: absolute;
    width: 25%;
    height: 25%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.next-pixel-marker-1, .next-pixel-marker-2 {
    position: absolute;
    width: 20%;
    height: 20%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.next-pixel-marker-1 {
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.next-pixel-marker-2 {
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Styles pour la modal des crédits */
.credits-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.credits-content {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.close-credits {
    width: 100%;
    padding: 12px;
    background-color: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 16px;
    min-height: 44px;
    touch-action: manipulation;
}

/* ===================================================================
   MEDIA QUERIES POUR DIFFÉRENTES TAILLES D'ÉCRAN
   =================================================================== */

/* Très petits téléphones (iPhone SE 1st gen, etc.) */
@media screen and (max-width: 374px) {
    .project-info h2 {
        font-size: 0.95rem;
    }
    
    .tools button {
        font-size: 0.65rem;
        padding: 8px 10px;
        min-height: 36px;
    }
    
    #pixelGrid {
        --cell-size: clamp(
            6px,  /* Plus petit minimum pour très petits écrans */
            min(
                calc((100vw - max(16px, env(safe-area-inset-right, 0px) + env(safe-area-inset-left, 0px)) - 4px) / 32),
                calc((100vh - max(140px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) - 4px) / 32)
            ),
            12px
        );
        min-width: calc(6px * 32);
        min-height: calc(6px * 32);
        max-width: calc(12px * 32);
        max-height: calc(12px * 32);
    }
    
    .color-btn {
        width: 28px;
        height: 28px;
    }
    
    .frames-container {
        max-height: 100px;
        margin-bottom: 60px;
    }
}

/* Petits téléphones (iPhone SE 2nd gen, iPhone 12 mini) */
@media screen and (min-width: 375px) and (max-width: 413px) {
    .project-info h2 {
        font-size: 1rem;
    }
    
    #pixelGrid {
        --cell-size: clamp(
            7px,
            min(
                calc((100vw - max(18px, env(safe-area-inset-right, 0px) + env(safe-area-inset-left, 0px)) - 4px) / 32),
                calc((100vh - max(130px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) - 4px) / 32)
            ),
            13px
        );
        max-width: calc(13px * 32);
        max-height: calc(13px * 32);
    }
}

/* Téléphones moyens/grands (iPhone 12, 13, 14, Galaxy S21, etc.) */
@media screen and (min-width: 414px) and (max-width: 479px) {
    .project-info h2 {
        font-size: 1.15rem;
    }
    
    .tools button {
        font-size: 0.8rem;
        padding: 11px 13px;
    }
    
    #pixelGrid {
        --cell-size: clamp(
            8px,
            min(
                calc((100vw - max(20px, env(safe-area-inset-right, 0px) + env(safe-area-inset-left, 0px)) - 4px) / 32),
                calc((100vh - max(145px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) - 4px) / 32)
            ),
            14px
        );
        max-width: calc(14px * 32);
        max-height: calc(14px * 32);
    }
}

/* Grands téléphones (iPhone Pro Max, Galaxy Note, etc.) */
@media screen and (min-width: 480px) and (max-width: 767px) {
    .project-info h2 {
        font-size: 1.2rem;
    }
    
    .tools button {
        font-size: 0.85rem;
        padding: 12px 14px;
    }
    
    #pixelGrid {
        --cell-size: clamp(
            9px,
            min(
                calc((100vw - max(24px, env(safe-area-inset-right, 0px) + env(safe-area-inset-left, 0px)) - 4px) / 32),
                calc((100vh - max(120px, env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px)) - 4px) / 32)
            ),
            16px
        );
        max-width: calc(16px * 32);
        max-height: calc(16px * 32);
    }
    
    .frames-container {
        max-height: 140px;
    }
}

/* Tablettes en portrait (iPad, Galaxy Tab) */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    .toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px;
    }
    
    .tools {
        display: flex;
        flex-wrap: wrap;
        max-width: none;
    }
    
    .tools button {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .frames-container {
        max-height: 160px;
    }
    
    /* Grille plus grande sur tablettes */
    #pixelGrid {
        --cell-size: clamp(
            12px,
            min(
                calc((100vw - 32px - 4px) / 32),
                calc((100vh - 120px - 4px) / 32)
            ),
            20px
        );
        
        width: calc(var(--cell-size) * 32);
        height: calc(var(--cell-size) * 32);
        max-width: calc(20px * 32);
        max-height: calc(20px * 32);
        border-radius: 4px;
    }
    
    .project-info h2 {
        font-size: 1.4rem;
    }
}

/* Tablettes en paysage */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    .grid-container {
        max-height: calc(100vh - 200px);
    }
    
    #pixelGrid {
        --cell-size: clamp(
            10px,
            min(
                calc((100vw - 32px - 4px) / 32),
                calc((100vh - 160px - 4px) / 32)
            ),
            18px
        );
        max-width: calc(18px * 32);
        max-height: calc(18px * 32);
    }
    
    .frames-container {
        max-height: 120px;
    }
}

/* Optimisations spécifiques iOS Safari */
@supports (-webkit-touch-callout: none) {
    /* Fix pour la barre d'URL qui apparaît/disparaît sur iOS */
    .editor-container {
        height: 100vh;
        height: -webkit-fill-available;
    }
    
    .grid-container {
        /* Ajustement pour iOS Safari qui calcule mal parfois */
        max-height: calc(100vh - 280px);
        max-height: calc(-webkit-fill-available - 280px);
    }
}

/* DESKTOP LAYOUT SELON VOS SPECS - Nuancier gauche | Grille centre | Frames droite */

/* Amélioration pour menu hamburger - boutons plus compacts */
.toolbar.visible {
    max-height: clamp(200px, 60vh, 400px);
    overflow: visible;
    overscroll-behavior: contain;
}

.toolbar.visible .tools {
    gap: 3px;
}

.toolbar.visible .tools button {
    font-size: 0.7rem;
    padding: 6px 8px;
    min-height: 32px;
    line-height: 1.1;
}


/* ===================================================================
   OPTIMISATIONS POUR BARRES DU NAVIGATEUR ET ESPACE PERDU
   =================================================================== */

/* Récupérer l'espace perdu entre grille et bannière pub */
.grid-container {
    margin-bottom: 2px; /* Réduire l'espace perdu */
    padding-bottom: 4px; /* Optimiser le padding */
}

/* Optimisation pour barres grises du navigateur */
@media screen and (max-height: 700px) {
    .grid-container {
        max-height: calc(100vh - 160px); /* Plus d'espace pour la grille */
        max-height: calc(100dvh - 160px); /* Support barres dynamiques */
    }
    
    #pixelGrid {
        --cell-size: clamp(
            6px,
            min(
                calc((100vw - 20px - 4px) / 32),
                calc((100vh - 120px - 4px) / 32)
            ),
            12px
        );
    }
}

/* Fix spécifique pour Safari avec barres */
@supports (-webkit-touch-callout: none) {
    .grid-container {
        max-height: calc(100vh - 150px);
        max-height: calc(-webkit-fill-available - 150px);
    }
    
    #pixelGrid {
        --cell-size: clamp(
            7px,
            min(
                calc((100vw - 20px - 4px) / 32),
                calc((100vh - 110px - 4px) / 32)
            ),
            14px
        );
    }
}

/* Optimisation pour Chrome avec barres */
@media screen and (max-height: 600px) {
    .toolbar.visible {
        max-height: 180px; /* Menu plus compact sur petits écrans */
    }
    
    .grid-container {
        max-height: calc(100vh - 140px);
    }
    
    #pixelGrid {
        --cell-size: clamp(
            5px,
            min(
                calc((100vw - 16px - 4px) / 32),
                calc((100vh - 100px - 4px) / 32)
            ),
            10px
        );
    }
}


/* ===================================================================
   BOUTON PLAY DANS LA BARRE DU HAUT - STYLE IDENTIQUE AU HAMBURGER
   =================================================================== */

.play-button {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0; /* Masquer le texte */
    width: 44px;
    height: 44px;
    border-radius: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 10;
}

/* Créer l'icône play avec du CSS pur - PARFAITEMENT CENTRÉE */
.play-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-left: 10px solid white;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    transform: translate(-40%, -50%); /* Ajustement pour centrer parfaitement */
    transform-origin: center center;
    -webkit-transform: translate(-40%, -50%);
    -webkit-transform-origin: center center;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
}

/* Style quand l'animation est en cours (stop) - PARFAITEMENT CENTRÉ */
.play-button.playing::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: white;
    border: none;
    transform: translate(-50%, -50%); /* Parfaitement centré */
    -webkit-transform: translate(-50%, -50%);
    transform-origin: center center;
    -webkit-transform-origin: center center;
    margin: 0;
    padding: 0;
}

.play-button:hover, .play-button:active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(103, 126, 234, 0.3),
        0 4px 12px rgba(118, 75, 162, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* Animation pulse quand l'animation est en cours */
.play-button.playing {
    background: rgba(255, 0, 0, 0.3);
    animation: playButtonPulse 1s infinite;
}

@keyframes playButtonPulse {
    0% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.1); }
    100% { transform: translateY(-50%) scale(1); }
}
