/* Copie du loader IA unifié de la plateforme (assets/css/tl_ai_loader.css, fiche client intelligente)
   + variante intégrée à l'aperçu 3D du Studio et questions de l'IA pendant la génération. */
/* ══════════════════════════════════════════════════════════
   Loader IA unifié (.tl-ai-loader)
   Même visuel que le loader de transition entre pages
   (assets/css/tl_page_loader.css — dashboard <-> fiche client) :
   anneaux coniques, logo pulsant, point orbital, texte + barre.
   Utilisé par : client_detail.php, email_builder.php,
   landing_page_builder.php, campaign_workflows.php, dashboard.
   Masqué par défaut : affiché via style.display = 'flex'
   ou par TLAiLoader.show() (assets/js/tl_ai_loader.js).
   ══════════════════════════════════════════════════════════ */

.tl-ai-loader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 26px;
    background:
        radial-gradient(ellipse 60% 45% at 50% 38%, rgba(108, 124, 255, 0.14), transparent 70%),
        rgba(8, 9, 20, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Bloc central : anneau + logo */
.tl-ai-loader-box {
    position: relative;
    width: 108px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tl-ai-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Anneau conique rotatif */
.tl-ai-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, transparent 55%, #6C7CFF 80%, #c084fc 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    animation: tl-ai-spin 1s linear infinite;
}

/* Second anneau plus lent, en sens inverse, pour la profondeur */
.tl-ai-ring--alt {
    inset: -12px;
    background: conic-gradient(from 180deg, transparent 0%, transparent 72%, rgba(108, 124, 255, 0.45) 92%, transparent 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    animation: tl-ai-spin 2.4s linear infinite reverse;
}

/* Logo central : logo Timelapse blanc pulsant */
.tl-ai-logo {
    width: 62px;
    height: 62px;
    border-radius: 17px;
    background: rgba(8, 9, 20, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        0 0 0 0 rgba(108, 124, 255, 0.35),
        0 18px 40px -12px rgba(108, 124, 255, 0.55);
    animation: tl-ai-pulse 1.6s ease-in-out infinite;
}

.tl-ai-logo img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
}

/* Point orbital */
.tl-ai-orbit {
    position: absolute;
    inset: 0;
    animation: tl-ai-spin 1s linear infinite;
}
.tl-ai-orbit::after {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    border-radius: 50%;
    background: #c084fc;
    box-shadow: 0 0 14px 3px rgba(192, 132, 252, 0.75);
}

/* Titre (équivalent .tl-loader-text) */
.tl-ai-title {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: 0.3px;
    text-align: center;
    animation: tl-ai-fade-in 0.5s ease 0.1s both;
}

.tl-ai-title::after {
    content: '';
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: tl-ai-dots 1.2s steps(4, end) infinite;
}

/* Sous-texte rotatif (équivalent .tl-loader-sub, avec fondu entre messages) */
.tl-ai-joke {
    margin-top: -16px;
    max-width: 440px;
    min-height: 1.5em;
    padding: 0 24px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.72rem;
    font-weight: 500;
    color: #8b93ab;
    text-align: center;
    line-height: 1.5;
    animation: tl-ai-fade-in 0.5s ease 0.2s both;
    transition: opacity 0.45s ease;
}

/* Barre de progression indéterminée */
.tl-ai-bar {
    width: 210px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    animation: tl-ai-fade-in 0.5s ease 0.25s both;
}

.tl-ai-bar span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: inherit;
    background: linear-gradient(90deg, #6C7CFF, #c084fc);
    box-shadow: 0 0 12px rgba(108, 124, 255, 0.8);
    animation: tl-ai-slide 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

/* Animations (mêmes courbes que tl_page_loader.css) */
@keyframes tl-ai-spin {
    to { transform: rotate(360deg); }
}

@keyframes tl-ai-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

@keyframes tl-ai-pop {
    from { transform: scale(0.6); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes tl-ai-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tl-ai-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75%, 100% { content: '...'; }
}

@keyframes tl-ai-slide {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(360%); }
}

@media (prefers-reduced-motion: reduce) {
    .tl-ai-ring,
    .tl-ai-ring--alt,
    .tl-ai-orbit,
    .tl-ai-logo,
    .tl-ai-bar span {
        animation-duration: 4s;
    }
}

/* ── Variante Studio : dans le cadre de l'aperçu 3D (pas plein écran) ── */
.viewer__busy.tl-ai-loader--inline { position: absolute; inset: 0; z-index: 3; display: flex; gap: 18px; padding: 1.2rem; overflow-y: auto; background: radial-gradient(ellipse 60% 45% at 50% 30%, rgba(108, 124, 255, 0.14), transparent 70%), rgba(10, 13, 22, 0.95); }
.viewer__busy.tl-ai-loader--inline[hidden] { display: none; }
.tl-ai-loader--inline .tl-ai-loader-box { flex: none; width: 92px; height: 92px; }
.tl-ai-loader--inline .tl-ai-logo { width: 54px; height: 54px; }
.tl-ai-loader--inline .tl-ai-logo img { width: 38px; height: 38px; }
.tl-ai-loader--inline .tl-ai-joke { margin-top: -10px; }
.tl-ai-loader--inline small { color: #8b93ab; font-size: .72rem; max-width: 360px; text-align: center; font-weight: 500; }

/* ── Questions de l'IA pendant la génération ── */
.busy-questions { width: min(100%, 440px); display: grid; gap: .6rem; text-align: left; }
.busy-questions[hidden] { display: none; }
.busy-questions__head { font-size: .75rem; font-weight: 700; color: #c4b5fd; display: flex; gap: .45rem; align-items: center; }
.busy-q { padding: .7rem .8rem; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.busy-q p { margin: 0 0 .5rem; font-size: .82rem; font-weight: 600; color: #f1f5f9; }
.busy-q__opts { display: flex; flex-wrap: wrap; gap: .35rem; }
.busy-q__opts button { border: 1px solid rgba(255, 255, 255, .14); background: transparent; color: #cbd5e1; font: inherit; font-size: .74rem; padding: .32rem .6rem; border-radius: 999px; cursor: pointer; }
.busy-q__opts button:hover { border-color: #8b93ff; color: #fff; }
.busy-q__opts button.is-picked { background: rgba(108, 124, 255, .22); border-color: #6C7CFF; color: #fff; }
.busy-q input { margin-top: .4rem; width: 100%; background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .1); border-radius: 8px; color: #f1f5f9; font: inherit; font-size: .76rem; padding: .4rem .55rem; }
.busy-questions__note { font-size: .68rem; color: #8b93ab; margin: 0; }
.answers-ready { margin: 0 0 .8rem; padding: .7rem .85rem; border-radius: 12px; border: 1px solid #6C7CFF; background: rgba(108, 124, 255, .12); font-size: .82rem; }
.answers-ready strong { display: block; margin-bottom: .25rem; }
/* Centrage qui ne coupe pas le haut quand le contenu dépasse (questions) */
.viewer__busy.tl-ai-loader--inline { justify-content: flex-start; }
.viewer__busy.tl-ai-loader--inline > :first-child { margin-top: auto; }
.viewer__busy.tl-ai-loader--inline > :last-child { margin-bottom: auto; }
/* Mode compact quand l'IA pose des questions */
.tl-ai-loader--inline.has-questions { gap: 10px; padding-top: .9rem; }
.tl-ai-loader--inline.has-questions .tl-ai-loader-box { width: 60px; height: 60px; }
.tl-ai-loader--inline.has-questions .tl-ai-logo { width: 38px; height: 38px; border-radius: 11px; }
.tl-ai-loader--inline.has-questions .tl-ai-logo img { width: 26px; height: 26px; }
.tl-ai-loader--inline.has-questions .tl-ai-joke, .tl-ai-loader--inline.has-questions > small { display: none; }

/* ── Atelier peinture dans l'aperçu 3D ── */
.paint-bar { position: relative; margin: .6rem 0 0; display: grid; gap: .5rem; padding: .7rem .8rem; border-radius: 14px; background: rgba(12, 16, 21, .92); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(8px); color: #e2e8f0; font-size: .78rem; }
.paint-bar[hidden] { display: none; }
.paint-bar__row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.paint-bar__row[hidden] { display: none; }
.paint-swatches { display: flex; flex-wrap: wrap; gap: .35rem; }
.paint-swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); cursor: pointer; padding: 0; }
.paint-swatches button.is-active { border-color: #fff; box-shadow: 0 0 0 3px #6C7CFF; }
.paint-swatches .paint-add { background: transparent; color: #cbd5e1; font-size: .8rem; border-style: dashed; }
.paint-color { position: relative; display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; padding: .3rem .5rem; border: 1px solid rgba(255, 255, 255, .15); border-radius: 8px; }
.paint-color input { width: 26px; height: 22px; border: 0; padding: 0; background: none; cursor: pointer; }
.paint-tools { display: inline-flex; border: 1px solid rgba(255, 255, 255, .15); border-radius: 999px; padding: .15rem; }
.paint-tools button { border: 0; background: transparent; color: #cbd5e1; font: inherit; font-size: .75rem; padding: .35rem .7rem; border-radius: 999px; cursor: pointer; }
.paint-tools button.is-active { background: rgba(108, 124, 255, .25); color: #fff; }
.paint-size { display: inline-flex; align-items: center; gap: .4rem; }
.paint-size input { width: 110px; accent-color: #6C7CFF; }
.paint-bar__hint { margin: 0; color: #8b93ab; font-size: .68rem; }
.tool.is-on { color: #c4b5fd; border-color: #6C7CFF; }
@media (max-width: 680px) { .paint-bar { padding: .6rem; } .paint-bar__hint { display: none; } }

/* ── Fenêtre de connexion ── */
#authModal:not(.is-account) .modal__backdrop { background: rgba(5, 9, 17, .78); backdrop-filter: blur(8px); }
#authModal:not(.is-account) .modal__card { max-width: 440px; padding: 2rem 1.9rem 1.5rem; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .08); background: radial-gradient(ellipse 80% 45% at 50% 0%, rgba(45, 212, 191, .12), transparent 70%), #121820; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
#authModal:not(.is-account) .modal__close { background: rgba(255, 255, 255, .06); color: #9fb0c2; border: 1px solid rgba(255, 255, 255, .08); }
.auth__brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.1rem; }
.auth__brand img { width: 34px; height: 34px; object-fit: contain; }
.auth__brand span { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; color: #f1f5f9; display: flex; flex-direction: column; line-height: 1.05; }
.auth__brand small { font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #2dd4bf; }
.auth__title { margin: 0 0 .3rem; font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; color: #f8fafc; }
.auth__sub { margin: 0 0 1.2rem; color: #94a3b8; font-size: .86rem; line-height: 1.5; }
.auth__switch { display: grid; grid-template-columns: 1fr 1fr; padding: .25rem; margin-bottom: 1.1rem; border-radius: 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07); }
.auth__switch[hidden] { display: none; }
.auth__switch .tab { border: 0; border-radius: 9px; padding: .55rem .5rem; font: inherit; font-size: .84rem; font-weight: 700; background: transparent; color: #94a3b8; cursor: pointer; transition: .15s; }
.auth__switch .tab.is-active { background: #1e2a36; color: #f1f5f9; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 6px 16px rgba(0, 0, 0, .25); }
.auth .auth-google { margin: 0 0 .2rem; }
.auth .auth-google__btn { color-scheme: light; min-height: 44px; } /* évite le cadre blanc autour de l'iframe Google en thème sombre */
.auth .auth-google__btn iframe { color-scheme: light; }
.auth .auth-google__sep { margin: .5rem 0 .3rem; font-size: .74rem; color: #64748b; }
.auth__form { gap: .85rem; margin-top: .4rem; }
.auth .field > span:first-child { font-size: .78rem; font-weight: 700; color: #cbd5e1; }
.auth__label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth__input { position: relative; display: block; }
.auth__input > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: #64748b; font-size: .85rem; pointer-events: none; }
.auth__input .input { padding: .78rem .9rem .78rem 2.4rem; border-radius: 11px; background: #0c1117; border: 1px solid #263240; font-size: .92rem; }
.auth__input .input:focus { border-color: #2dd4bf; box-shadow: 0 0 0 3px rgba(45, 212, 191, .14); }
.auth__eye { position: absolute; right: .45rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #7c8a9c; width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer; }
.auth__eye:hover { color: #e2e8f0; background: rgba(255, 255, 255, .05); }
.auth__input:has(.auth__eye) .input { padding-right: 2.6rem; }
.auth__link { border: 0; background: none; padding: 0; font: inherit; font-size: .76rem; font-weight: 600; color: #2dd4bf; cursor: pointer; }
.auth__link:hover { text-decoration: underline; }
.auth__back { justify-self: center; margin-top: .1rem; }
.auth__submit { padding: .85rem 1rem; border-radius: 11px; font-weight: 800; display: inline-flex; justify-content: center; gap: .5rem; margin-top: .2rem; }
.auth__check { font-size: .74rem; line-height: 1.45; color: #94a3b8; align-items: flex-start; }
.auth__check input { margin-top: .15rem; }
.auth__perks { list-style: none; margin: 1.2rem 0 0; padding: 1rem 0 0; border-top: 1px solid rgba(255, 255, 255, .07); display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; font-size: .72rem; color: #94a3b8; }
.auth__perks i { color: #2dd4bf; margin-right: .25rem; }
.auth__legal { margin: .7rem 0 0; text-align: center; font-size: .66rem; color: #64748b; line-height: 1.45; }
.auth__legal a { color: inherit; text-decoration: underline; }
.auth .alert { border-radius: 10px; font-size: .82rem; }
@media (max-width: 480px) { #authModal:not(.is-account) .modal__card { padding: 1.5rem 1.2rem 1.2rem; } .auth__title { font-size: 1.25rem; } }

/* Bouton « Accéder au dashboard » (admins) dans l'espace compte */
.admin-cta { display: flex; align-items: center; gap: .8rem; margin: 0 0 16px; padding: .85rem 1rem; border-radius: 14px; text-decoration: none; color: #f1f5f9; background: linear-gradient(120deg, rgba(108, 124, 255, .22), rgba(45, 212, 191, .16)); border: 1px solid rgba(139, 147, 255, .45); transition: transform .15s, border-color .15s; }
.admin-cta[hidden] { display: none; }
.admin-cta:hover { transform: translateY(-1px); border-color: #a5b4fc; text-decoration: none; }
.admin-cta__icon { width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; background: rgba(12, 16, 21, .55); color: #c4b5fd; font-size: 1.05rem; }
.admin-cta__text { display: grid; gap: .1rem; flex: 1; min-width: 0; }
.admin-cta__text strong { font-size: .95rem; }
.admin-cta__text small { font-size: .74rem; color: #b8c2d6; }
.admin-cta__arrow { color: #c4b5fd; }

/* ── Jeu de blocs : version néon + classement ── */
.blocks-game--fx { --blocks-hue: 47; background: radial-gradient(ellipse at 30% 20%, hsl(var(--blocks-hue) 70% 30% / .28), transparent 55%), radial-gradient(ellipse at 80% 90%, rgba(45, 212, 191, .16), transparent 50%), rgba(9, 12, 17, .97); transition: background .8s; }
.blocks-game--fx .blocks-game__board canvas { border: 1px solid hsl(var(--blocks-hue) 80% 60% / .55); box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 0 34px hsl(var(--blocks-hue) 85% 55% / .35), 0 0 80px rgba(45, 212, 191, .12); image-rendering: auto; animation: blocksPulse 3s ease-in-out infinite; }
@keyframes blocksPulse { 50% { box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 0 48px hsl(var(--blocks-hue) 85% 60% / .5), 0 0 110px rgba(45, 212, 191, .18); } }
.blocks-game--fx .blocks-game__stat { background: linear-gradient(135deg, #141c27, #10161e); border-color: #2a3646; }
.blocks-game--fx .blocks-game__stat strong { font-variant-numeric: tabular-nums; background: linear-gradient(90deg, #5eead4, #a78bfa, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 900; }
.blocks-game--fx .blocks-game__msg { white-space: pre-line; background: rgba(9, 12, 17, .9); border: 1px solid rgba(45, 212, 191, .45); box-shadow: 0 0 30px rgba(45, 212, 191, .25); }
.blocks-game__rank { padding: .5rem .6rem; border: 1px solid #2a3646; border-radius: 10px; background: linear-gradient(160deg, rgba(250, 204, 21, .08), rgba(19, 25, 34, .9)); }
.blocks-game__rank-title { display: flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fde68a; margin-bottom: .35rem; }
.blocks-game__rank ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.blocks-game__rank li { display: grid; grid-template-columns: 1.2rem 1fr auto; align-items: center; gap: .35rem; font-size: .7rem; color: #cbd5e1; padding: .15rem .2rem; border-radius: 6px; }
.blocks-game__rank li b { display: grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; font-size: .6rem; background: #273241; color: #e2e8f0; }
.blocks-game__rank li:nth-child(1) b { background: #facc15; color: #1a1300; box-shadow: 0 0 10px rgba(250, 204, 21, .6); }
.blocks-game__rank li:nth-child(2) b { background: #cbd5e1; color: #0f172a; }
.blocks-game__rank li:nth-child(3) b { background: #fb923c; color: #1c0a00; }
.blocks-game__rank li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blocks-game__rank li em { font-style: normal; font-weight: 800; color: #5eead4; font-variant-numeric: tabular-nums; }
.blocks-game__rank li.is-me { background: rgba(45, 212, 191, .14); }
.blocks-game__rank li.is-empty { display: block; color: #7f8b9b; }
.blocks-game__rank-me { margin: .35rem 0 0; font-size: .65rem; color: #93a5b6; }
.blocks-game__rank-me:empty { display: none; }
.nav__home i { margin-right: .25rem; }
@media (max-width: 720px) {
  .blocks-game__rank { padding: .35rem .4rem; }
  .blocks-game__rank li:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .blocks-game--fx .blocks-game__board canvas { animation: none; } }
/* Panneau latéral compact : compteurs sur deux colonnes */
.blocks-game--fx .blocks-game__side { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; align-content: start; }
.blocks-game--fx .blocks-game__side > * { grid-column: 1 / -1; }
.blocks-game--fx .blocks-game__side > .blocks-game__stat:not(:first-child) { grid-column: auto; flex-direction: column; align-items: flex-start; gap: 0; padding: .28rem .45rem; font-size: .62rem; }
.blocks-game--fx .blocks-game__side > .blocks-game__stat:nth-child(2) { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
.blocks-game--fx .blocks-game__side > .blocks-game__stat:first-child { padding: .3rem .5rem; }
.blocks-game--fx .blocks-game__stat strong { font-size: .9rem; }
.blocks-game--fx .blocks-game__help { font-size: .6rem; margin: 0; }
.blocks-game--fx .blocks-game__quit { margin-top: .2rem; }

/* Proportions calculées par le jeu (fit) + bouton son */
.blocks-game--fx { grid-template-columns: auto var(--blocks-side, 150px); }
.blocks-game--fx .blocks-game__board canvas { max-height: none; aspect-ratio: 1 / 2; }
.blocks-game--fx .blocks-game__side { max-height: var(--blocks-board-h, none); overflow-y: auto; scrollbar-width: none; }
.blocks-game--fx .blocks-game__side::-webkit-scrollbar { display: none; }
.blocks-game--compact .blocks-game__help, .blocks-game--compact .blocks-game__help-touch { display: none !important; }
.blocks-game--compact .blocks-game__rank li:nth-child(n+4) { display: none; }
.blocks-game--compact .blocks-game__rank-me { display: none; }
.blocks-game__mute { position: absolute; top: 8px; right: 8px; z-index: 3; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(94, 234, 212, .5); background: rgba(9, 12, 17, .75); color: #5eead4; font-size: .85rem; cursor: pointer; box-shadow: 0 0 14px rgba(45, 212, 191, .35); backdrop-filter: blur(4px); touch-action: manipulation; }
.blocks-game__mute:hover { background: rgba(45, 212, 191, .2); }
.blocks-game__mute.is-muted { color: #94a3b8; border-color: #475569; box-shadow: none; }

/* La règle du visualiseur 3D (.viewer canvas 100 % !important) ne doit pas déformer l'aperçu « Suivant ». */
.viewer .blocks-game__stat canvas { width: 48px !important; height: 48px !important; }
@media (max-width: 720px) { .viewer .blocks-game__stat canvas { width: 40px !important; height: 40px !important; } }

/* Téléphone en paysage : commandes à gauche, grille au centre, panneau à droite */
.blocks-game--fx.blocks-game--landscape { grid-template-columns: auto auto var(--blocks-side, 150px); grid-template-rows: auto; align-content: center; }
.blocks-game--landscape .blocks-game__pad { grid-column: 1; grid-row: 1; display: grid !important; grid-template-columns: repeat(2, 48px); align-content: center; gap: .45rem; }
.blocks-game--landscape .blocks-game__pad button { width: 48px; height: 44px; }
.blocks-game--landscape .blocks-game__board { grid-column: 2; grid-row: 1; }
.blocks-game--landscape .blocks-game__side { grid-column: 3; grid-row: 1; }

/* Photos : album ou appareil photo selon l'appareil */
.only-touch { display: none !important; }
@media (pointer: coarse) {
  .only-touch { display: inline !important; }
  .btn.only-touch { display: flex !important; }
  .only-desktop { display: none !important; }
}
.camera-btn { margin: .6rem 0 .2rem; justify-content: center; gap: .5rem; }
.dropzone.is-loading { opacity: .6; pointer-events: none; }

/* Mode figurine : badge Bêta + bulle d'information */
.beta-badge { display: inline-block; margin-left: .35rem; padding: .05rem .4rem; border-radius: 999px; font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; color: #1a1300; background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.info-tip { position: relative; display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-left: .25rem; border-radius: 50%; color: #94a3b8; cursor: help; vertical-align: middle; font-size: .85rem; outline: none; }
.info-tip:hover, .info-tip:focus-visible, .info-tip.is-open { color: #2dd4bf; }
.info-tip__bubble { position: absolute; z-index: 30; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); width: min(280px, 78vw); padding: .65rem .75rem; border-radius: 10px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; font-size: .78rem; font-weight: 500; line-height: 1.45; text-align: left; text-transform: none; letter-spacing: 0; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s; white-space: normal; }
.info-tip:hover .info-tip__bubble, .info-tip:focus .info-tip__bubble, .info-tip.is-open .info-tip__bubble { opacity: 1; visibility: visible; }
@media (max-width: 560px) { .info-tip__bubble { left: auto; right: -10px; transform: none; } [dir="rtl"] .info-tip__bubble { right: auto; left: -10px; } }

/* Paramètres en surimpression sur l'aperçu 3D (accordéon) */
.viewer .params-overlay { position: absolute; z-index: 3; top: 12px; left: 12px; width: min(300px, calc(100% - 72px)); max-height: calc(100% - 24px); display: flex; flex-direction: column; margin: 0; padding: 0; border: 1px solid rgba(94, 234, 212, .28); border-radius: 12px; background: rgba(12, 16, 21, .84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 14px 34px rgba(0, 0, 0, .45); color: #edf2f7; }
.params-overlay__toggle { display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; padding: .6rem .8rem; border: 0; background: transparent; color: inherit; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; text-align: left; }
.params-overlay__title i { color: #2dd4bf; margin-right: .35rem; }
.params-overlay__title small { margin-left: .35rem; font-size: .62rem; font-weight: 700; color: #0c1015; background: #2dd4bf; padding: .05rem .35rem; border-radius: 999px; vertical-align: middle; }
.params-overlay__chev { color: #94a3b8; transition: transform .2s; }
.params-overlay.is-collapsed .params-overlay__chev { transform: rotate(180deg); }
.params-overlay__body { overflow-y: auto; padding: .1rem .8rem .8rem; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.params-overlay.is-collapsed .params-overlay__body { display: none; }
.params-overlay .params-reset { margin: 0 0 .7rem; padding-bottom: .6rem; }
.params-overlay .params-reset__button { min-height: 34px; padding: .45rem .6rem; font-size: .72rem; }
.params-overlay .params-reset__status { margin-top: .35rem; }
.params-overlay .params { gap: .55rem; }
.viewer .viewer__busy { z-index: 6; }
.viewer .blocks-game { z-index: 7; }   /* le jeu reste au-dessus du panneau d'attente pendant la génération */
@media (max-width: 680px) {
  .viewer .params-overlay { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 58%; }
  .params-overlay.is-collapsed { width: auto; }
}

/* Badge Bêta et bulle dans la case « Mode figurine » : pas étirés par .figurine-toggle span { display: grid } */
.figurine-toggle .beta-badge { display: inline-block; width: auto; }
.figurine-toggle .info-tip { display: inline-grid; }
.figurine-toggle .info-tip__bubble { display: block; }

/* Librairie : « Mes modèles » puis « Modèles paramétriques » */
.library-block + .library-block { margin-top: 2.2rem; padding-top: 1.8rem; border-top: 1px solid #29333f; }
.library-block__head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.library-block__head h2, .library-block--mine .history__head h3 { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
.library-block__head h2 i, .library-block--mine .history__head h3 i { color: #2dd4bf; }
.library-block__head .muted { font-size: .78rem; }
.library-block--mine .personal-intro { padding: 2rem 1.2rem; }
.library-block--mine .personal-intro h2 { font-size: 1.2rem; }
.library-block--mine .personal-search { margin: 0 0 1rem; }
.library-block--mine .personal-search { margin: 0 0 1rem; max-width: 100%; }

/* Avatar du compte (bouton d'en-tête, espace compte) */
.account-btn__avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px rgba(45, 212, 191, .6); }
.account__avatar--img { padding: 0; overflow: hidden; border: 0; background: none; }
.account__avatar--img img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; display: block; }
#accountPanel .account__settings { color: #99aabd; font-size: 9px; padding: 7px; gap: 6px; flex-shrink: 0; text-decoration: none; }
#accountPanel .account__settings:hover { color: var(--ink); background: #1e2a36; }
.blocks-game__rank-av { width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; }

/* Précision STL / 3MF sous les boutons de téléchargement */
.choice__hint { margin: .7rem 0 0; font-size: 12px; line-height: 1.45; color: #99aabd; }
.choice__hint i { color: var(--teal, #2dd4bf); margin-right: .3rem; }
.choice__hint b { color: var(--ink, #edf2f7); }

/* Ouverture directe dans un logiciel de tranchage (slicer) */
.choice__slicers { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 0; font-size: 12px; color: #99aabd; }
.slicer-link { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 1px solid #2a3744; border-radius: 8px; padding: .3rem .6rem .3rem .3rem; color: #cbd5e1; font: inherit; font-size: 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.slicer-link:hover { border-color: var(--teal, #2dd4bf); color: var(--ink, #edf2f7); }
.slicer-badge { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 6px; font-size: 10px; font-weight: 800; color: #0c1117; letter-spacing: -0.02em; }
.slicer-badge--prusa { background: #ff7a1a; }
.slicer-badge--bambu { background: #00b18a; }
.slicer-badge--orca { background: #33c2ef; }
.choice__hint--small { opacity: .8; }
/* Téléphone / tablette : pas de slicer installable ni d'app sachant ouvrir un 3MF distant
   (Bambu Handy ne lit que les modèles MakerWorld) → on masque les liens et on met le 3MF en avant. */
.choice__hint--mobile { display: none; }
@media (pointer: coarse) {
  .choice__hint--mobile { display: block; }
  #dl3mfBtn { border-color: var(--teal, #2dd4bf); color: var(--ink, #edf2f7); font-weight: 700; }
}

/* ── CTA « Jouer en attendant » : bouton arcade néon ── */
@property --bp-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
#gameOpenBtn.busy-play { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: .7rem; margin: 1.1rem auto 0; padding: .85rem .95rem .85rem 1.15rem; border: 0; border-radius: 14px; background: #0b0f1a; color: #eef2ff; font: inherit; font-size: .92rem; font-weight: 800; letter-spacing: .02em; cursor: pointer; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, .2), 0 0 22px rgba(45, 212, 191, .2), 0 0 44px rgba(167, 139, 250, .14);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.3), box-shadow .25s; animation: bpBreath 2.8s ease-in-out infinite; }
/* bordure dégradée qui tourne */
#gameOpenBtn.busy-play::before { content: ''; position: absolute; inset: 0; z-index: -1; padding: 1.5px; border-radius: inherit;
  background: conic-gradient(from var(--bp-a), #2dd4bf, #a78bfa, #f472b6, #22d3ee, #2dd4bf);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: bpSpin 3s linear infinite; }
/* reflet qui balaie le bouton */
#gameOpenBtn.busy-play::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 38%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .26), transparent); transform: skewX(-20deg); animation: bpShine 3.4s ease-in-out infinite; }
/* grille de lignes façon écran d'arcade */
.busy-play__grid { position: absolute; inset: 0; z-index: -2; border-radius: inherit;
  background: linear-gradient(rgba(45, 212, 191, .1) 1px, transparent 1px) 0 0 / 100% 7px,
              linear-gradient(90deg, rgba(167, 139, 250, .09) 1px, transparent 1px) 0 0 / 14px 100%,
              radial-gradient(ellipse at 50% 130%, rgba(45, 212, 191, .32), transparent 62%), #0b0f1a;
  animation: bpGrid 3.5s linear infinite; }
/* coins en équerre (viseur) */
.busy-play__corners { position: absolute; inset: 5px; pointer-events: none; opacity: .85; transition: inset .25s, opacity .25s;
  background: linear-gradient(#5eead4, #5eead4) top left / 10px 1.5px no-repeat, linear-gradient(#5eead4, #5eead4) top left / 1.5px 10px no-repeat,
              linear-gradient(#f472b6, #f472b6) bottom right / 10px 1.5px no-repeat, linear-gradient(#f472b6, #f472b6) bottom right / 1.5px 10px no-repeat; }
#gameOpenBtn.busy-play > i { font-size: 1.2rem; color: #5eead4; filter: drop-shadow(0 0 6px #2dd4bf); animation: bpIcon 2.8s ease-in-out infinite; }
.busy-play__label { background: linear-gradient(90deg, #fff, #ddd6fe 55%, #5eead4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.busy-play__go { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-left: .15rem; border-radius: 7px; background: linear-gradient(135deg, #2dd4bf, #a78bfa); color: #0b0f1a; font-size: .6rem; box-shadow: 0 0 12px rgba(167, 139, 250, .55); transition: transform .22s, box-shadow .22s; }
#gameOpenBtn.busy-play:hover { transform: translateY(-3px) scale(1.04); animation-play-state: paused;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, .45), 0 0 30px rgba(45, 212, 191, .45), 0 0 70px rgba(167, 139, 250, .35), 0 14px 30px rgba(0, 0, 0, .5); }
#gameOpenBtn.busy-play:hover::before { animation-duration: 1.1s; }
#gameOpenBtn.busy-play:hover .busy-play__grid { animation-duration: 1s; }
#gameOpenBtn.busy-play:hover .busy-play__corners { inset: 3px; opacity: 1; }
#gameOpenBtn.busy-play:hover .busy-play__go { transform: translateX(3px) scale(1.12); box-shadow: 0 0 20px rgba(244, 114, 182, .8); }
#gameOpenBtn.busy-play:active { transform: translateY(0) scale(.97); }
#gameOpenBtn.busy-play:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }
@keyframes bpSpin { to { --bp-a: 360deg; } }
@keyframes bpGrid { to { background-position: 0 7px, 14px 0, 0 0, 0 0; } }
@keyframes bpShine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
@keyframes bpBreath { 50% { box-shadow: 0 0 0 1px rgba(167, 139, 250, .35), 0 0 30px rgba(45, 212, 191, .32), 0 0 58px rgba(167, 139, 250, .24); } }
@keyframes bpIcon { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-14deg); } 84% { transform: rotate(12deg); } 92% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) {
  #gameOpenBtn.busy-play, #gameOpenBtn.busy-play::before, #gameOpenBtn.busy-play::after, .busy-play__grid, #gameOpenBtn.busy-play > i { animation: none; }
}

/* Jeu : son coupé par défaut, le bouton haut-parleur pulse pour inviter à l'activer */
.blocks-game__mute.is-muted { animation: bgMutePulse 1.8s ease-in-out infinite; }
@keyframes bgMutePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .55); } 60% { box-shadow: 0 0 0 7px rgba(45, 212, 191, 0); } }
@media (prefers-reduced-motion: reduce) { .blocks-game__mute.is-muted { animation: none; } }

/* ── Jauge d'attente : pourcentage + temps restant (panneau d'attente et jeu) ── */
.busy-progress { width: min(300px, 86%); margin: 2px auto 0; animation: tl-ai-fade-in .5s ease .25s both; }
.busy-progress[hidden] { display: none; }
.busy-progress:not([hidden]) + .tl-ai-bar { display: none; }
.busy-progress__track { position: relative; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.busy-progress__fill { position: relative; display: block; width: 0; height: 100%; border-radius: inherit; overflow: hidden;
  background: linear-gradient(90deg, #6C7CFF, #c084fc 60%, #2dd4bf); box-shadow: 0 0 14px rgba(140, 124, 255, .7); transition: width .5s linear; }
/* rayures qui défilent dans la partie remplie */
.busy-progress__fill::after { content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 8px, transparent 8px 16px); background-size: 22px 22px; animation: bpStripes .8s linear infinite; }
.busy-progress__meta { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; margin-top: 7px; font-size: 12px; color: #9aa8b9; }
.busy-progress__meta strong { color: #eef2ff; font-size: 13px; font-variant-numeric: tabular-nums; }
.busy-progress__meta span { text-align: right; }
.busy-progress.is-late .busy-progress__fill { background: linear-gradient(90deg, #6C7CFF, #c084fc 50%, #fbbf24); }
.busy-progress.is-done .busy-progress__fill { background: linear-gradient(90deg, #14b8a6, #2dd4bf); box-shadow: 0 0 16px rgba(45, 212, 191, .8); }
.busy-progress.is-done .busy-progress__meta span { color: #5eead4; font-weight: 700; }
@keyframes bpStripes { to { background-position: 22px 0; } }
/* version compacte dans la colonne du jeu */
.busy-progress--game { width: 100%; margin: 0 0 10px; padding: 9px 10px 8px; border-radius: 10px; border: 1px solid rgba(167, 139, 250, .35); background: rgba(108, 124, 255, .08); }
.busy-progress__label { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #c4b5fd; }
.busy-progress--game .busy-progress__track { height: 6px; }
.busy-progress--game .busy-progress__meta { flex-direction: column; align-items: flex-start; gap: 1px; font-size: 10.5px; line-height: 1.3; }
.busy-progress--game .busy-progress__meta span { text-align: left; }
@media (prefers-reduced-motion: reduce) { .busy-progress__fill::after { animation: none; } .busy-progress__fill { transition: none; } }

/* ── Questions de l'IA : arrivée bien visible, état « Répondu » explicite ── */
.busy-questions { padding: .2rem; border-radius: 14px; }
.busy-questions.is-new { animation: bqPulse 1.2s ease-in-out 3; }
.busy-questions.is-new .busy-questions__head i { animation: bqWiggle .6s ease-in-out 3; }
@keyframes bqPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 181, 253, 0); } 50% { box-shadow: 0 0 0 5px rgba(196, 181, 253, .35), 0 0 30px rgba(196, 181, 253, .35); } }
@keyframes bqWiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg) scale(1.15); } 75% { transform: rotate(12deg) scale(1.15); } }
.busy-questions__head { font-size: .8rem; }
.busy-questions__count { margin-left: auto; padding: .1rem .5rem; border-radius: 999px; background: rgba(196, 181, 253, .14); color: #ddd6fe; font-variant-numeric: tabular-nums; }
.busy-questions.is-done .busy-questions__head { color: #5eead4; }
.busy-questions.is-done .busy-questions__count { background: rgba(45, 212, 191, .16); color: #5eead4; }
.busy-q { transition: background .25s, border-color .25s; }
.busy-q__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.busy-q__top p { margin-bottom: .5rem; }
.busy-q__status { flex: none; display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .5rem; border-radius: 999px; font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; color: #fde68a; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .4); }
.busy-q.is-answered { background: rgba(45, 212, 191, .06); border-color: rgba(45, 212, 191, .4); }
.busy-q.is-answered p { color: #94a3b8; }
.busy-q.is-answered .busy-q__status { color: #5eead4; background: rgba(45, 212, 191, .14); border-color: rgba(45, 212, 191, .45); }
.busy-q__opts button.is-picked { background: #2dd4bf; border-color: #2dd4bf; color: #0c1015; font-weight: 800; }
.busy-q__opts button.is-picked::before { content: '\2713\00a0'; }
.busy-q.is-answered .busy-q__opts button:not(.is-picked) { opacity: .38; }
.busy-q.is-answered .busy-q__opts button:not(.is-picked):hover { opacity: 1; }
.busy-questions__nav { display: flex; justify-content: space-between; gap: .5rem; }
.busy-questions__nav[hidden] { display: none; }
.busy-questions__nav button { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04); color: #cbd5e1; font: inherit; font-size: .74rem; font-weight: 700; padding: .4rem .75rem; border-radius: 999px; cursor: pointer; }
.busy-questions__nav button:hover:not(:disabled) { border-color: #8b93ff; color: #fff; }
.busy-questions__nav button:disabled { opacity: .3; cursor: default; }
/* bandeau dans le jeu */
.blocks-game__board { position: relative; }
.blocks-game__ask { position: absolute; top: 10px; left: 50%; z-index: 6; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem .5rem; width: max-content; max-width: calc(100% - 16px); padding: .5rem .6rem; text-align: center; border-radius: 12px; border: 1px solid #a78bfa; background: #1e1b4b; color: #ede9fe; font-size: .76rem; font-weight: 700; white-space: normal; box-shadow: 0 12px 30px rgba(0, 0, 0, .5), 0 0 26px rgba(167, 139, 250, .45); animation: bqDrop .35s ease-out, bqPulse 1.2s ease-in-out .4s 3; }
.blocks-game__ask i { color: #c4b5fd; font-size: 1rem; }
.blocks-game__ask button { border: 0; border-radius: 8px; padding: .38rem .75rem; background: #a78bfa; color: #1e1b4b; font: inherit; font-weight: 800; cursor: pointer; }
.blocks-game__ask button:hover { background: #c4b5fd; }
@keyframes bqDrop { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .busy-questions.is-new, .busy-questions.is-new .busy-questions__head i, .blocks-game__ask { animation: none; } }

/* ── App Elapse (iOS / Android) ── */
.native-only { display: none !important; }
.is-native-app .native-only { display: inline-flex !important; }
.result__report { margin: .2rem 0 .6rem; color: #94a3b8; }
.native-signin { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; min-height: 46px; margin: 0 0 .55rem; border-radius: 999px; font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; }
.native-signin--apple { background: #fff; color: #000; border: 0; }
.native-signin--apple i { font-size: 1.2rem; }
.native-signin--google { background: #131314; color: #e3e3e3; border: 1px solid #8e918f; }
.elapse-consent { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(5, 8, 12, .78); backdrop-filter: blur(6px); }
.elapse-consent__card { width: min(440px, 100%); padding: 22px; border-radius: 18px; border: 1px solid #2b3542; background: #121921; color: #e2e8f0; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.elapse-consent__card h2 { display: flex; gap: .55rem; align-items: center; margin: 0 0 .8rem; font-size: 1.15rem; }
.elapse-consent__card h2 i { color: #2dd4bf; }
.elapse-consent__card p { margin: 0 0 .7rem; font-size: .9rem; line-height: 1.5; color: #b6c2d0; }
.elapse-consent__links a { color: #5eead4; }
.elapse-consent__actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
/* zones de sécurité (encoche, barre d'accueil) */
.is-native-app body { padding-bottom: env(safe-area-inset-bottom); }
.is-native-app .header, .is-native-app .studio-header { padding-top: env(safe-area-inset-top); }

/* Signature « by MAVIS-3D » sous « Faire imprimer » */
.by-mavis { display: flex; align-items: baseline; gap: .3rem; margin: .65rem 0 0; line-height: 1; user-select: none; }
.by-mavis__by { font-size: .72rem; font-weight: 600; color: #8a8f98; }
.by-mavis__name { font-size: .95rem; font-weight: 900; letter-spacing: .02em; color: #d4d7dc; }
.by-mavis__name b { color: #0a84ff; font-weight: 900; }

/* ── Boutons principaux : style néon arcade (comme « Jouer en attendant ») ── */
@property --cta-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.btn--primary {
  position: relative; isolation: isolate; overflow: hidden;
  border: 0 !important; color: #eef2ff !important; font-weight: 800; letter-spacing: .01em;
  background: linear-gradient(rgba(45, 212, 191, .09) 1px, transparent 1px) 0 0 / 100% 7px,
              linear-gradient(90deg, rgba(167, 139, 250, .08) 1px, transparent 1px) 0 0 / 14px 100%,
              radial-gradient(ellipse at 50% 130%, rgba(45, 212, 191, .34), transparent 62%), #0b0f1a !important;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, .2), 0 0 20px rgba(45, 212, 191, .2), 0 0 40px rgba(167, 139, 250, .12) !important;
  text-shadow: 0 0 10px rgba(94, 234, 212, .35);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.3), box-shadow .25s;
  animation: ctaBreath 2.8s ease-in-out infinite, ctaGrid 3.5s linear infinite;
}
.btn--primary::before {
  content: ''; position: absolute; inset: 0; z-index: -1; padding: 1.5px; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--cta-a), #2dd4bf, #a78bfa, #f472b6, #22d3ee, #2dd4bf);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: ctaSpin 3s linear infinite;
}
.btn--primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 38%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .22), transparent); transform: skewX(-20deg);
  animation: ctaShine 3.6s ease-in-out infinite;
}
.btn--primary i { color: #5eead4; filter: drop-shadow(0 0 5px rgba(45, 212, 191, .8)); }
.btn--primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02); color: #fff !important;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, .45), 0 0 28px rgba(45, 212, 191, .42), 0 0 60px rgba(167, 139, 250, .3), 0 12px 26px rgba(0, 0, 0, .45) !important;
}
.btn--primary:hover:not(:disabled)::before { animation-duration: 1.1s; }
.btn--primary:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn--primary:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }
.btn--primary:disabled { opacity: .55; animation: none; }
.btn--primary:disabled::before, .btn--primary:disabled::after { animation: none; }
@keyframes ctaSpin { to { --cta-a: 360deg; } }
@keyframes ctaGrid { to { background-position: 0 7px, 14px 0, 0 0, 0 0; } }
@keyframes ctaShine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
@keyframes ctaBreath { 50% { box-shadow: 0 0 0 1px rgba(167, 139, 250, .32), 0 0 26px rgba(45, 212, 191, .3), 0 0 52px rgba(167, 139, 250, .2); } }
@media (prefers-reduced-motion: reduce) { .btn--primary, .btn--primary::before, .btn--primary::after { animation: none; } }
/* « Jouer en attendant » : le halo et la bordure ne sont plus rognés par le bas du panneau d'attente.
   La marge basse reste `auto` (dernier enfant) pour que le bloc d'attente soit centré verticalement et non
   collé au bas de l'aperçu ; c'est le padding-bottom du panneau qui protège le halo. */
#gameOpenBtn.busy-play { margin-bottom: auto; flex-shrink: 0; max-width: calc(100% - 16px); }
.viewer__busy.tl-ai-loader--inline { padding-bottom: 1.4rem; }
@media (max-width: 680px) {
  #gameOpenBtn.busy-play { gap: .55rem; padding: .7rem .75rem .7rem .95rem; font-size: .86rem; }
  #gameOpenBtn.busy-play > i { font-size: 1.05rem; }
  .busy-play__go { width: 1.45rem; height: 1.45rem; }
  #gameOpenBtn.busy-play:hover { transform: none; }
}

/* ── Galerie publique : « Les dernières créations » ── */
.is-native-app .native-only[hidden] { display: none !important; }
.recent-strip { margin-top: 24px; }
.recent-strip > div:first-child { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; margin-bottom: 11px; }
.recent-strip strong { font-size: 13px; font-weight: 700; color: #edf2f7; }
.recent-strip strong i { color: #fbbf24; margin-right: .3rem; }
.recent-strip > div:first-child span { font-size: 11px; color: #7f8b9b; }
.recent-creations { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #334155 transparent; }
.recent-card { position: relative; flex: 0 0 158px; display: grid; gap: 4px; padding: 6px 6px 9px; border: 1px solid #263240; border-radius: 14px; background: #121921; color: #e2e8f0; font: inherit; text-align: left; cursor: pointer; scroll-snap-align: start; transition: transform .2s, border-color .2s; }
.recent-card:hover { transform: translateY(-3px); border-color: #3b8378; }
.recent-card__img { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 55%, #222e3a, #0f151c 72%); }
.recent-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-card__tag { position: absolute; top: 12px; left: 12px; padding: .15rem .45rem; border-radius: 999px; font-size: 9.5px; font-weight: 700; background: rgba(12, 16, 21, .78); color: #c3cdd8; }
.recent-card__tag i { color: #2dd4bf; margin-right: .2rem; }
.recent-card__title { font-size: 12px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-card__by { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: #8b9aac; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recent-card__by img { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.gallery-share { display: inline-flex; align-items: center; gap: .45rem; margin: .2rem 0 .6rem; font-size: .78rem; color: #9aa8b9; cursor: pointer; }
.gallery-share input { accent-color: #2dd4bf; width: 16px; height: 16px; }

/* ── Modifier un modèle (STL / 3MF importé) ── */
.edit-file { display: flex; align-items: center; gap: .7rem; padding: .9rem 1rem; text-align: left; }
.edit-file > i { font-size: 1.6rem; color: #2dd4bf; }
.edit-file strong { display: block; font-size: .9rem; color: #edf2f7; word-break: break-all; }
.edit-file small { display: block; margin-top: .15rem; font-size: .75rem; color: #9aa8b9; }
.edit-colors { margin: .9rem 0 .2rem; padding: .7rem .85rem; border: 1px solid #263240; border-radius: 12px; background: rgba(255, 255, 255, .02); }
.edit-colors summary { cursor: pointer; font-size: .86rem; font-weight: 700; color: #e2e8f0; }
.edit-colors summary i { color: #c084fc; margin-right: .3rem; }
.edit-colors[open] summary { margin-bottom: .5rem; }
.edit-swatches { display: grid; gap: .45rem; margin-bottom: .55rem; }
.edit-swatch { display: grid; grid-template-columns: 44px 1fr auto; gap: .45rem; align-items: center; }
.edit-swatch input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid #334155; border-radius: 8px; background: #0f151c; cursor: pointer; }
.dropzone--small { min-height: 0; margin-top: .6rem; padding: .7rem; }
.dropzone--small .dropzone__empty { font-size: .8rem; }
.dropzone--small .dropzone__preview { max-height: 140px; }

/* Easter egg du chargement : le T se clique, des pièces jaillissent, parfois +1 crédit */
.tl-ai-logo { cursor: pointer; pointer-events: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.tl-ai-logo img { pointer-events: none; -webkit-user-drag: none; }
.tl-ai-logo.is-tap { animation: easterTap .28s ease-out, tl-ai-pulse 1.6s ease-in-out .28s infinite; }
@keyframes easterTap { 0% { transform: scale(1); } 40% { transform: scale(.86); } 100% { transform: scale(1); } }
.easter-coin { position: fixed; z-index: 500; margin: -10px 0 0 -10px; pointer-events: none; animation: easterCoin .9s cubic-bezier(.2, .7, .35, 1) forwards; }
@keyframes easterCoin { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 90px)) rotate(var(--rot)); opacity: 0; } }
.easter-fly { position: fixed; z-index: 501; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; transition: transform .72s cubic-bezier(.5, -0.2, .4, 1.1); filter: drop-shadow(0 0 10px rgba(251, 191, 36, .8)); }
.easter-plus { position: fixed; z-index: 501; transform: translateX(-50%); padding: 2px 9px; border-radius: 999px; background: #fbbf24; color: #1a1205; font: 800 13px 'DM Sans', system-ui, sans-serif; pointer-events: none; animation: easterPlus 1.3s ease-out forwards; box-shadow: 0 0 16px rgba(251, 191, 36, .6); }
@keyframes easterPlus { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -18px) scale(1); } }
.is-easter { animation: easterGlow .9s ease-out; border-radius: 6px; }
@keyframes easterGlow { 0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, .9); color: #fbbf24; } 100% { box-shadow: 0 0 0 12px rgba(251, 191, 36, 0); } }
