:root {
    --bg-dark: #0f0f1a;
    --primary: #50518b;
    --secondary: #282a6b;
    --creative: #50518b;
    --pro: #00a38d;
    --accent: #00d4ff;
    --text-light: #e0e0e0;
    --glass: rgba(255, 255, 255, 0.03);
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-glass: rgba(255, 255, 255, 0.05);
}

/* Montserrat - Local Self-Hosted
   Poids inclus : 200, 300, 400, 600
*/

@font-face {
    font-family: 'Montserrat';
    font-style: normal;
    font-weight: 200 600;
    /* Supporte la plage de poids demandée */
    font-display: swap;
    src: url('fonts/montserrat-v31-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    line-height: 1.6;
    text-rendering: optimizeSpeed;
    /* Aide le navigateur à rendre le texte plus vite */
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--accent);
}

a:hover {
    font-weight: 600;
}

b {
    font-weight: 600;
}

p {
    font-size: 0.9rem;
}

img {
    width: 100%;
    margin: auto;
}

.bg-pro {
    background-color: var(--pro);
}

.bg-creative {
    background-color: var(--creative);
}

.txt-pro {
    color: var(--pro);
}

.txt-creative {
    color: var(--creative);
}

.pill-creative {
    background: var(--creative);
    padding: 5px;
    padding-left: 20px;
    border-radius: 21px;
}

.pill-primary {
    background: var(--primary);
    padding: 5px;
    padding-left: 20px;
    border-radius: 21px;
}

.description {
    font-size: 1em;
}

.miroir {
    display: inline-block;
    transform: scaleX(-1);
}

/* Effet Blueprint en fond */
#canvas-container {
    contain: strict;
    /* Indique au navigateur que cet élément n'influence pas la taille du reste */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero */
.hero {
    padding: 6rem 2rem;
    background: var(--glass);
    backdrop-filter: blur(2px);
    text-align: center;
}

/* Conteneur stable */
.avatar-container {
    position: relative;
    display: inline-block;
    padding: 25px;
    transition: all 0.5s ease;

}

/* L'avatar qui "s'aplatit" en plan technique */
.avatar {
    max-width: 300px;
    /* Utilise une valeur fixe ou ratio */
    max-height: 300px;
    /* Important pour réserver l'espace */
    aspect-ratio: 1 / 1;
    /* Force le carré même avant le chargement de l'image */
    object-fit: cover;
    /* Empêche l'image d'être déformée dans le carré */
    border-radius: 50%;

    display: block;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 2;
}

.avatar-container:hover .avatar {
    /* Couleur Cyanotype R&D */
    filter: sepia(100%) hue-rotate(185deg) brightness(0.9) saturate(1.8) contrast(1.2);
    border-radius: 2px;
    transform: scale(0.96);
}

/* LA GRILLE (Fixe) */
.avatar-container::before {
    content: "";
    position: absolute;
    top: 25px;
    left: 25px;
    right: 25px;
    bottom: 25px;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 4;
    opacity: 0;
    border: 1px solid rgba(0, 212, 255, 0.3);
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* LA SCANLINE (Mobile) */
.scan-line {
    position: absolute;
    top: 25px;
    left: 25px;
    right: 25px;
    height: 4px;
    background: linear-gradient(to bottom,
            transparent,
            var(--accent),
            transparent);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
}

@keyframes scanning {
    0% {
        top: 25px;
    }

    100% {
        top: calc(100% - 29px);
    }
}

.avatar-container:hover .scan-line {
    opacity: 1;
    animation: scanning 2.5s linear infinite;
}

/* LES COTES TECHNIQUES (Textes) */
.avatar-container::after {
    /* Nomenclature Ingénieur R&D */
    content: "REF: TF-1985 | ISO 2768-mk | MAT: CARBON_HUMANOID | IP67";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 9px;
    font-weight: bold;
    color: var(--accent);
    opacity: 0;
    transition: all 0.4s ease;
    white-space: nowrap;
}

/* Affichage au survol */
.avatar-container:hover::before,
.avatar-container:hover::after {
    opacity: 1;
}

.avatar-container:hover::after {
    bottom: 8px;
}

.contact-link {
    text-decoration: none;
    /* Enlève le soulignement */
    color: inherit;
    /* Prend la couleur du texte environnant */
    transition: opacity 0.3s ease;
}

.contact-link:hover {
    opacity: 0.7;
    /* Petit effet de retour visuel au survol */
    text-decoration: none;
    /* S'assure que rien n'apparaît au survol */
}

.h-logo:hover,
.main-card-logo:hover {
    transform: rotate(0deg) scale(1.1);
    box-shadow: 0 0 30px var(--neon-blue);
}

.alias {
    color: var(--creative);
}

.intro-pitch {
    max-width: 800px;
    margin: 1.5rem auto;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Sections */
.section-title {
    font-size: 2rem;
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin: 4rem 0 2rem;
}

/* Grid Actuel */
.current-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.main-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    backdrop-filter: blur(2px);
}

.main-card-logo,
.project-logo {
    display: flex;
    max-width: 200px;
    margin: auto;
    min-height: 96px;
    justify-content: center;
    align-items: center;
}

.pro {
    border-top: 4px solid var(--pro);
}

.creative {
    border-top: 4px solid var(--creative);
}

.badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
}

.date {
    color: var(--accent);
    font-weight: 800;
}

/* History */

.history-item {
    display: flex;
    margin-bottom: 1rem;
    padding-left: 20px;
    padding-right: 20px;
    padding-top: 6px;
    padding-bottom: 6px;
    position: relative;
    /* Nécessaire pour positionner la bordure */
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;
    overflow: hidden;
    /* Pour que le dégradé ne dépasse pas des arrondis */
}

/* On crée la bordure sur un calque séparé */
.history-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-top-left-radius: 30px;
    border-bottom-left-radius: 30px;

    /* Définition des bordures */
    border: 1px solid transparent;
    border-left: 6px solid transparent;

    /* Le dégradé appliqué uniquement sur la bordure */
    background: linear-gradient(to right,
            color-mix(in srgb, var(--pro), transparent 50%),
            transparent) border-box;

    /* Le masque qui "vide" l'intérieur du ::before pour ne laisser que la bordure */
    -webkit-mask:
        linear-gradient(#fff 0 0) padding-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: destination-out;
    mask-composite: exclude;

    pointer-events: none;
    /* Pour pouvoir cliquer sur le texte dessous */
}

.history-creative::before {

    background: linear-gradient(to right,
            color-mix(in srgb, var(--creative), transparent 50%),
            transparent) border-box;

}

.h-date {
    min-width: 90px;
    font-weight: bold;
    color: var(--accent);
    margin-top: auto;
    margin-bottom: auto;
    padding-top: 10px;
    padding-bottom: 10px;
}

.h-logo {
    width: 150px;
    margin-top: auto;
    margin-bottom: auto;
    padding: 40px;
    min-width: 150px;

}

.h-content {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
}

.h-title,
.h-desc {
    margin-block-start: 0.5em;
    margin-block-end: 0;
}


.h-p {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
}

.invert {
    filter: invert(100%);
}

/* Project Cards */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.project-card {
    padding: 1.5rem;
    border-radius: 8px;
    transition: 0.3s;
    background: var(--glass);
    backdrop-filter: blur(2px);
    padding: 2.5rem;
    border-radius: 15px;
    transition: 0.3s;
}

.project-card:hover {
    background: rgba(255, 255, 255, 0.08);
}


.tags {
    font-size: 0.8rem;
}

/*animations projets */

/* Le conteneur doit rester fixe pour garder la zone de détection (le focus) */
.flip-container {
    perspective: 1000px;
    display: block;
    /* Pour qu'il colle à la taille de l'image */
}

.flip {
    display: block;
    transform-style: preserve-3d;
    /* On retire la transition ici pour ne pas interférer avec l'animation */
}

@keyframes completeRotation {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(180deg);
    }
}

.flip-container:hover .flip {
    /* L'animation se joue une fois, en 0.6s, et reste à la fin (forwards) */
    animation: completeRotation 0.6s ease-in-out forwards;
}


.vanish {
    /* État normal : transition rapide pour le retour */
    transition: opacity 0.2s ease, filter 0.2s ease;
    opacity: 1;
    filter: blur(0px);
}

.vanish:hover {
    /* État au survol : transition très lente (ex: 3 secondes) */
    transition: opacity 1.5s ease-in, filter 3s ease-in;
    opacity: 0;
    filter: blur(20px);
    /* Ajoute un effet de vaporisation */
}

/* Définition de la secousse */
@keyframes shake {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    10% {
        transform: translate(-5px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.vibrate:hover {
    /* L'animation tourne en boucle (infinite) très rapidement (0.1s) */
    animation: shake 0.1s infinite;

    /* Optionnel : garde l'image au-dessus des autres si elles se chevauchent */
    z-index: 10;
}


/* Le conteneur du logo devient le théâtre de l'animation */
.project-logo.stars {
    position: relative;
    display: block;
    /* Prend toute la largeur de la carte */
    overflow: visible;
    /* Coupe les étoiles qui sortent du cadre du logo */
    line-height: 0;
    z-index: 1;
}

.project-logo.stars img {
    width: 100%;
    /* L'image s'adapte au conteneur */
    height: auto;
    position: relative;
    z-index: 3;
    /* L'image passe devant les étoiles */
}

/* On attache les étoiles au bloc logo uniquement */
.project-logo.stars::before,
.project-logo.stars::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    background: #FFF;
    border-radius: 50%;
    opacity: 0;
    z-index: 2;
    /* Derrière l'image, mais dans le logo */
    pointer-events: none;
}

/* Les ombres (étoiles) */
.project-logo.stars::before {
    box-shadow:
        -80px -60px 0 0 #FFF, 100px 40px 0 0 #FFF, -50px 80px 0 0 #FFF,
        60px -70px 0 0 #FFF, -90px 30px 0 0 #FFF, 40px -40px 0 0 #FFF;
}

.project-logo.stars::after {
    box-shadow:
        -30px -90px 0 0 #FFF, 90px 70px 0 0 #FFF, -70px 20px 0 0 #FFF,
        50px -80px 0 0 #FFF, -100px 50px 0 0 #FFF, 80px -30px 0 0 #FFF;
}

/* L'animation (plus besoin de toucher au texte) */
@keyframes shootStars {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* Déclenchement INFINI au survol */
.project-card:hover .project-logo.stars::before {
    animation: shootStars 1.5s linear infinite;
}

.project-card:hover .project-logo.stars::after {
    /* Le délai permet d'alterner les deux groupes pour un flux continu */
    animation: shootStars 1.5s linear infinite;
    animation-delay: 0.75s;
}

/* On applique la logique de conteneur pour ne pas casser le layout */
.ua2dv {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

/* Le Halo Arc-en-ciel */
.ua2dv::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%) scale(0.9);
    border-radius: 50%;
    /* Pour un halo circulaire */

    /* Gradient arc-en-ciel circulaire */
    background: conic-gradient(red, orange, yellow, green, blue, indigo, violet, red);

    /* Flou pour l'aspect "Halo" */
    filter: blur(15px);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

/* Animation type Equalizer / Bounce */
@keyframes haloBounce {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        filter: blur(15px);
        box-shadow: 0 0 0px 0px rgba(255, 255, 255, 0.2);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
        /* L'expansion */
        filter: blur(25px);
        /* Ajoute une lueur supplémentaire */
        box-shadow: 0 0 30px 10px rgba(255, 255, 255, 0.4);
    }

    100% {
        transform: translate(-50%, -50%) scale(0.95);
        filter: blur(15px);
        box-shadow: 0 0 0px 0px rgba(255, 255, 255, 0.2);
    }
}

/* Activation au survol */
.ua2dv:hover::before {
    opacity: 0.8;
    /* 0.4s pour un rythme cardiaque/musical rapide */
    animation: haloBounce 0.5s ease-in-out infinite;
}

/* Optionnel : légère rotation pour que les couleurs bougent */
@keyframes rotateHalo {
    from {
        transform: translate(-50%, -50%) rotate(0deg) scale(1.1);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg) scale(1.1);
    }
}

/* Si vous voulez que les couleurs tournent EN PLUS du bounce */
.ua2dv:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 105%;
    height: 105%;
    background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    filter: blur(20px);
    z-index: -2;
    animation: rotateHalo 3s linear infinite;
    opacity: 0.5;
}

.myst {
    position: relative;
    overflow: hidden;
    display: block;
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1;
    height: 200px;

}

/* La couche d'eau qui crée les reflets/ondulations */
.myst::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    /* Un gradient radial multiple pour simuler les ronds dans l'eau */
    background: radial-gradient(circle at center,
            transparent 30%,
            rgba(255, 255, 255, 0.2) 35%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 50%,
            transparent 60%);
    background-size: 200% 200%;
    background-position: center;

    /* Le secret du look Myst : le flou et la saturation */
    backdrop-filter: blur(0px) contrast(100%);
    opacity: 0;
    z-index: 2;
    transition: all 0.6s ease;
    pointer-events: none;
}

@keyframes waterRipple {
    0% {
        transform: scale(1);
        background-size: 100% 100%;
        opacity: 0.8;
    }

    100% {
        transform: scale(1.5);
        background-size: 220% 220%;
        backdrop-filter: blur(10px) contrast(110%);
        opacity: 0.2;
    }
}

.myst:hover {
    transform: scale(1);
    /* Légère compression au toucher */
}

.myst:hover::before {
    opacity: 1;
    animation: waterRipple 2s infinite;
}

/* Ajout d'une distorsion sur l'image elle-même */
.myst:hover img {
    filter: hue-rotate(10deg) saturate(1.2);
    transition: filter 1s ease;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    background: var(--glass);
    backdrop-filter: blur(2px);
}

.footer-links a {
    display: inline-block;
    min-width: 44px;
    /* Standard Apple/Google pour le tactile */
    min-height: 44px;
    line-height: 44px;
    margin: 0 0.5rem;
}

/* Styles de base pour le bouton petit format */
.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* Dimensions réduites */
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;

    /* Esthétique */
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;

    /* Transition fluide pour les interactions */
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    user-select: none;


    margin-bottom: 1rem;
    margin-top: 1rem;
}

/* État au survol (Hover) */
.btn-sm:hover {
    /* Augmente la luminosité de 15% */
    filter: brightness(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* État au clic (Active) */
.btn-sm:active {
    /* Réduit légèrement la luminosité pour simuler l'appui */
    filter: brightness(0.9);
    transform: translateY(0);
}

.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* Garde l'icône à droite */
    padding: 15px;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    /* Donne l'aspect rond ou oblong */
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    max-width: 24px;
    /* Taille initiale du rond */
    white-space: nowrap;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.fab-icon {
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-text {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    margin-right: 0;
}

/* État au survol */
.fab-container:hover {
    max-width: 250px;
    /* S'adapte à la longueur du texte */
    padding-left: 25px;
    background: var(--primary);
    /* Change de couleur au hover pour le peps */
}

.fab-container:hover .fab-text {
    opacity: 1;
    transform: translateX(0);
    margin-right: 15px;
    /* Espace entre le texte et l'icône */
}

/* Optionnel : pulsation discrète pour attirer l'oeil au début */
@keyframes fab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(80, 81, 139, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(80, 81, 139, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(80, 81, 139, 0);
    }
}

.fab-container {
    animation: fab-pulse 2s infinite;
}

.fab-container:hover {
    animation: none;
}

@media (max-width: 768px) {
    .current-grid {
        grid-template-columns: 1fr;
    }

    .history-item {
        flex-direction: column;
    }

    .h-logo {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 10px;
        padding-top: 10px;
    }
}


/* --- SYSTÈME DE NOTIFICATIONS STEAM (ACHIEVEMENTS) --- */

#achievement-container {
    position: fixed;
    left: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    z-index: 10000;
    pointer-events: none;
}

.achievement-notif {
    width: 360px;
    /* Fond Glassmorphism */
    background: rgba(27, 40, 56, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border-left: 5px solid var(--accent);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    pointer-events: all;

    transform: translateX(-480px);
    opacity: 0;
    max-height: 100px;
    margin-bottom: 12px;
    transition:
        transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.4s ease,
        max-height 0.4s ease,
        margin-bottom 0.4s ease,
        padding 0.4s ease;
}

.achievement-notif.show {
    transform: translateX(0);
    opacity: 1;
}

/* Pochette avec effet de reflet (Glassmorphism) */
.achievement-cover {
    position: relative;
    min-width: 65px;
    max-width: 65px;
    height: 65px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

/* Le reflet brillant par-dessus la pochette */
.achievement-cover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.4) 0%,
            rgba(255, 255, 255, 0) 50%,
            rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.achievement-text {
    flex-grow: 1;
    min-width: 0;
}

.achievement-text h5 {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.ach-title {
    margin: 2px 0 0;
    color: var(--accent);
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ach-artist {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-style: italic;
}

.achievement-progress {
    position: absolute;
    top: 8px;
    right: 12px;
    font-family: monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
}

/* Sortie fluide */
.achievement-notif.out {
    transform: translateX(-480px);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* --- ADAPTATION MOBILE --- */
@media (max-width: 768px) {
    #achievement-container {
        top: 10px;
        bottom: auto;
        left: 10px;
        right: 10px;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .achievement-notif {
        width: 96%;
        max-width: 380px;
        margin-bottom: 0;
        transform: translateY(-150px);
    }

    .achievement-notif.show {
        transform: translateY(0);
    }

    .achievement-notif.out {
        transform: translateY(-150px);
    }
}

/* Container de la modal (Overlay) */
#speedrun-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Boîte de contenu */
#speedrun-modal .modal-content {
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 80%;
    margin: auto;

    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(0, 112, 243, 0.2);
    transform: translateY(0);
    animation: slideUp 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

#speedrun-modal h2 {
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 15px;
}

#speedrun-modal .final-time {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin: 20px 0;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#speedrun-modal .mode-suggestion {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Boutons d'action */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

#speedrun-modal button {
    padding: 14px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#download-cert {
    background: #fff;
    color: #000;
}

#download-cert:hover {
    background: #0070f3;
    color: #fff;
    transform: translateY(-2px);
}

#share-speedrun {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

#share-speedrun:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-modal {
    background: transparent;
    color: #666;
    font-size: 0.8rem;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Style du groupe de saisie dans la modal */
.name-input-group {
    margin: 20px 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#player-name {
    background: rgba(0, 212, 255, 0.05);
    border: 0px solid;
    padding: 12px 15px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    border-radius: 4px;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

#player-name:focus {
    background: rgba(0, 212, 255, 0.1);
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

#player-name::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Ajustement de la modale pour accueillir l'input */
.modal-content {
    max-width: 500px;
    border: 2px solid #00d4ff;
    background: #0f0f1a;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.final-time {
    font-size: 3rem;
    font-weight: bold;
    color: #00d4ff;
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Responsive ajustements */
@media (max-width: 600px) {
    #speedrun-modal .modal-content {
        padding: 30px 20px;
    }

    #speedrun-modal .final-time {
        font-size: 2.2rem;
    }
}

/* Animation du bouton une fois débloqué */
@keyframes pulse-blue {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 212, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0);
    }
}

.fab-container.chat-mode {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%) !important;
    border: none;
}

/* Style de l'overlay du Chatbot */
.chat-overlay {
    display: none;
    /* Changé dynamiquement en 'flex' par le JS */
    position: fixed;
    inset: 0;
    /* Équivalent top:0, left:0, right:0, bottom:0 */
    width: 100%;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* S'adapte dynamiquement à la présence du clavier */
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10001;

    /* Centrage */
    justify-content: center;
    align-items: center;

    /* Évite le scroll du body quand l'overlay est ouvert */
    overscroll-behavior: contain;
}

.chat-modal-content {
    width: 95%;
    max-width: 1000px;
    /* On laisse une petite marge pour ne pas coller aux bords */
    height: 90%;
    height: 85dvh;

    background: #1a1a2e;
    border-radius: 20px;
    position: relative;
    overflow: hidden;

    /* Animation fluide lors du redimensionnement (clavier) */
    transition: height 0.3s ease-out;

    /* Ombre portée pour détacher la modale */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Ajustement pour les petits écrans en mode paysage (clavier souvent envahissant) */
@media (max-height: 500px) {
    .chat-modal-content {
        height: 98dvh;
        width: 100%;
        border-radius: 0;
    }
}

.close-chat {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
}

#iframe-container {
    width: 100%;
    height: 100%;
}

#chat-loader {
    color: #00d4ff;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin-top: 40vh;
}

/* Barre de navigation collante */
#sticky-nav {
    position: fixed;
    top: 20px;
    /* Décalé du haut pour l'effet flottant */
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    /* Caché par défaut */
    z-index: 2000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

/* Affichage lors du scroll */
#sticky-nav.visible-nav {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.nav-oblong {
    background: rgba(0, 0, 0, 0.1);
    /* Sombre translucide */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(15px);
    padding: 12px 32px;
    border-radius: 50px;
    /* Forme oblongue */
    display: flex;
    gap: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.nav-oblong a {
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-oblong svg {
    width: 22px;
    height: 22px;
}

/* Hover : l'icône s'éclaire et remonte légèrement */
.nav-oblong a:hover {
    color: var(--accent);
    /* Ton bleu cyan */
    transform: translateY(-2px);
}

/* Adaptation Mobile */
@media (max-width: 480px) {
    #sticky-nav.visible-nav {
        display: none;
    }

}