/* Styles communs (chargés après le CSS de chaque page) */

/* ===================== Jaquettes et cartes ===================== */

/* Jaquettes (jeux, animés, profils) */
.game-cover,
.anime-cover,
.profil-carte-image {
    border: 1px solid var(--line);
    border-radius: var(--rayon);
    transition: border-color .15s ease, transform .2s ease, box-shadow .2s ease;
}
.game-card:hover .game-cover,
.anime-card:hover .anime-cover,
.profil-carte:hover .profil-carte-image,
.game-card:focus-visible .game-cover,
.anime-card:focus-visible .anime-cover {
    border-color: var(--accent);
    transform: var(--jaquette-survol);
    box-shadow: var(--jaquette-ombre);
}

/* Cartes des calendriers */
.cal-poster,
.ca-poster {
    border-radius: var(--rayon-grand) !important;
    transition: border-color .15s ease, transform .2s ease, box-shadow .2s ease;
}
.cal-poster:hover,
.ca-poster:hover {
    transform: var(--jaquette-survol);
    box-shadow: var(--jaquette-ombre);
}

/* Étiquettes sur les jaquettes */
.profil-statut,
.profil-note {
    border-radius: var(--rayon-pilule);
    padding: .15rem .55rem;
}

/* ===================== Messages « rien ici » ===================== */
/* Bouton sous le texte */
.vide-action { display: table; margin-top: .75rem; }
/* Cadre en pointillés avec une icône */
.profil-vide,
.admin-vide,
.idees-vide,
.nouveautes-vide,
.planning-vide,
.forum-vide,
.ac-empty,
.anime-empty,
.pn-empty,
.ca-empty {
    position: relative;
    display: block;
    margin: 0;
    padding: 1rem 1.15rem 1rem 3rem;
    color: var(--muted);
    text-align: left;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--rayon);
}
.profil-vide::before,
.admin-vide::before,
.idees-vide::before,
.nouveautes-vide::before,
.planning-vide::before,
.forum-vide::before,
.ac-empty::before,
.anime-empty::before,
.pn-empty::before,
.ca-empty::before {
    position: absolute;
    top: 1.05rem;
    left: 1.1rem;
    width: 1.15rem;
    height: 1.15rem;
    background: var(--accent-text);
    opacity: .75;
    content: "";
    /* Icône « i » */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 7a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm0-4a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 12 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 7a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm0-4a1.25 1.25 0 1 1 0 2.5A1.25 1.25 0 0 1 12 7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.profil-vide a, .admin-vide a, .idees-vide a, .nouveautes-vide a, .planning-vide a, .forum-vide a { font-weight: 700; }
/* Message du forum sur deux lignes */
.forum-vide { display: flex; flex-direction: column; gap: .2rem; }

/* ===================== Chargement et erreur ===================== */
/* Même cadre, en grand */
:is(.jeux-state, .anime-state, .ac-state, .pn-state, .ca-state):not(:has(.squelette)):not(.ac-empty, .anime-empty, .pn-empty, .ca-empty) {
    padding: 2.5rem 1.25rem;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--rayon-grand);
}

/* ===================== Fenêtres de détail ===================== */
/* Même cadre pour toutes les fenêtres */
.anime-modal,
.achievement-modal {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.anime-dialog,
.achievement-dialog {
    border-radius: var(--rayon-grand);
    box-shadow: var(--ombre-grande);
    transform: translateY(12px) scale(.98);
    transition: transform .25s ease;
}
.anime-modal.is-open .anime-dialog,
.achievement-modal.is-open .achievement-dialog { transform: none; }
.anime-close,
.achievement-close {
    display: grid;
    place-items: center;
    border-radius: 50%;
    transition: background .15s ease, color .15s ease;
}
.anime-close:hover,
.achievement-close:hover { background: var(--voile-fort); }
.anime-modal-image,
.achievement-game-image { border-radius: var(--rayon); }

/* Succès : survol et coche verte */
.achievement-item { padding: .55rem .5rem; border-radius: var(--rayon); transition: background .15s ease; }
.achievement-item:hover { background: var(--voile); }
.achievement-icon { border-radius: var(--rayon); }
.achievement-item:not(.is-locked) .achievement-status { display: grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 .4rem; color: var(--succes-fonce); background: var(--succes); border-radius: var(--rayon-pilule); }

@media (prefers-reduced-motion: reduce) {
    .anime-dialog, .achievement-dialog { transform: none; transition: none; }
}

/* ---------- Recherche ---------- */
.recherche-liste { display: flex; flex-direction: column; gap: .15rem; margin: 0; padding: 0; list-style: none; }

.recherche-resultat { display: flex; align-items: center; gap: .75rem; padding: .45rem .5rem; color: var(--text); text-decoration: none; border: 1px solid transparent; border-radius: var(--rayon); }
.recherche-resultat:hover, .recherche-resultat.est-choisi { color: var(--texte-fort); background: var(--accent-soft); border-color: var(--accent); }
.recherche-vignette { display: grid; flex: none; place-items: center; width: 2.4rem; height: 2.4rem; object-fit: cover; color: var(--accent-text); font-weight: 900; background: var(--surface-2); border-radius: var(--rayon); }
.recherche-texte { display: flex; flex-direction: column; min-width: 0; }
.recherche-titre { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.recherche-detail { overflow: hidden; color: var(--muted); font-size: var(--taille-s); text-overflow: ellipsis; white-space: nowrap; }

/* Fenêtre de recherche rapide */
.fenetre-recherche .modal-dialog { max-width: 40rem; margin-top: 8vh; }
.fenetre-recherche .modal-content { overflow: hidden; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--ombre-grande); }
.fenetre-recherche-haut { display: flex; flex: none; align-items: center; gap: .7rem; padding: .85rem 1rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.fenetre-recherche-haut input { flex: 1; min-width: 0; padding: .25rem 0; color: var(--texte-fort); font-size: var(--taille-l); background: none; border: 0; outline: 0; }
.fenetre-recherche-haut input::placeholder { color: var(--texte-discret); }
.fenetre-recherche-haut input::-webkit-search-cancel-button { display: none; }
.fenetre-recherche-fermer { padding: .15rem .45rem; color: var(--muted); font-size: var(--taille-xs); font-weight: 700; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--rayon); }
.fenetre-recherche .modal-body { max-height: min(60vh, 32rem); padding: .5rem; }
.fenetre-recherche-aide { margin: 0; padding: 1.25rem .75rem; color: var(--muted); text-align: center; }
.fenetre-recherche-groupe + .fenetre-recherche-groupe { margin-top: .5rem; }
.fenetre-recherche-groupe-titre { margin: .35rem .5rem .25rem; color: var(--accent-text); font-size: var(--taille-xs); font-weight: 700; }
.fenetre-recherche-tout { display: block; margin: .5rem .5rem .25rem; font-size: var(--taille-m); font-weight: 700; }
.fenetre-recherche-pied { margin: 0; padding: .55rem 1rem; color: var(--texte-discret); font-size: var(--taille-xs); border-top: 1px solid var(--line); }
kbd { padding: .1rem .35rem; color: var(--text); font-size: .75em; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: none; }
@media (hover: none) { .fenetre-recherche-pied { display: none; } }

/* ---------- Sondages ---------- */
.sondage { max-width: 640px; margin-top: 2.5rem; padding: 1.25rem 1.4rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon-grand); scroll-margin-top: 5.5rem; }
.sondage-etiquette { margin: 0 0 .25rem; color: var(--accent-text); font-size: var(--taille-s); font-weight: 700; }
.sondage h2 { margin: 0 0 1rem; font-size: var(--titre-section); overflow-wrap: anywhere; }
.sondage-message { margin: 0 0 .9rem; color: var(--succes); font-weight: 700; }
.sondage-message.est-erreur { color: var(--danger-clair); }
.sondage-formulaire fieldset { display: grid; gap: .5rem; margin: 0 0 1rem; }
.sondage-choix { display: flex; align-items: center; gap: .65rem; padding: .6rem .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--rayon); cursor: pointer; transition: border-color .15s ease; }
.sondage-choix:hover, .sondage-choix:has(input:checked) { border-color: var(--accent); }
.sondage-choix input { flex: 0 0 auto; accent-color: var(--accent); }
.sondage-choix span { overflow-wrap: anywhere; }
.sondage-resultats { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.sondage-resultats li { display: grid; grid-template-columns: 1fr auto; gap: .3rem .75rem; align-items: baseline; }
.sondage-resultat-texte { min-width: 0; overflow-wrap: anywhere; }
.sondage-resultat-chiffre { color: var(--muted); font-size: var(--taille-m); font-variant-numeric: tabular-nums; }
.est-mon-choix .sondage-resultat-texte { color: var(--accent-text); font-weight: 700; }
.sondage-barre { grid-column: 1 / -1; width: 100%; height: 8px; overflow: hidden; background: var(--surface-2); border: 0; border-radius: var(--rayon-pilule); -webkit-appearance: none; appearance: none; }
.sondage-barre::-webkit-progress-bar { background: var(--surface-2); border-radius: var(--rayon-pilule); }
.sondage-barre::-webkit-progress-value { background: var(--accent); border-radius: var(--rayon-pilule); }
.sondage-barre::-moz-progress-bar { background: var(--accent); border-radius: var(--rayon-pilule); }
.sondage-pied { margin: 1rem 0 0; color: var(--muted); font-size: var(--taille-m); }

/* Fil d'activité des amis (page Amis et accueil) */
.activite-avatar .avatar-membre { flex: none; object-fit: cover; background: var(--surface-2); border-radius: 50%; }
.activite { display: grid; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.activite-ligne { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.activite-ligne:last-child { border-bottom: 0; }
.activite-avatar { flex: 0 0 auto; }
.activite-avatar .avatar-membre { width: 40px; height: 40px; }
.activite-texte { flex: 1; min-width: 0; margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.activite-texte a { color: var(--text); font-weight: 700; text-decoration: none; }
.activite-texte a:hover { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.activite-quand { display: block; color: var(--texte-discret); font-size: var(--taille-xs); }
.activite-image { flex: 0 0 auto; width: 36px; height: 52px; object-fit: cover; border-radius: var(--rayon-petit); }
.activite-image.est-jeu { width: 69px; height: 32px; }
.activite-quand.est-maintenant { color: var(--succes); font-weight: 700; }

/* Bouton « Être prévenu de mes lives » (accueil et Mes lives) */
.alerte-live[hidden], .alerte-live [hidden] { display: none; }
.alerte-live { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
.alerte-live-aide { flex: 1 1 16rem; margin: 0; color: var(--muted); font-size: var(--taille-m); }
.alerte-live-aide.est-erreur { color: var(--danger-clair); }
.home-alerte-live { margin-top: .75rem; padding: 0 1.5rem; }
.planning-alerte-live { margin-bottom: 1.5rem; }
@media (max-width: 600px) {
    .home-alerte-live { padding: 0 .75rem; }
}
