/* Chill Launcher — socle visuel public
   Univers Minecraft fait main : aucun asset Mojang, tout est CSS/SVG.
   Thème sombre unique, arêtes franches, ombres dures 4px. */

:root {
    /* Nuit */
    --nuit-0: #0b0f14;
    --nuit-1: #121a22;
    --nuit-2: #1a252f;
    --nuit-3: #24333f;
    --trait: #35485a;

    /* Terre / herbe / pierre / diamant */
    --terre: #8b5a2b;
    --terre-clair: #b57a41;
    --herbe: #5fb54b;
    --herbe-clair: #86d96f;
    --herbe-sombre: #3d7a2f;
    --pierre: #8d949c;
    --pierre-clair: #b8bfc7;
    --diamant: #4ee1e1;
    --diamant-sombre: #1f9b9b;
    --or: #f2b632;
    --redstone: #d9463f;

    --texte: #e8eef4;
    --texte-doux: #a9bbcb;
    --texte-faible: #8497a8;

    --ombre: 4px 4px 0 rgba(0, 0, 0, .55);
    --ombre-forte: 6px 6px 0 rgba(0, 0, 0, .6);

    --pixel: "Press Start 2P", "Courier New", ui-monospace, monospace;
    --sys: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--nuit-0);
    /* Ciel de nuit : un léger damier de blocs, généré */
    background-image:
        radial-gradient(circle at 20% 12%, rgba(78, 225, 225, .10), transparent 45%),
        radial-gradient(circle at 82% 8%, rgba(95, 181, 75, .10), transparent 40%),
        linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px);
    background-size: auto, auto, 32px 32px, 32px 32px;
    color: var(--texte);
    font-family: var(--sys);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--diamant); }
a:hover { color: var(--herbe-clair); }

/* ---- Accessibilité ---- */

:focus-visible {
    outline: 3px solid var(--or);
    outline-offset: 3px;
}

.saut-contenu {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--or);
    color: #1a1204;
    padding: .8rem 1.2rem;
    font-weight: 700;
    z-index: 999;
}
.saut-contenu:focus { left: 0; }

.visuellement-cache {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ---- Titres pixel (jamais de texte long) ---- */

.pixel {
    font-family: var(--pixel);
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1.55;
}

h1, h2, h3 { line-height: 1.3; }

/* ---- Blocs ---- */

.bloc {
    background: var(--nuit-1);
    border: 3px solid var(--trait);
    box-shadow: var(--ombre);
}

.conteneur {
    width: min(1140px, 100% - 2.5rem);
    margin-inline: auto;
}

.section { padding: 4.5rem 0; }
.section + .section { border-top: 3px solid rgba(53, 72, 90, .5); }

.section-titre {
    font-size: clamp(1rem, 2.6vw, 1.5rem);
    margin: 0 0 .8rem;
    color: var(--herbe-clair);
    text-shadow: 3px 3px 0 rgba(0, 0, 0, .6);
}

.section-intro {
    color: var(--texte-doux);
    max-width: 62ch;
    margin: 0 0 2.5rem;
}

/* ---- Barre de navigation ---- */

.entete {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 15, 20, .94);
    border-bottom: 3px solid var(--trait);
}

.entete__interieur {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 0;
    flex-wrap: wrap;
}

.marque {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
    color: var(--texte);
}

.marque__logo { width: 38px; height: 38px; flex: 0 0 auto; image-rendering: pixelated; }

.marque__nom {
    font-family: var(--pixel);
    font-size: .78rem;
    color: var(--herbe-clair);
}

.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.nav a {
    color: var(--texte-doux);
    text-decoration: none;
    padding: .5rem .8rem;
    border: 3px solid transparent;
    font-weight: 600;
    font-size: .95rem;
}
.nav a:hover { color: var(--texte); border-color: var(--trait); background: var(--nuit-2); }

/* ---- Boutons « Minecraft » : ombre dure, s'enfoncent au clic ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-family: var(--sys);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    padding: .9rem 1.4rem;
    border: 3px solid #0b0f14;
    border-radius: 0;
    cursor: pointer;
    background: var(--pierre);
    color: #10161c;
    box-shadow: var(--ombre);
    transition: transform .08s steps(2), box-shadow .08s steps(2), filter .12s linear;
}
.btn:hover { filter: brightness(1.12); color: #10161c; }
.btn:active, .btn.est-enfonce {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, .55);
}

.btn--herbe { background: var(--herbe); }
.btn--diamant { background: var(--diamant); }
.btn--terre { background: var(--terre-clair); color: #1c1207; }
.btn--or { background: var(--or); }
.btn--fantome {
    background: transparent;
    color: var(--texte);
    border-color: var(--trait);
}
.btn--fantome:hover { background: var(--nuit-2); color: var(--texte); }

.btn--large { width: 100%; font-size: 1.05rem; padding: 1rem 1.2rem; }

.btn[aria-disabled="true"], .btn:disabled {
    background: var(--nuit-3);
    color: var(--texte-faible);
    border-color: var(--trait);
    box-shadow: none;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

/* ---- Héros ---- */

.heros {
    position: relative;
    padding: 5rem 0 4rem;
    overflow: hidden;
}

.heros__grille {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 3rem;
    align-items: center;
}

.badge {
    display: inline-block;
    font-family: var(--pixel);
    font-size: .6rem;
    padding: .55rem .8rem;
    background: var(--herbe-sombre);
    color: #eafce4;
    border: 3px solid #0b0f14;
    box-shadow: var(--ombre);
    margin-bottom: 1.6rem;
}

.heros__titre {
    font-size: clamp(1.15rem, 4.2vw, 2.1rem);
    margin: 0 0 1.4rem;
    text-shadow: 4px 4px 0 rgba(0, 0, 0, .65);
}

.heros__sous-titre {
    font-size: clamp(1.02rem, 2vw, 1.2rem);
    color: var(--texte-doux);
    max-width: 56ch;
    margin: 0 0 2rem;
}

.heros__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}

.heros__note {
    color: var(--texte-faible);
    font-size: .95rem;
    margin: 0;
}

/* Décor : pile de blocs flottants, 100 % CSS */

.pile { display: grid; gap: 1rem; justify-items: center; }

.cube {
    width: 108px;
    height: 108px;
    position: relative;
    border: 4px solid #0b0f14;
    box-shadow: var(--ombre-forte);
    animation: flotte 6s ease-in-out infinite;
}
.cube::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 0, 0, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, .16) 1px, transparent 1px);
    background-size: 18px 18px;
}

.cube--herbe {
    background: linear-gradient(var(--herbe) 0 30%, var(--herbe-sombre) 30% 38%, var(--terre) 38% 100%);
    animation-delay: 0s;
}
.cube--pierre { background: var(--pierre); animation-delay: .8s; }
.cube--diamant { background: var(--diamant-sombre); animation-delay: 1.6s; }
.cube--diamant::before {
    content: "";
    position: absolute;
    inset: 26px;
    background: var(--diamant);
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .35);
}

@keyframes flotte {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ---- Cartes de téléchargement ---- */

.telechargements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.carte-dl {
    background: var(--nuit-1);
    border: 3px solid var(--trait);
    box-shadow: var(--ombre);
    padding: 1.6rem;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}
.carte-dl--vide { border-style: dashed; background: var(--nuit-0); }

.carte-dl__icone { width: 52px; height: 52px; image-rendering: pixelated; }

.carte-dl__titre {
    font-family: var(--pixel);
    font-size: .8rem;
    margin: 0;
    color: var(--texte);
}

.carte-dl__meta {
    margin: 0;
    color: var(--texte-doux);
    font-size: .92rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem .9rem;
}

.etiquette {
    display: inline-block;
    background: var(--nuit-3);
    border: 2px solid var(--trait);
    padding: .1rem .5rem;
    font-family: var(--mono);
    font-size: .82rem;
    color: var(--texte-doux);
}

.carte-dl__notes {
    margin: 0;
    color: var(--texte-faible);
    font-size: .9rem;
    white-space: pre-line;
}

.carte-dl__pied { margin-top: auto; }

.empreinte {
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--texte-faible);
    word-break: break-all;
    margin: .6rem 0 0;
}

.note-pied {
    margin-top: 2rem;
    color: var(--texte-faible);
    font-size: .92rem;
}

/* ---- Fonctionnalités (habille features_html) ---- */

.grille-fonctions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(275px, 1fr));
    gap: 1.4rem;
}

.grille-fonctions .feature-card {
    background: var(--nuit-1);
    border: 3px solid var(--trait);
    border-left: 8px solid var(--herbe);
    box-shadow: var(--ombre);
    padding: 1.4rem;
    transition: transform .1s steps(2), box-shadow .1s steps(2);
}
.grille-fonctions .feature-card:hover {
    transform: translate(4px, 4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, .55);
}
.grille-fonctions .feature-card:nth-child(3n+2) { border-left-color: var(--diamant); }
.grille-fonctions .feature-card:nth-child(3n+3) { border-left-color: var(--or); }

.grille-fonctions .feature-card h3 {
    margin: 0 0 .6rem;
    font-size: 1.06rem;
    color: var(--texte);
}
.grille-fonctions .feature-card p {
    margin: 0;
    color: var(--texte-doux);
    font-size: .96rem;
}

/* ---- Contenu riche libre (faq_html, footer_html) ---- */

.riche h2 { font-size: 1.15rem; color: var(--herbe-clair); margin: 2rem 0 .6rem; }
.riche h3 { font-size: 1.02rem; color: var(--texte); margin: 1.6rem 0 .4rem; }
.riche p, .riche li { color: var(--texte-doux); }
.riche ul, .riche ol { padding-left: 1.3rem; }
.riche li { margin-bottom: .4rem; }
.riche code {
    font-family: var(--mono);
    background: var(--nuit-2);
    border: 2px solid var(--trait);
    padding: .05rem .35rem;
    font-size: .88rem;
}
.riche details {
    background: var(--nuit-1);
    border: 3px solid var(--trait);
    box-shadow: var(--ombre);
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}
.riche summary { cursor: pointer; font-weight: 700; color: var(--texte); }

/* ---- Pied de page ---- */

.pied {
    border-top: 3px solid var(--trait);
    background: var(--nuit-1);
    padding: 2.5rem 0;
    margin-top: 2rem;
}
.pied__interieur {
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: flex-start;
}
.pied p { margin: 0 0 .4rem; color: var(--texte-faible); font-size: .92rem; }
.pied__liens { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ---- Toast « Succès débloqué ! » ---- */

.zone-toasts {
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: .8rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: .9rem;
    background: var(--nuit-2);
    border: 3px solid var(--or);
    box-shadow: var(--ombre-forte);
    padding: .9rem 1.1rem;
    max-width: 320px;
    animation: toast-entre .28s steps(4) both;
}
.toast.sort { animation: toast-sort .28s steps(4) both; }
.toast__icone { width: 34px; height: 34px; flex: 0 0 auto; image-rendering: pixelated; }
.toast__titre { font-family: var(--pixel); font-size: .58rem; color: var(--or); margin: 0 0 .35rem; }
.toast__texte { margin: 0; font-size: .88rem; color: var(--texte-doux); }

@keyframes toast-entre {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-sort {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(120%); opacity: 0; }
}

/* ---- Pages d'erreur ---- */

.erreur {
    min-height: 74vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 3rem 0;
}
.erreur__code {
    font-family: var(--pixel);
    font-size: clamp(2.2rem, 11vw, 4.4rem);
    margin: 1.5rem 0 1rem;
    color: var(--redstone);
    text-shadow: 6px 6px 0 rgba(0, 0, 0, .65);
}
.erreur__titre { font-size: clamp(1rem, 3vw, 1.4rem); margin: 0 0 1rem; }
.erreur__texte { color: var(--texte-doux); max-width: 52ch; margin: 0 auto 2rem; }
.creeper { width: min(180px, 45vw); height: auto; image-rendering: pixelated; }

/* ---- Responsive ---- */

@media (max-width: 900px) {
    .heros__grille { grid-template-columns: 1fr; gap: 2.5rem; }
    .pile { grid-auto-flow: column; }
    .cube { width: 78px; height: 78px; }
    .cube--diamant::before { inset: 18px; }
}

@media (max-width: 620px) {
    body { font-size: 16px; }
    .section { padding: 3rem 0; }
    .nav { width: 100%; margin-left: 0; }
    .heros__actions .btn { width: 100%; }
    .zone-toasts { left: 1rem; right: 1rem; }
    .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
