/* Mon profil — la grille des créations du compte. Même langage visuel que la
   galerie de l'accueil, en plus sobre : pas de vedette, pas d'animation. */

:root {
    --fond: #0b111d;
    --panneau: #111a2b;
    --panneau-clair: #16233a;
    --bord: #24334d;
    --bord-vif: #3b82f6;
    --texte: #e2e8f0;
    --attenue: #8296b4;
    --vert: #2ee27a;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font: 400 16px/1.55 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
    color: var(--texte); background: var(--fond);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
/* Même décor que le reste de l'outil, posé sur un calque fixe. */
body::before {
    content: ''; position: fixed; inset: 0; z-index: -1;
    background:
        linear-gradient(180deg, rgba(6, 11, 19, .82) 0%, rgba(6, 11, 19, .9) 100%),
        url('fond-vitre.webp') center / cover no-repeat;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1 { margin: 0; font-family: 'Uncial Antiqua', 'Rajdhani', serif; font-weight: 400; font-size: 30px; }

.sp-page { max-width: 1280px; margin: 0 auto; padding: 30px 40px 60px; }
.sp-entete { margin-bottom: 22px; }
.sp-compte { margin: 6px 0 0; color: var(--attenue); font-size: 15px; }

/* ── Filtre par classe ──────────────────────────────────────────────────── */
.sp-filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.sp-filtre {
    padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px;
    border: 1px solid var(--bord); background: rgba(12, 20, 32, .62); color: var(--attenue);
    transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.sp-filtre:hover { border-color: var(--bord-vif); color: var(--texte); }
.sp-filtre.actif {
    border-color: var(--vert); color: #04240f; font-weight: 700;
    background: linear-gradient(180deg, #57f0a0 0%, var(--vert) 48%, #16a355 100%);
    text-shadow: none;
}

/* ── Grille ─────────────────────────────────────────────────────────────── */
.sp-grille { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1180px) { .sp-grille { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px)  { .sp-grille { grid-template-columns: repeat(2, 1fr); } }

/* Les cartes elles-memes vivent dans cartes.css, partage avec la galerie. */
.sp-sans-image { color: var(--attenue); font-size: 13px; }

/* ── Rien à montrer ─────────────────────────────────────────────────────── */
.sp-vide {
    grid-column: 1 / -1; padding: 56px 20px; text-align: center;
    color: var(--attenue); font-size: 16px;
}
.sp-bouton {
    display: inline-block; margin-top: 16px; padding: 11px 22px; border-radius: 12px;
    font-weight: 700; color: #04240f;
    background: linear-gradient(180deg, #57f0a0 0%, var(--vert) 48%, #16a355 100%);
    text-shadow: none;
}

/* Suppression d'une création : discrète au repos, franchement rouge au
   survol. Elle est posée dans la vignette, sous les pièces portées. */
.sp-supprimer {
    position: absolute; bottom: 10px; right: 10px; z-index: 3;
    display: grid; place-items: center; width: 30px; height: 30px;
    border-radius: 50%; font-size: 15px; line-height: 1; cursor: pointer;
    /* Invisible tant qu'on ne survole pas la carte : le geste est definitif,
       il n'a pas a etre sous le pouce en permanence. */
    color: #e6eef8; opacity: 0; pointer-events: none;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(6, 12, 20, .72);
    transition: opacity 140ms ease, background 140ms ease, border-color 140ms ease;
}
.sf-carte:hover .sp-supprimer, .sp-supprimer:focus-visible { opacity: 1; pointer-events: auto; }
.sp-supprimer:hover {
    color: #ffffff; border-color: rgba(255, 110, 110, .9);
    background: rgba(190, 40, 40, .85);
}
.sf-carte.sp-en-cours { opacity: .45; pointer-events: none; }

/* ── Identite ───────────────────────────────────────────────────────────
   Le profil se visite aussi par ?u=<pseudo> : sans portrait ni chiffres,
   rien ne disait de qui l'on regardait les creations. */
.sp-entete { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.sp-identite { min-width: 0; }
.sp-portrait {
    flex: none; display: grid; place-items: center; overflow: hidden;
    width: 74px; height: 74px; border-radius: 50%;
    border: 2px solid var(--bord-vif);
    background: rgba(12, 20, 32, .72);
    box-shadow: 0 0 0 4px rgba(46, 226, 122, .12), 0 8px 22px rgba(0, 0, 0, .45);
}
.sp-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-initiale { font-size: 30px; font-weight: 700; color: var(--texte); }
.sp-profil-lien { cursor: pointer; transition: border-color 140ms ease, color 140ms ease, filter 140ms ease; }
.sp-portrait.sp-profil-lien:hover,
.sp-portrait.sp-profil-lien:focus-visible { border-color: #fff; filter: brightness(1.08); outline: none; }
#sp-titre.sp-profil-lien:hover,
#sp-titre.sp-profil-lien:focus-visible { color: var(--vert); outline: none; }

.sp-chiffres {
    display: flex; gap: 22px; margin: 8px 0 0; padding: 0; list-style: none;
}
.sp-chiffres li { display: flex; align-items: baseline; gap: 6px; }
.sp-chiffres strong { font-size: 21px; font-weight: 700; color: var(--vert); }
.sp-chiffres span { font-size: 14px; color: var(--attenue); }
.sp-chiffres[hidden] { display: none; }

/* ── Barre : les filtres a gauche, le tri a droite ──────────────────── */
.sp-barre {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 22px;
}
.sp-barre .sp-filtres { margin-bottom: 0; flex: 1 1 auto; }
.sp-tris { display: flex; gap: 8px; flex: none; }
.sp-tri {
    padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px;
    border: 1px solid var(--bord); background: rgba(12, 20, 32, .62); color: var(--attenue);
    transition: border-color 140ms ease, color 140ms ease;
}
.sp-tri:hover { border-color: var(--bord-vif); color: var(--texte); }
.sp-tri.actif { border-color: var(--vert); color: var(--texte); font-weight: 700; }

/* Le filtre porte desormais un visage : le cadre se resserre autour. */
.sp-filtre:has(img) { padding: 3px; width: 40px; height: 40px; border-radius: 11px; }
.sp-filtre img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Publie / prive ─────────────────────────────────────────────────────
   L'etat etait une mention morte ; c'est un bouton, et il se voit comme
   tel. Rouge eteint tant que le skin n'est pas partage. */
.sp-visibilite {
    align-self: flex-start; margin-top: 2px;
    padding: 3px 11px; border-radius: 999px; cursor: pointer;
    font-size: 13px; font-weight: 700;
    color: #ffc9c9; border: 1px solid rgba(255, 130, 130, .4);
    background: rgba(120, 30, 30, .28);
    transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}
.sp-visibilite:hover { border-color: rgba(255, 160, 160, .8); color: #ffffff; }
.sp-visibilite.publie {
    color: #bdf5d6; border-color: rgba(46, 226, 122, .45);
    background: rgba(20, 90, 55, .35);
}
.sp-visibilite.publie:hover { border-color: var(--vert); color: #ffffff; }
.sp-visibilite:disabled { opacity: .6; cursor: default; }

/* ── Vue libre / par dossier ────────────────────────────────────────── */
.sp-vues { display: flex; gap: 8px; flex: none; }
.sp-vue {
    padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 14px;
    border: 1px solid var(--bord); background: rgba(12, 20, 32, .62); color: var(--attenue);
    transition: border-color 140ms ease, color 140ms ease;
}
.sp-vue:hover { border-color: var(--bord-vif); color: var(--texte); }
.sp-vue.actif { border-color: var(--vert); color: var(--texte); font-weight: 700; }

/* ── Bandeau des dossiers ───────────────────────────────────────────────
   Chacun porte sa teinte : c'est elle qui les distingue d'un coup d'oeil,
   avant meme leur nom. */
.sp-dossiers { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.sp-dossiers[hidden] { display: none; }
.sd-dossier {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 8px 14px 8px 9px; border-radius: 13px; cursor: pointer;
    font-size: 15px; color: var(--texte);
    border: 1px solid rgba(var(--teinte-rvb, 46, 226, 122), .5);
    background: linear-gradient(180deg,
        rgba(var(--teinte-rvb, 46, 226, 122), .22),
        rgba(12, 20, 32, .72));
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
.sd-dossier:hover { border-color: var(--teinte, var(--vert)); }
.sd-dossier.actif {
    border-color: var(--teinte, var(--vert));
    box-shadow: 0 0 0 2px rgba(var(--teinte-rvb, 46, 226, 122), .35);
}
.sd-dossier img { width: 30px; height: 30px; object-fit: contain; display: block; }
.sd-pastille {
    width: 22px; height: 22px; border-radius: 7px; display: block;
    background: var(--teinte, var(--vert));
    border: 1px solid rgba(255, 255, 255, .25);
}
.sd-dossier em {
    font-style: normal; font-size: 13px; color: var(--attenue);
    padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .35);
}
.sd-creer { border-style: dashed; color: var(--attenue); background: none; }
.sd-creer i { font-style: normal; font-size: 19px; }

/* ── Fiche d'un dossier ─────────────────────────────────────────────── */
.sd-voile {
    position: fixed; inset: 0; z-index: 60;
    display: grid; place-items: center; padding: 20px;
    background: rgba(4, 8, 14, .72); backdrop-filter: blur(4px);
}
.sd-fiche {
    width: min(520px, 100%); max-height: 86vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 14px;
    padding: 22px; border-radius: 18px;
    border: 1px solid var(--bord); background: var(--panneau);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}
.sd-fiche h2 { margin: 0; font-family: 'Uncial Antiqua', serif; font-weight: 400; font-size: 22px; }
.sd-champ { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--attenue); }
.sd-champ input[type="text"], .sd-champ input[type="search"] {
    padding: 9px 12px; border-radius: 10px; font-size: 16px;
    border: 1px solid var(--bord); background: var(--panneau-clair); color: var(--texte);
}
.sd-champ input:focus { outline: 0; border-color: var(--bord-vif); }
.sd-champ input[type="color"] {
    width: 64px; height: 34px; padding: 2px; cursor: pointer;
    border: 1px solid var(--bord); border-radius: 9px; background: var(--panneau-clair);
}

/* Les trois themes sont exclusifs : une seule chose donne son identite au
   dossier, sans quoi on ne saurait plus ce qui le teinte. */
.sd-themes { display: flex; gap: 8px; }
.sd-themes button {
    flex: 1; padding: 9px; border-radius: 10px; cursor: pointer; font-size: 14px;
    border: 1px solid var(--bord); background: var(--panneau-clair); color: var(--attenue);
}
.sd-themes button.actif { border-color: var(--vert); color: var(--texte); font-weight: 700; }

.sd-resultats, .sd-classes {
    display: flex; flex-wrap: wrap; gap: 6px;
    max-height: 190px; overflow-y: auto;
}
.sd-piece, .sd-classe-choix {
    width: 46px; height: 46px; padding: 3px; cursor: pointer;
    border: 1px solid var(--bord); border-radius: 10px; background: var(--panneau-clair);
}
.sd-piece img, .sd-classe-choix img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sd-piece.actif, .sd-classe-choix.actif { border-color: var(--vert); box-shadow: 0 0 10px rgba(46, 226, 122, .4); }

.sd-actions { display: flex; align-items: center; gap: 10px; }
.sd-espace { flex: 1; }
.sd-actions button {
    padding: 9px 18px; border-radius: 10px; cursor: pointer; font-size: 15px;
    border: 1px solid var(--bord); background: var(--panneau-clair); color: var(--texte);
}
.sd-valider {
    color: #04240f; font-weight: 700; border-color: rgba(255, 255, 255, .35);
    background: linear-gradient(180deg, #57f0a0 0%, var(--vert) 48%, #16a355 100%);
    text-shadow: none;
}
.sd-supprimer { color: #ffb4b4; border-color: rgba(255, 130, 130, .4); }
.sd-supprimer:hover { color: #ffffff; background: rgba(190, 40, 40, .8); }

/* ── Ranger un skin ─────────────────────────────────────────────────── */
.sp-ranger {
    position: absolute; bottom: 10px; right: 46px; z-index: 3;
    display: grid; place-items: center; width: 30px; height: 30px;
    border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer;
    /* Meme discretion que la croix : visible au survol de la carte. */
    color: #e6eef8; opacity: 0; pointer-events: none;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(6, 12, 20, .72);
    transition: opacity 140ms ease, border-color 140ms ease;
}
.sf-carte:hover .sp-ranger, .sp-ranger:focus-visible { opacity: 1; pointer-events: auto; }
.sp-ranger:hover { border-color: var(--bord-vif); }

.sp-rangement {
    position: absolute; right: 10px; bottom: 46px; z-index: 6;
    display: flex; flex-direction: column; gap: 4px;
    min-width: 170px; max-height: 210px; overflow-y: auto; padding: 7px;
    border: 1px solid var(--bord); border-radius: 12px; background: var(--panneau);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}
.sp-rangement p { margin: 0; padding: 6px; font-size: 13px; color: var(--attenue); }
.sp-rangement-ligne {
    display: block; width: 100%; text-align: left; cursor: pointer;
    padding: 7px 10px; border-radius: 8px; font-size: 14px;
    border: 1px solid transparent; background: none; color: var(--attenue);
    border-left: 3px solid var(--teinte, var(--vert));
}
.sp-rangement-ligne:hover { background: var(--panneau-clair); color: var(--texte); }
.sp-rangement-ligne.dedans { color: var(--texte); font-weight: 700; background: rgba(46, 226, 122, .12); }
/* Creer un dossier depuis n'importe quelle vue. */
.sp-nouveau-dossier {
    flex: none; padding: 7px 15px; border-radius: 999px; cursor: pointer;
    font-size: 14px; font-weight: 700; color: #04240f;
    border: 1px solid rgba(255, 255, 255, .35);
    background: linear-gradient(180deg, #57f0a0 0%, var(--vert) 48%, #16a355 100%);
    text-shadow: none;
}
.sp-nouveau-dossier:hover { filter: brightness(1.07); }
/* Filtre par emplacement, dans le choix d'une pièce : le catalogue compte
   trois mille apparences, chercher sans restreindre ne mène nulle part. */
.sd-slots { display: flex; flex-wrap: wrap; gap: 5px; }
.sd-slot {
    padding: 5px 11px; border-radius: 999px; cursor: pointer; font-size: 13px;
    border: 1px solid var(--bord); background: var(--panneau-clair); color: var(--attenue);
}
.sd-slot:hover { border-color: var(--bord-vif); color: var(--texte); }
.sd-slot.actif { border-color: var(--vert); color: var(--texte); font-weight: 700; }
.sd-choisi { margin: 0; font-size: 13px; color: var(--vert); }
.sd-choisi[hidden] { display: none; }

/* Glisser une carte sur un dossier. La carte s efface un peu pendant le
   trajet, le dossier vise s allume. */
.sf-carte.sp-en-vol { opacity: .5; }
.sd-dossier.sd-cible {
    border-color: var(--teinte, var(--vert));
    box-shadow: 0 0 0 3px rgba(var(--teinte-rvb, 46, 226, 122), .5);
    transform: translateY(-2px);
}

/* Profil fermé : pas de grille ni de chiffres, un seul message centré. */
.sp-ferme {
    max-width: 520px; margin: 12vh auto 0; padding: 28px 30px 26px;
    text-align: center; border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(180deg, rgba(31, 107, 63, .22), rgba(6, 12, 20, .55));
}
.sp-ferme h1 { margin: 0 0 10px; font-size: 22px; line-height: 1.25; }
.sp-ferme p { margin: 0 0 20px; color: var(--attenue, #9fb3c8); line-height: 1.5; }
.sp-ferme-actions { display: flex; justify-content: center; align-items: center; gap: 14px; }
.sp-ferme-bouton {
    padding: 10px 22px; border-radius: 999px; cursor: pointer;
    font: inherit; font-weight: 600; color: #04120a;
    border: 1px solid rgba(255, 255, 255, .28);
    background: linear-gradient(180deg, #4ade80, #22a35a);
}
.sp-ferme-bouton:hover { filter: brightness(1.08); }
.sp-ferme-lien { color: var(--attenue, #9fb3c8); text-decoration: underline dotted; text-underline-offset: 3px; }
.sp-ferme-lien:hover { color: #fff; }
