/* --- 1. POLICES INDISPENSABLES --- */

/* Version droite */
@font-face {
    font-family: 'NotoSans';
    src: url('../fonts/NotoSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}


@font-face {
    font-family: 'Satisfy';
    src: url('../fonts/satisfy.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root { 
    --bg: #050510; 
    --panel: #121225; 
    --gold: #fcc201; 
    --blue: linear-gradient(#0974d9, #213384);
    --nav-height: 8dvh;
}

/* --- 2. STRUCTURE GLOBALE --- */
html, body { 
    height: 100dvh; 
    width: 100vw; 
    margin: 0; padding: 0; 
    overflow: hidden; 
    background: #000;
    font-family: 'NotoSans', sans-serif;
}

#canvas-wrapper { 
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 65dvh;
    display: flex; 
    align-items: flex-end; 
    justify-content: center; 
    z-index: 1;
}
#canvas-wrapper canvas {
    max-height: 100% !important;
    width: auto !important;
    object-fit: contain;
}

#p5-holder { 
    width: 100%; 
    height: 100%; 
    display: flex;
    align-items: flex-end; /* Aligne le bas du canvas sur le bas du wrapper */
    justify-content: center;
}

#defaultCanvas0 {
    display: block !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.studio-controls { 
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35dvh; 
    max-height: 35dvh; 
    background: var(--panel); 
    border-top: 2px solid var(--gold); 
    display: flex; 
    flex-direction: column; 
    padding-bottom: 7.222dvh; 
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.17, 0.84, 0.44, 1);
    overflow: visible !important;

    /* AJOUTS POUR LA STABILITÉ TACTILE */
    touch-action: none;   /* Empêche le scroll de la page derrière quand on manipule le menu */
    user-select: none;    /* Évite de sélectionner du texte par erreur en glissant */
}

/* On ne change que la hauteur pour l'ouvrir */
.studio-controls.expanded {
    height: 75dvh !important;
    max-height: 75dvh !important;
}

                    /* Ajoute ceci dans ton bloc <style> */
#inM, #inP {
    transition: opacity 0.4s ease-in-out;
}

.fade-out {
    opacity: 0;
}
     
        /* --- NOUVELLE SUPPORT-BAR IMBRIQUÉE --- */
.support-bar {
    width: 100%;
    background: none !important; /* On utilise le fond du bouton parent */
    height: 3dvh !important;    
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 0px !important;
    font-size: 1.0em !important;
    color: #aaaaaa !important;
    border: none !important;     /* On enlève les bordures internes */
    pointer-events: auto;        /* TRÈS IMPORTANT : permet de cliquer sur les liens */
}

.support-bar a { 
    color: var(--gold); 
    text-decoration: none; 
    font-weight: bold; 
    position: relative; 
    z-index: 100; /* Force le lien au-dessus du bouton */
}
        
    /* Style du bouton d'info (Commun PC et Mobile) */
.info-bubble {
    background-color: #d1ff00 !important;
    color: black !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    font-family: 'NotoSans', serif !important;
    font-weight: bold !important;
    line-height: 1 !important;
    width: 16px!important;
    height: 16px !important;
    font-size: 11px;
    margin-left: 5px;
}
        
 

.tab-content { 
    flex: 1; 
    padding: 10px 15px; 
    display: none; 
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch;
    position: relative;

    /* AJOUT POUR PERMETTRE LE SCROLL INTERNE */
    touch-action: pan-y; /* Autorise uniquement le défilement de haut en bas ici */
    pointer-events: auto; /* S'assure que les clics passent bien */
}
        .tab-content.active { display: block; }
      
        .nav-tabs { 
    height: var(--nav-height); 
    display: flex; 
    background: none; 
    width: 100%; 
    z-index: 100;
    flex-shrink: 0; 

    /* --- AJOUTE CES LIGNES POUR COLLER EN BAS --- */
    position: fixed;
    bottom: 0;
    left: 0;
}
/* Bouton 1 : DÉCORS - Un Violet Améthyste plus vif */
.nav-tabs .tab-btn:nth-child(1) { 
    background: linear-gradient(to bottom, #4a2b7d, #0d081a); 
}

/* Bouton 2 : TEXTES - Un Bleu Pétrole électrique */
.nav-tabs .tab-btn:nth-child(2) { 
    background: linear-gradient(to bottom, #1b5d7d, #07121a); 
}

/* Bouton 3 : MUSIQUES - Ton bleu magnifique (on ne touche à rien !) */
.nav-tabs .tab-btn:nth-child(3) { 
    background: var(--blue); 
}

/* Bouton 4 : ENVOYER - Un Vert Émeraude précieux */
.nav-tabs .tab-btn:nth-child(4) { 
    background: linear-gradient(to bottom, #1b7d5d, #061a12); 
}
.tab-btn.active { 
    filter: brightness(1.2); /* Boost légèrement la couleur du bouton sélectionné */
    box-shadow: inset 0 5px 15px rgba(255, 255, 255, 0.05); /* Reflet de lumière interne */
}

/* --- EFFET ÉTINCELLES RÉALISTES (VERSION LONGUE & OPTIMISÉE) --- */
.particle {
    position: fixed;
    pointer-events: none;
    width: 2px; /* Plus fin = plus élégant sur la durée */
    height: 2px;
    background: var(--p-color, #fff); /* Pas de dégradé, couleur pure */
    border-radius: 50%;
    z-index: 99999;
    will-change: transform; 
    box-shadow: 0 0 4px var(--p-color, #fff); /* Ombre légère */
    animation: disappear 5.8s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}

@keyframes disappear {
    0% { 
        transform: translate(0, 0) scale(1.5); 
        opacity: 1; 
    }
    100% { 
        transform: translate(var(--x), var(--y)) scale(0); 
        opacity: 0; 
    }
}
        .tab-btn { 
    flex: 1; 
    border-right: 1px solid rgba(255, 255, 255, 0.2); 
    background: none; 
    color: #fff; 
    font-size: 0.75em; /* Un poil plus grand pour le gras */
    font-weight: bold; /* ICI LE TEXTE EN GRAS */
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    border-bottom: none; 
    border-top:none; 
    border-left:none; 
}
        .tab-btn.active { color: var(--gold); border-bottom: 4px solid var(--gold); }
        .tab-btn span { font-size: 1.5em; margin-bottom: 2px; }
        .grid-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
        .btn-opt { background: #1c1c3c; border: 1px solid #444; color: white; padding: 10px 5px; border-radius: 8px; cursor: pointer; font-size: 0.75em; }
        .color-picker, .saints-row { 
    display: none; 
    gap: 8px; 
    /* On supprime les marges extérieures pour éviter le cumul */
    margin: 0 0 0px 0 !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    background: rgba(0,0,0,0.4); 
    padding: 8px; 
    border-radius: 8px; 
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    scrollbar-width: none;
}
     /* Cache la barre de défilement sur Chrome/Safari pour garder le look épuré */
   .color-picker::-webkit-scrollbar, .saints-row::-webkit-scrollbar {
    display: none;
}      
/* On crée une classe pour l'état "Ouvert" */
.popup-visible {
    display: flex !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}
        .color-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; cursor: pointer; }
        
        .saint-btn { background: var(--gold); color: #000; border: none; padding: 6px 12px; border-radius: 15px; font-size: 0.7em; white-space: nowrap; font-weight: bold; cursor: pointer; }
        input[type="text"] { width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #444; background: #000; color: white; box-sizing: border-box; font-size: 16px; }
        input[type="range"] { accent-color: var(--gold); cursor: pointer; }
        .tab-content h4 { 
    margin-top: 0 !important; 
    margin-bottom: 5px !important; 
    font-size: 0.7em; 
}

.control-group {
    margin-bottom: 5px !important;
    margin-top: 0px !important;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 8px;
}

.color-picker:not(.popup-visible), .saints-row:not(.popup-visible) {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    overflow: hidden;
}

/* Ajustements pour PC */
@media (min-width: 768px) {
    
    .saint-btn { 
        font-size: 0.9em; /* Plus lisible sur grand écran */
        padding: 8px 16px; 
    }
    /* Bouton Phrases Magiques */
    #tab-text > .btn-opt:first-of-type { 
        font-size: 1em !important; 
        padding: 15px !important;
    }
    .tab-btn { font-size: 0.8em; } /* Icônes du menu bas */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

   /* La zone qui contient les miniatures */
/* GARDE CE BLOC POUR LA STRUCTURE */
.scroll-menu {
    display: flex;             /* Aligne les images en ligne */
    overflow-x: auto;          /* Active le défilement horizontal */
    overflow-y: hidden;        /* Interdit le défilement vertical */
    gap: 12px;                 /* Espace entre les images */
    padding: 20px 5px;
    -webkit-overflow-scrolling: touch; /* Défilement fluide sur iPhone */
    scrollbar-width: auto; 
}

/* Les miniatures elles-mêmes */
.btn-miniature {
    min-width: 90px;        /* Largeur fixe pour qu'elles ne s'écrasent pas */
    height: 90px;           /* Hauteur fixe */
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.1);
    cursor: pointer;
    flex-shrink: 0;         /* Empêche l'image de rétrécir */
    transition: transform 0.2s;
}


.btn-miniature:hover {
    border-color: var(--gold);
    transform: scale(1.05);
}

/* 1. Empêche l'onglet Décor de devenir trop grand si tu as 20 catégories */
#tab-look {
    max-height: 100%; /* Ajuste selon tes préférences */
    overflow-y: auto;  /* Permet de scroller les titres de catégories si besoin */
}

/* 2. Pour que les titres (Espace, Nature...) soient bien nets */
#tab-look h5 {
    color: var(--gold);
    margin: 15px 0 5px 5px;
    font-size: 0.8em;
    text-transform: uppercase;
}
    #tab-text .btn-opt {
    margin-bottom: 8px !important; /* Crée un "garage" vide pour les menus absolus */
}

/* Cible les écrans tablettes et formats "carrés" ou horizontaux */
@media (max-aspect-ratio: 4/3), (max-height: 700px) {
    #defaultCanvas0 {
        /* On force le canvas à ne jamais dépasser 45% de la hauteur de l'écran */
        max-height: 45dvh !important;
        width: auto !important; /* Garde les proportions */
        object-fit: contain;
    }
}




/* Au survol, on arrête l'animation pour que ce soit facile de cliquer */
.lien-aum:hover {
    animation-play-state: paused;
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 0 0 10px var(--gold);
}

.input-wrapper {
    height: 42px; /* Ajuste selon la hauteur de tes inputs */
    display: flex;
    align-items: center;
}

.placeholder-marquee {
    position: absolute;
    white-space: nowrap;
    /* Couleur grise standard des placeholders (souvent #757575 ou #888) */
    color: #888; 
    /* On force la même taille que tes inputs réels */
    font-size: 16px; 
    font-family: 'NotoSans', sans-serif;
    z-index: 1;
    pointer-events: none; 
    width: 100%;
    /* On centre verticalement pour être aligné avec le curseur */
    display: flex;
    align-items: center;
    height: 100%; 
}

.placeholder-marquee span {
    display: inline-block;
    padding-left: 10px; 
    /* On change l'animation pour qu'elle soit plus courte et "infinie" */
    animation: marquee-p 15s linear infinite; 
    white-space: nowrap;
}

@keyframes marquee-p {
    0% { transform: translateX(0); }
    /* On ne va plus jusqu'à -150%, on s'arrête exactement à la moitié 
       puisque le texte est doublé. L'œil ne verra pas la coupure. */
    100% { transform: translateX(-50%); } 
}

/* Cache le texte qui défile si l'utilisateur a écrit quelque chose */
.input-hidden {
    display: none !important;
}

/* --- L'ULTIME CORRECTIF FIREFOX --- */

/* 1. Configuration Globale */
* {
    box-sizing: border-box;
    /* On définit la couleur : [Curseur] [Piste] */
    scrollbar-color: #007bff #1a1a2e !important; 
    scrollbar-width: auto !important;
}

/* 2. Forcer l'affichage sur les zones de scroll */
.scroll-menu, .tab-content, #tab-look {
    overflow-x: scroll !important;
    overflow-y: auto !important;
    /* Empêche Firefox de cacher la barre pour économiser de l'espace */
    scrollbar-gutter: stable !important;
}

/* 3. LE CASSE-TÊTE CHROME (Lui, il affiche les flèches) */
::-webkit-scrollbar {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
}

::-webkit-scrollbar-track {
    background: #0a0a0a !important;
}

::-webkit-scrollbar-thumb {
    background: #007bff !important;
    border-radius: 10px !important;
    border: 2px solid #0a0a0a !important;
}

/* Flèches pour Chrome uniquement */
::-webkit-scrollbar-button:single-button {
    background-color: #0a0a0a !important;
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    background-size: 10px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* SVG des flèches pour Chrome */
::-webkit-scrollbar-button:single-button:horizontal:decrement {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23007bff'><polygon points='0,50 100,0 100,100'/></svg>") !important;
}
::-webkit-scrollbar-button:single-button:horizontal:increment {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23007bff'><polygon points='100,50 0,0 0,100'/></svg>") !important;
}

/* --- AJOUTS FINAUX (Sans modifier le reste) --- */

/* 1. Couleurs des boutons de navigation */
.nav-tabs .tab-btn:nth-child(1) { background: linear-gradient(to bottom, #4a2b7d, #0d081a) !important; }
.nav-tabs .tab-btn:nth-child(2) { background: linear-gradient(to bottom, #1b5d7d, #07121a) !important; }
.nav-tabs .tab-btn:nth-child(3) { background: var(--blue) !important; }
.nav-tabs .tab-btn:nth-child(4) { background: linear-gradient(to bottom, #1b7d5d, #061a12) !important; border-right: none; }



@keyframes surgit {
    from { bottom: -50px; opacity: 0; }
    to { bottom: 30px; opacity: 1; }
}

/* --- BOUTON SPÉCIFIQUE : ROUVRIR L'ARBRE --- */
.btn-special-arbre {
    background: linear-gradient(to bottom, #49a042, #463304) !important;
    color: #a0ff56 !important;
    border: 1px solid #000000 !important;
    font-weight: bold !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-special-arbre:hover {
    background: linear-gradient(to bottom, #1af609, #463304) !important;
    color: #a0ff56 !important;
    border: 1px solid #FF9800 !important;
    box-shadow: 0 0 20px #ffd600;
    transform: scale(1.02);
}

/* --- FIX POUR LES POPUPS FLASH (TOASTS) --- */
.toast-signal {
    position: fixed !important; /* Fixe par rapport à l'écran, pas au scroll */
    bottom: 120px;             /* Apparaît au-dessus de la nav-bar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 28, 60, 0.95);
    color: var(--gold);
    border: 2px solid var(--gold);
    padding: 12px 20px;
    border-radius: 50px;
    z-index: 10000000;         /* Devant le studio et la pub */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    pointer-events: none;      /* Empêche de bloquer les clics derrière */
    white-space: nowrap;
    animation: surgitToast 0.4s ease-out;
}

@keyframes surgitToast {
    from { opacity: 0; bottom: 80px; }
    to { opacity: 1; bottom: 120px; }
}

/* --- OPTIMISATION UNIQUEMENT MOBILE (VERSION FINALE PETITS ÉCRANS) --- */
@media (max-width: 768px) {
    #drawer-toggle {
        /* 2.5rem équivaut à environ 40px, c'est idéal pour un pouce */
        height: 2.5rem !important; 
        min-height: 2.5rem !important;
        
        /* On remplace les paddings px par des unités flexibles */
        padding: 0.2rem 0 !important; 
        
        /* Force le centrage parfait sans dépendre du line-height */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1 !important;
    }

    .support-bar {
        /* On utilise aussi le rem pour la cohérence */
        height: 2rem !important; 
        margin-bottom: 0.5rem !important; 
    }
}
    #defaultCanvas0 {
        display: block !important;
        max-height: 100% !important; /* Prend toute la place du wrapper noir */
        max-width: 100% !important;
        width: auto !important;      /* Garde les proportions */
        height: auto !important;     /* Garde les proportions */
        object-fit: contain !important;
        margin: 0 auto !important;   /* Force le centrage horizontal */
    }


    /* 3. Ajustement des boutons du menu bas (DÉCORS, TEXTES, etc.) */
    .nav-tabs {
        position: fixed !important;
        bottom: 0 !important;
        height: 60px !important; /* Réduit de 70px à 60px */
        background: #0a0a1a !important;
        z-index: 9999;
        border-top: 1px solid var(--gold);
        display: flex !important;
    }

    .tab-btn {
        font-size: 0.6em !important; /* Texte plus petit pour que tout tienne */
        padding: 2px !important;
        border-right: none !important; /* On gagne de la place en virant les bordures */
    }

    .tab-btn span {
        font-size: 1.2em !important; /* Icônes (emojis) légèrement réduites */
        margin-bottom: 0px !important;
    }

    /* 4. Le "Pousseur" de contenu */
    .tab-content::after {
        content: "";
        display: block;
        height: 120px; 
        width: 100%;
    }

    /* 5. Bandeau Support (Élastique et Flottant au-dessus du tiroir) */


/* IMPORTANT : Ajoute ça juste en dessous pour que le bandeau ne soit pas coupé */
.studio-controls {
    overflow: visible !important; 
}

    .footer-left {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
    }

   .info-bubble {
        width: 14px !important;
        height: 14px !important;
        font-size: 10px !important;
        background-color: #d1ff00 !important; /* Le vert fluo */
        color: black !important; /* La lettre i en noir */
        border-radius: 50% !important; /* Le cercle */
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        font-family: 'NotoSans', serif !important;
        font-weight: bold !important;
        line-height: 1 !important;
    }
}

    #p5-holder { width: 100%; height: 100%; }
    
    /* ICI : Le secret pour tes racines en haut du bandeau */
    #racines-container {
    display: flex;
    flex-wrap: nowrap; /* EMPÊCHE le retour à la ligne (le bloc) */
    overflow-x: auto;  /* PERMET le défilement horizontal */
    -webkit-overflow-scrolling: touch; /* Défilement fluide sur mobile */
    gap: 10px;
    padding: 10px 5px;
    background: #000;
    border-bottom: 1px solid #333;
    scrollbar-width: none; /* Cache la barre sur Firefox */
}

#racines-container::-webkit-scrollbar {
    display: none; /* Cache la barre sur Chrome/Safari */
}

#racines-container .btn-opt {
    flex: 0 0 auto; /* Empêche les boutons de rétrécir */
    white-space: nowrap; /* Garde le texte sur une ligne */
}

    
    .e-3d { width: 16px; height: 16px; vertical-align: middle; margin-right: 5px; object-fit: contain; }
    .nav-tabs .tab-btn img { width: 3dvh; height: 3dvh; display: block; margin: 0 auto 2px; }
    
    /* --- LA POIGNÉE (Indice visuel) --- */
#menu-handle {
    width: 100%;
    height: 4dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
    z-index: 10;
}
#menu-handle::after {
    content: "";
    width: 40px;
    height: 4px;
    background: var(--gold);
    border-radius: 2px;
    opacity: 0.5;
}

    
/* --- LOGIQUE MOBILE (Tiroir par-dessus) --- */
@media (max-width: 1023px) {
    #canvas-wrapper {
        height: 65dvh !important;
        flex: none !important;
    }

    .studio-controls {
        position: fixed !important;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 35dvh; /* Retirez le !important ici si possible */
        z-index: 9999;
        transition: height 0.4s cubic-bezier(0.17, 0.84, 0.44, 1);
    }

    .studio-controls.expanded {
        height: 75dvh !important;
    }
    

    /* --- LES SCROLLBARS VERTICAUX (Pour tous les onglets) --- */
    .tab-content {
        flex: 1 !important;
        overflow-y: auto !important; /* Force le scroll vertical partout */
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px; /* Sécurité pour le bas du menu */
    }

    /* --- LES SCROLLBARS HORIZONTAUX (Pour les racines et les styles) --- */
    #racines-container, #styles-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important; /* Force le scroll horizontal */
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding: 10px;
        flex-shrink: 0; /* Empêche le container de s'écraser */
    }

    /* Optionnel : Rendre la barre de scroll visible si elle est trop discrète */
    .tab-content::-webkit-scrollbar {
        width: 5px;
        display: block;
    }
    .tab-content::-webkit-scrollbar-thumb {
        background: var(--gold);
        border-radius: 10px;
    }
}

/* --- BOUTON DE FERMETURE ÉLASTIQUE (CALCUL MODERNE) --- */
.btn-close-elastic {
    position: absolute;
    /* Se place à 8.5% de la hauteur de l'écran par rapport au bas */
    /* Cela le fait flotter pile au-dessus du bandeau Aum sans gêner la musique */
    bottom: 8.5dvh; 
    right: 5vw;
    
    /* Taille adaptative en rem */
    width: 2.8rem;  
    height: 2.8rem;
    
    background: rgba(18, 18, 37, 0.95);
    color: var(--gold);
    border: 0.2rem solid var(--gold);
    border-radius: 50%;
    
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 1.2rem; 
    font-weight: bold;
    z-index: 99999; /* Priorité maximale pour être au-dessus du tiroir */
    box-shadow: 0 0.5dvh 1.5dvh rgba(0, 0, 0, 0.6);
    
    /* Transition élastique fluide */
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), background 0.2s;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    
    /* Animation d'entrée */
    animation: popElastic 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) both;
}

/* Effet tactile : se rétracte légèrement */
.btn-close-elastic:active {
    transform: scale(0.8);
    background: var(--gold);
    color: #121225;
}

@keyframes popElastic {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Ajustement spécifique pour les très petits écrans */
@media (max-width: 480px) {
    .btn-close-elastic {
        bottom: 9dvh; /* On le remonte un poil plus pour le bandeau mobile */
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* --- EFFET AU SURVOL DES BOUTONS DU STUDIO --- */
.btn-opt {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Éclaircit le fond et ajoute une lueur dorée très fine au survol */
.btn-opt:hover {
    filter: brightness(1.25) !important;
    border-color: rgba(252, 194, 1, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* Effet spécial de halo pour le bouton Lien Magique Or */
.btn-opt[style*="--gold"]:hover {
    filter: brightness(1.1) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 20px rgba(252, 194, 1, 0.6) !important;
}