/*
 * Maquette du launcher Necrozia (2026-10-05) : base de sa refonte.
 * Fenêtre de 960 × 600 px, sans dépendance (icônes en SVG dans le HTML, polices du site).
 * Trois écrans : .nzl-installation, .nzl-accueil (choix du pseudo), .nzl-jeu (Jouer, téléchargement,
 * lancement). L'écran affiché porte .is-actif ; ses animations démarrent quand la classe est posée.
 * .nzl-statique (sur .nzl-fenetre) fige chaque écran sur son état final.
 *
 * Cette feuille existe en deux exemplaires IDENTIQUES : maquettes/launcher/launcher.css (la source)
 * et theme/necrozia/assets/css/launcher.css (servie par le site). deployer.sh refuse s'ils diffèrent.
 */

/* --- Cadre : la fenêtre garde sa taille de 960 × 600 et se réduit à la place disponible ---------- */

.nzl-cadre {
    position: relative;
    width: 100%;
    aspect-ratio: 960 / 600;
    overflow: hidden;
    border-radius: calc(14px * var(--nzl-echelle-cadre, 1));
}
.nzl-fenetre {
    --nzl-fond: #0c0812;
    --nzl-fond-2: #130d1c;
    --nzl-surface: #1a1325;
    --nzl-surface-2: #231a31;
    --nzl-trait: rgba(233, 221, 196, 0.1);
    --nzl-trait-fort: rgba(233, 221, 196, 0.2);
    --nzl-violet: #9b5de5;
    --nzl-violet-clair: #c9a8ff;
    --nzl-os: #e9ddc4;
    --nzl-os-clair: #f6efe0;
    --nzl-texte: #d9d1e4;
    --nzl-texte-doux: #a69cb6;
    --nzl-texte-pale: #7c7290;
    --nzl-or-haut: #ffe27a;
    --nzl-or: #ffc53a;
    --nzl-or-bas: #f5a50f;
    --nzl-or-bord: #a8620a;
    --nzl-titre: "Cinzel", "Times New Roman", serif;
    --nzl-police: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    --nzl-courbe: cubic-bezier(0.22, 1, 0.36, 1);

    position: absolute;
    top: 0;
    left: 0;
    width: 960px;
    height: 600px;
    overflow: hidden;
    border: 1px solid rgba(201, 168, 255, 0.22);
    border-radius: 14px;
    background: var(--nzl-fond);
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.6);
    color: var(--nzl-texte);
    font-family: var(--nzl-police);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    text-align: left;
    transform: scale(var(--nzl-echelle, 1));
    transform-origin: 0 0;
    user-select: none;
}
.nzl-fenetre *,
.nzl-fenetre *::before,
.nzl-fenetre *::after {
    box-sizing: border-box;
}
.nzl-fenetre img {
    display: block;
    max-width: none;
}
.nzl-fenetre svg {
    display: block;
    flex-shrink: 0;
}

/* --- Barre de titre (fenêtre sans cadre du système) ----------------------------------------------- */

.nzl-barre-titre {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 0 0 14px;
    border-bottom: 1px solid var(--nzl-trait);
    background: rgba(8, 5, 13, 0.92);
}
.nzl-barre-titre img {
    width: 20px;
    height: 20px;
}
.nzl-barre-nom {
    font-family: var(--nzl-titre);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--nzl-os);
}
.nzl-barre-version {
    font-size: 11px;
    color: var(--nzl-texte-pale);
}
.nzl-controles {
    display: flex;
    height: 100%;
    margin-left: auto;
}
.nzl-controles span {
    display: grid;
    place-items: center;
    width: 46px;
    height: 100%;
    color: var(--nzl-texte-doux);
}
.nzl-controles span:last-child {
    border-top-right-radius: 13px;
}

/* --- Écrans --------------------------------------------------------------------------------------- */

.nzl-ecran {
    position: absolute;
    top: 38px;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s var(--nzl-courbe), visibility 0s 0.45s;
}
.nzl-ecran.is-actif {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s var(--nzl-courbe);
}

/* Boutons du launcher : or en relief (action principale), verre (secondaire) */
.nzl-bouton {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    padding: 0 26px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--nzl-or-haut), var(--nzl-or) 45%, var(--nzl-or-bas));
    color: #3a1d00;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 4px 0 var(--nzl-or-bord), 0 12px 26px -10px rgba(255, 176, 30, 0.6);
}
.nzl-bouton-verre {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.nzl-barre {
    position: relative;
    height: 10px;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(233, 221, 196, 0.08);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.nzl-barre-remplie {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--nzl-or-bas), var(--nzl-or) 60%, var(--nzl-or-haut));
    box-shadow: 0 0 14px rgba(255, 197, 58, 0.6);
}

/* Pourcentage animé : un nombre entier qui suit la barre (navigateurs récents ; sinon il reste fixe) */
@property --nzl-pourcent {
    syntax: "<integer>";
    inherits: false;
    initial-value: 0;
}
.nzl-pourcent::after {
    content: counter(nzl-p) " %";
    counter-reset: nzl-p var(--nzl-pourcent);
}

/* --- Écran 1 : installation ----------------------------------------------------------------------- */

.nzl-installation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background:
        radial-gradient(60% 55% at 50% 30%, rgba(155, 93, 229, 0.35), transparent 70%),
        linear-gradient(180deg, #150d22, var(--nzl-fond));
}
.nzl-installation-logo {
    width: 300px;
    margin-bottom: 4px;
    filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.6));
}
.nzl-installation-titre {
    font-family: var(--nzl-titre);
    font-size: 22px;
    font-weight: 700;
    color: var(--nzl-os-clair);
    letter-spacing: 0.04em;
}
.nzl-installation-boite {
    width: 460px;
    padding: 20px 22px;
    border: 1px solid var(--nzl-trait);
    border-radius: 14px;
    background: rgba(26, 19, 37, 0.85);
}
.nzl-installation-ligne {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--nzl-texte-doux);
}
.nzl-installation-ligne strong {
    color: var(--nzl-os);
    font-weight: 700;
}
.nzl-etapes-install {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}
.nzl-etapes-install li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--nzl-texte-pale);
}
.nzl-installation-fin {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(10px);
}
.nzl-installation-fin span {
    font-size: 13px;
    color: #8ee8b3;
}

.nzl-installation.is-actif .nzl-anim-install { animation: nzl-remplir 3.2s 0.3s cubic-bezier(0.45, 0, 0.25, 1) forwards; }
.nzl-installation.is-actif .nzl-pourcent { animation: nzl-compter 3.2s 0.3s cubic-bezier(0.45, 0, 0.25, 1) forwards; }
.nzl-installation.is-actif .nzl-etapes-install li { animation: nzl-faite 0.3s forwards; }
.nzl-installation.is-actif .nzl-etapes-install li:nth-child(1) { animation-delay: 1.1s; }
.nzl-installation.is-actif .nzl-etapes-install li:nth-child(2) { animation-delay: 2.3s; }
.nzl-installation.is-actif .nzl-etapes-install li:nth-child(3) { animation-delay: 3.4s; }
.nzl-installation.is-actif .nzl-installation-fin { animation: nzl-arriver 0.5s 3.6s var(--nzl-courbe) forwards; }

/* --- Barre latérale (écrans 2 et 3) --------------------------------------------------------------- */

.nzl-application {
    display: flex;
}
.nzl-laterale {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 76px;
    padding: 16px 0;
    border-right: 1px solid var(--nzl-trait);
    background: var(--nzl-fond-2);
}
.nzl-laterale-logo {
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    filter: drop-shadow(0 0 10px rgba(155, 93, 229, 0.6));
}
.nzl-laterale-lien {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: var(--nzl-texte-pale);
}
.nzl-laterale-lien.is-actif {
    background: rgba(155, 93, 229, 0.18);
    color: var(--nzl-os-clair);
}
.nzl-laterale-lien.is-actif::before {
    content: "";
    position: absolute;
    left: -15px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--nzl-or);
}
.nzl-laterale-bas {
    margin-top: auto;
}
.nzl-tete {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 0 0 2px rgba(201, 168, 255, 0.35);
    image-rendering: pixelated;
}
.nzl-tete span {
    background: #6b4a2d;
}
/* Une tête de joueur de 8 × 8 pixels, cheveux, peau, yeux */
.nzl-tete span:nth-child(-n + 16) { background: #3b2416; }
.nzl-tete span:nth-child(n + 17):nth-child(-n + 64) { background: #c99a6e; }
.nzl-tete span:nth-child(17), .nzl-tete span:nth-child(24) { background: #3b2416; }
.nzl-tete span:nth-child(34), .nzl-tete span:nth-child(39) { background: #ffffff; }
.nzl-tete span:nth-child(35), .nzl-tete span:nth-child(38) { background: #5a3fa0; }
.nzl-tete span:nth-child(44), .nzl-tete span:nth-child(45) { background: #a8754e; }
.nzl-tete span:nth-child(51), .nzl-tete span:nth-child(52), .nzl-tete span:nth-child(53), .nzl-tete span:nth-child(54) { background: #8a5a3a; }

.nzl-principal {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.nzl-banniere {
    position: relative;
    overflow: hidden;
}
.nzl-banniere-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.nzl-banniere::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(12, 8, 18, 0.15), rgba(12, 8, 18, 0.55) 60%, var(--nzl-fond)),
        rgba(40, 18, 70, 0.3);
}
.nzl-banniere-contenu {
    position: relative;
    z-index: 1;
}
.nzl-surtitre {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--nzl-violet-clair);
}

/* --- Écran 2 : accueil, choix du pseudo ----------------------------------------------------------- */

.nzl-accueil .nzl-banniere {
    height: 230px;
}
.nzl-accueil .nzl-banniere-contenu {
    padding: 70px 40px 0;
}
.nzl-accueil-titre {
    margin: 6px 0 4px;
    font-family: var(--nzl-titre);
    font-size: 30px;
    font-weight: 700;
    color: var(--nzl-os-clair);
}
.nzl-accueil-texte {
    color: var(--nzl-texte-doux);
}
.nzl-pseudo {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 22px;
    align-items: center;
    width: 600px;
    margin: -46px 0 0 40px;
    padding: 24px;
    border: 1px solid var(--nzl-trait-fort);
    border-radius: 16px;
    background: var(--nzl-surface);
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.9);
}
.nzl-pseudo .nzl-tete {
    width: 96px;
    height: 96px;
    border-radius: 14px;
}
.nzl-champ-titre {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--nzl-texte-pale);
}
.nzl-champ {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(155, 93, 229, 0.55);
    border-radius: 10px;
    background: rgba(8, 5, 13, 0.7);
    color: var(--nzl-os-clair);
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.15);
}
.nzl-curseur {
    width: 2px;
    height: 22px;
    margin-left: 2px;
    background: var(--nzl-violet-clair);
    animation: nzl-clignote 1s steps(1) infinite;
}
.nzl-champ-aide {
    margin-top: 8px;
    font-size: 12px;
    color: var(--nzl-texte-pale);
}
.nzl-pseudo-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    grid-column: 2;
}
.nzl-pseudo-actions .nzl-bouton {
    opacity: 0.45;
    filter: saturate(0.4);
}
.nzl-confirmation {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #8ee8b3;
    opacity: 0;
}
.nzl-accueil-pied {
    display: flex;
    gap: 16px;
    margin: 26px 40px 0;
}
.nzl-mini-carte {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--nzl-trait);
    border-radius: 12px;
    background: var(--nzl-fond-2);
}
.nzl-mini-carte strong {
    display: block;
    margin-bottom: 2px;
    font-family: var(--nzl-titre);
    color: var(--nzl-os);
}
.nzl-mini-carte span {
    font-size: 12px;
    color: var(--nzl-texte-pale);
}

.nzl-accueil.is-actif .nzl-pseudo-actions .nzl-bouton { animation: nzl-activer 0.4s 2.2s forwards, nzl-appui 0.35s 3.2s; }
.nzl-accueil.is-actif .nzl-confirmation { animation: nzl-entrer 0.4s 3.6s forwards; }

/* --- Écran 3 : Jouer, téléchargement du jeu, lancement ------------------------------------------- */

.nzl-jeu .nzl-banniere {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nzl-jeu .nzl-banniere-contenu {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.nzl-jeu-logo {
    width: 340px;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.7));
}
.nzl-jeu-serveur {
    margin-top: 6px;
    color: var(--nzl-texte-doux);
    font-size: 14px;
}
.nzl-jeu-bas {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 104px;
    padding: 0 28px;
    border-top: 1px solid var(--nzl-trait);
    background: var(--nzl-fond-2);
}
.nzl-joueur {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nzl-joueur strong {
    display: block;
    color: var(--nzl-os-clair);
    font-weight: 700;
}
.nzl-joueur span {
    font-size: 12px;
    color: var(--nzl-texte-pale);
}
.nzl-jeu-zone {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
}
.nzl-jouer {
    height: 58px;
    padding: 0 58px;
    font-size: 18px;
    letter-spacing: 0.18em;
}
.nzl-telechargement {
    position: absolute;
    left: 40px;
    right: 0;
    top: 50%;
    opacity: 0;
    transform: translateY(-50%);
    pointer-events: none;
}
.nzl-telechargement-ligne {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--nzl-texte-doux);
}
.nzl-telechargement-ligne strong {
    color: var(--nzl-os);
}
@property --nzl-mo {
    syntax: "<integer>";
    inherits: false;
    initial-value: 0;
}
.nzl-mo::after {
    content: counter(nzl-mo) " / 412 Mo";
    counter-reset: nzl-mo var(--nzl-mo);
}
.nzl-lancement {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    background: radial-gradient(50% 50% at 50% 45%, rgba(60, 28, 100, 0.9), rgba(8, 5, 13, 0.97));
    opacity: 0;
}
.nzl-lancement img {
    width: 120px;
    filter: drop-shadow(0 0 30px rgba(155, 93, 229, 0.9));
}
.nzl-lancement span {
    font-family: var(--nzl-titre);
    font-size: 18px;
    letter-spacing: 0.1em;
    color: var(--nzl-os-clair);
}

.nzl-jeu.is-actif .nzl-jouer { animation: nzl-appui 0.35s 0.6s, nzl-sortir 0.3s 1s forwards; }
.nzl-jeu.is-actif .nzl-telechargement { animation: nzl-entrer 0.3s 1.1s forwards; }
.nzl-jeu.is-actif .nzl-anim-jeu { animation: nzl-remplir 3.1s 1.2s cubic-bezier(0.45, 0, 0.25, 1) forwards; }
.nzl-jeu.is-actif .nzl-mo { animation: nzl-mo 3.1s 1.2s cubic-bezier(0.45, 0, 0.25, 1) forwards; }
.nzl-jeu.is-actif .nzl-lancement { animation: nzl-entrer 0.6s 4.5s forwards; }
.nzl-jeu.is-actif .nzl-lancement img { animation: nzl-pulsation 1.4s 4.5s ease-in-out infinite; }

/* --- États finaux (maquette figée, ou « moins d'animations » demandé par le système) -------------- */

.nzl-statique .nzl-ecran {
    position: relative;
    top: 0;
    height: 562px;
    opacity: 1;
    visibility: visible;
}
.nzl-statique .nzl-barre-remplie { width: 100%; }
.nzl-statique .nzl-pourcent { --nzl-pourcent: 100; }
.nzl-statique .nzl-mo { --nzl-mo: 412; }
.nzl-statique .nzl-etapes-install li { color: var(--nzl-os); }
.nzl-statique .nzl-installation-fin { opacity: 1; transform: none; }
.nzl-statique .nzl-confirmation { opacity: 1; }
.nzl-statique .nzl-telechargement { opacity: 1; }
.nzl-statique .nzl-pseudo-actions .nzl-bouton { opacity: 1; filter: none; }
.nzl-statique .nzl-jouer { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .nzl-fenetre *,
    .nzl-fenetre *::before,
    .nzl-fenetre *::after {
        animation: none !important;
        transition: none !important;
    }
    .nzl-barre-remplie { width: 100%; }
    .nzl-pourcent { --nzl-pourcent: 100; }
    .nzl-mo { --nzl-mo: 412; }
    .nzl-etapes-install li { color: var(--nzl-os); }
    .nzl-installation-fin { opacity: 1; transform: none; }
    .nzl-confirmation { opacity: 1; }
    .nzl-pseudo-actions .nzl-bouton { opacity: 1; filter: none; }
    .nzl-telechargement { opacity: 1; }
    .nzl-jouer { opacity: 0; }
}

/* --- Animations ----------------------------------------------------------------------------------- */

@keyframes nzl-remplir {
    from { width: 0; }
    to { width: 100%; }
}
@keyframes nzl-compter {
    from { --nzl-pourcent: 0; }
    to { --nzl-pourcent: 100; }
}
@keyframes nzl-mo {
    from { --nzl-mo: 0; }
    to { --nzl-mo: 412; }
}
@keyframes nzl-faite {
    to { color: var(--nzl-os); }
}
@keyframes nzl-arriver {
    to { opacity: 1; transform: none; }
}
@keyframes nzl-entrer {
    to { opacity: 1; }
}
@keyframes nzl-sortir {
    to { opacity: 0; }
}
@keyframes nzl-activer {
    to { opacity: 1; filter: none; }
}
@keyframes nzl-appui {
    50% { transform: translateY(4px); box-shadow: 0 0 0 var(--nzl-or-bord), 0 4px 10px -6px rgba(255, 176, 30, 0.5); }
}
@keyframes nzl-clignote {
    50% { opacity: 0; }
}
@keyframes nzl-pulsation {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}
