.tops-index {
    display: grid;
    gap: 0.8rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.tops-tuile {
    position: relative;
}

.tops-tuile:hover {
    border-color: var(--encre-douce);
}

/* Couvre la tuile entière. Le crayon reste au-dessus, pour modifier sans ouvrir la page. */
.tops-tuile-lien {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.tops-tuile-lien:focus-visible {
    outline: 2px solid var(--accent, #9b7ed9);
    outline-offset: 2px;
}

.tops-index-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tops-index h2 {
    margin: 0;
    font-size: 1.15rem;
}

.tops-index-icones {
    display: flex;
    flex-shrink: 0;
    gap: 0.15rem;
    margin: 0;
}

.tops-icone {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.35rem;
    color: var(--encre-douce);
    line-height: 0;
}

.tops-icone:hover {
    color: var(--encre);
    background: var(--fond);
}

/* Jaquettes du classement, à la suite du titre. */
.tops-index-vignettes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.65rem 0 0.35rem;
    padding: 0;
    list-style: none;
}

.tops-index-vignettes img,
.tops-index-vignettes .tops-vignette-vide {
    display: block;
    width: 5.1rem;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 0.2rem;
    background: var(--fond);
}

.tops-types {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.tops-types legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.recherche-top {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    max-width: none;
}

.recherche-top label {
    flex: 1 1 16rem;
}

.tops-resultats,
.tops-liste {
    display: grid;
    gap: 0.55rem;
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
}

.tops-resultats li,
.tops-liste li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--ligne);
    border-radius: 0.45rem;
    background: var(--fond);
}

.tops-liste li.en-cours {
    opacity: 0.45;
}

.tops-poignee {
    cursor: grab;
    color: var(--encre-douce);
    letter-spacing: -0.15em;
    user-select: none;
}

.tops-rang {
    display: inline-grid;
    place-items: center;
    min-width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: var(--accent, #9b7ed9);
    color: #fff;
    font-weight: 700;
}

.tops-titre {
    flex: 1 1 8rem;
    font-weight: 600;
}

.tops-place {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.tops-place input {
    width: 4rem;
}

.tops-resultats img,
.tops-liste img {
    width: auto;
    height: 3.5rem;
    object-fit: cover;
    border-radius: 0.2rem;
}

/* Page publique : deux rangées de cinq jaquettes, sans titre à côté. */
.tops-public {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.85rem;
    max-width: 56rem;
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
}

.tops-public a {
    display: block;
    border-radius: 0.35rem;
}

.tops-public a:hover {
    outline: 2px solid var(--accent, #9b7ed9);
    outline-offset: 2px;
}

.tops-public img,
.tops-public .tops-vignette-vide {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 0.35rem;
    background: var(--fond);
}

.tops-vignette-vide {
    border: 1px solid var(--ligne);
}

.tops-partage,
.tops-invite {
    margin-top: 1.5rem;
}

.tops-supprimer {
    margin-top: 1.5rem;
}

@media (max-width: 640px) {
    .tops-liste li,
    .tops-resultats li {
        align-items: flex-start;
    }
}
