/* ============================================================
 * IFLISS GAMES — page Jeux (/jeux)
 * Même thème que l'accueil : ce fichier s'ajoute à accueil.css, qui fournit
 * les couleurs (--paper, --violet-*, --red…) et .acc-wrap, .acc-kicker, .acc-mark.
 * CSS simple, sans compilation. Icônes : Bootstrap Icons.
 * ============================================================ */

/* ── Bandeau ── */
.jx-hero {
    padding: 20px 0 0;
    background:
        linear-gradient(to bottom, transparent 65%, var(--paper)),
        radial-gradient(700px 360px at 85% 0%, var(--violet-100), transparent 70%),
        radial-gradient(560px 300px at 10% 100%, var(--red-50), transparent 70%),
        var(--paper);
}
.jx-hero h1 {
    position: relative;
    z-index: 0;
    margin: 0 0 10px;
    color: var(--ink);
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.jx-hero-sub { max-width: 560px; margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.7; text-wrap: balance; }

/* Titre, recherche et filtres à gauche ; photo à droite, posée sur le bas du bandeau */
.jx-hero-grille { display: grid; grid-template-columns: minmax(0, 1fr) 420px; align-items: end; gap: 32px; }
.jx-hero-texte { align-self: center; padding-bottom: 26px; }
.jx-hero-visuel { display: block; }
/* La photo est coupée à la taille : fondu en bas pour qu'elle se fonde dans la page */
.jx-hero-visuel img {
    display: block;
    width: 100%;
    height: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent);
    mask-image: linear-gradient(to bottom, #000 80%, transparent);
}

/* ── Recherche et filtres ── */
.jx-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 24px; }
.jx-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 460px);
    padding: 10px 12px 10px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow);
    transition: border-color 0.18s, box-shadow 0.18s;
}
.jx-search-wrap:focus-within { border-color: var(--violet-400); box-shadow: 0 0 0 4px rgb(167 139 250 / 0.25), var(--shadow); }
.jx-search-icon { color: var(--violet-600); font-size: 1rem; }
.jx-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 0.95rem;
}
.jx-search-input::placeholder { color: #9a93b0; }
.acc .jx-search-input:focus-visible { outline: none; }
.jx-search-clear {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--violet-50);
    color: var(--violet-800);
    font-size: 0.8rem;
    cursor: pointer;
}
.jx-search-clear:hover { background: var(--red-50); color: var(--red); }

.jx-filters { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.jx-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    /* Pas de transition sur les couleurs : le fond bleu du filtre actif change d'un coup,
       le texte doit passer au blanc en même temps (sinon texte sombre sur bleu un instant) */
    transition: transform 0.18s;
}
.jx-filter:hover { transform: translateY(-2px); border-color: var(--red); color: var(--red); }
.jx-filter.active, .jx-filter.active:hover { background: var(--strip-blue); border-color: var(--strip-blue-solid); color: #fff; }

/* ── Grille ── */
.jx-catalogue { padding: 0; }
/* Une section par catégorie : fond blanc cassé, puis taupe, en alternance */
.jx-cat-section { padding: 30px 0 40px; background: var(--paper); }
.jx-cat-section.jx-tone-taupe {
    --ink-soft: #5a4d43;
    background: linear-gradient(180deg, #e1d6c9, #d8cbbb);
    border-top: 1px solid #cdbfae;
    border-bottom: 1px solid #cdbfae;
}
.jx-tone-taupe .jx-section-sep::after { background: #cdbfae; }
.jx-tone-taupe .jx-sep-count { background: var(--card); }
.jx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

.jx-section-sep { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; }
.jx-section-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.jx-sep-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--violet-100);
    color: var(--violet-800);
    font-size: 1.15rem;
}
.jx-sep-alt .jx-sep-icon { background: var(--red-50); color: var(--red); }
.jx-section-sep h2 { margin: 0; color: var(--ink); font-size: 1.35rem; font-weight: 800; }
.jx-sep-count { padding: 4px 10px; border-radius: 999px; background: var(--violet-50); color: var(--violet-800); font-size: 0.75rem; font-weight: 800; white-space: nowrap; }

/* ── Carte de jeu ── */
.jx-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: var(--shadow-sm);
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s, border-color 0.25s;
}
.jx-card:hover { transform: translateY(-6px); border-color: var(--violet-200); box-shadow: var(--shadow); }

.jx-card-media { display: flex; align-items: center; justify-content: center; padding: 24px 16px 18px; background: linear-gradient(145deg, var(--violet-100), var(--violet-50)); }
.jx-tint-1 .jx-card-media { background: linear-gradient(145deg, var(--red-50), #fff7f8); }
.jx-tint-2 .jx-card-media { background: linear-gradient(145deg, var(--violet-50), var(--red-50)); }

.jx-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 118px;
    height: 118px;
    overflow: hidden;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--card);
    box-shadow: 0 14px 26px -16px rgb(74 47 148 / 0.7);
    color: var(--violet-800);
    font-size: 2.6rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.jx-icon-wrap img { width: 100%; height: 100%; object-fit: cover; }
.jx-card:hover .jx-icon-wrap { transform: scale(1.07) rotate(-5deg); }

.jx-card-body { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 8px; padding: 16px 18px 12px; text-align: center; }
.jx-card-name { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 800; line-height: 1.25; }
.jx-card-desc {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.82rem;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.jx-card-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 2px; }
.jx-badge { padding: 2px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; }
.jx-badge-xp { background: var(--red-50); color: var(--red); }
.jx-badge-level { background: var(--violet-50); color: var(--violet-800); }

.jx-card-footer { padding: 0 18px 18px; }
.jx-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    border-radius: 999px;
    background: var(--strip-blue);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    transition: background-color 0.18s;
}
.jx-card:hover .jx-play-btn { background: var(--strip-blue-hover); }

.jx-new {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--red);
    box-shadow: 0 6px 14px -8px rgb(215 38 61 / 0.8);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Jeu verrouillé ── */
.jx-card.jx-locked { cursor: default; }
.jx-card.jx-locked .jx-card-media,
.jx-card.jx-locked .jx-card-body { filter: grayscale(0.8); opacity: 0.65; }
.jx-card.jx-locked:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow-sm); }
.jx-card.jx-locked .jx-play-btn { background: var(--paper-2); color: var(--ink-soft); }
.jx-lock-overlay { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; padding-top: 58px; pointer-events: none; }
.jx-lock-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--ink);
    box-shadow: var(--shadow);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ── Aucun jeu / aucun résultat ── */
.jx-empty { grid-column: 1 / -1; padding: 64px 20px; text-align: center; }
.jx-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin-bottom: 14px;
    border-radius: 22px;
    background: var(--violet-100);
    color: var(--violet-800);
    font-size: 2rem;
}
.jx-empty h2 { margin: 0 0 6px; color: var(--ink); font-size: 1.4rem; font-weight: 800; }
.jx-empty p { margin: 0; color: var(--ink-soft); }

/* ── Guide de choix ── */
.jx-editorial-section { padding: 64px 0 72px; }
.jx-editorial { max-width: 1000px; }
.jx-editorial h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    color: var(--ink);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 900;
    line-height: 1.15;
}
.jx-editorial h2 .bi { color: var(--red); }
.jx-editorial > p { margin: 0 0 24px; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.8; }
.jx-edito-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.jx-edito-card { padding: 20px 22px; border: 1px solid var(--line); border-left: 4px solid var(--violet-400); border-radius: 16px; background: var(--paper); }
.jx-edito-card:nth-child(even) { border-left-color: var(--red); }
.jx-edito-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--ink); font-size: 1.05rem; font-weight: 800; }
.jx-edito-card h3 .bi { color: var(--violet-600); }
.jx-edito-card:nth-child(even) h3 .bi { color: var(--red); }
.jx-edito-card p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.8; }
.jx-editorial a {
    color: var(--violet-800);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgb(74 47 148 / 0.3);
    text-underline-offset: 3px;
}
.jx-editorial a:hover { color: var(--red); text-decoration-color: var(--red); }
.jx-edito-foot { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.85; }

/* ── Écrans étroits ── */
@media (max-width: 1100px) {
    .jx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Une colonne centrée : titre, accroche, photo, puis recherche et filtres */
@media (max-width: 1000px) {
    .jx-hero-grille { grid-template-columns: 1fr; gap: 0; text-align: center; }
    .jx-hero-texte { display: contents; }
    .jx-hero-sub { margin: 0 auto; }
    .jx-hero-visuel { order: 1; justify-self: center; width: 340px; margin-top: 10px; }
    .jx-tools { order: 2; align-items: center; margin-top: 4px; padding-bottom: 24px; }
    .jx-filters { justify-content: center; }
}
@media (max-width: 768px) {
    .jx-hero { padding: 14px 0 0; }
    .jx-hero-visuel { width: min(100%, 270px); }
    .jx-tools { padding-bottom: 18px; }
    .jx-filter { padding: 7px 13px; font-size: 0.78rem; }
    .jx-cat-section { padding: 24px 0 30px; }
    .jx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .jx-icon-wrap { width: 96px; height: 96px; }
    .jx-card-media { padding: 18px 12px 14px; }
    .jx-card-body { padding: 12px 12px 10px; }
    .jx-card-footer { padding: 0 12px 14px; }
    .jx-lock-overlay { padding-top: 44px; }
    .jx-edito-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
    .jx-icon-wrap { width: 84px; height: 84px; border-width: 3px; }
    .jx-card-name { font-size: 0.9rem; }
    .jx-card-desc { font-size: 0.76rem; }
    .jx-section-sep h2 { font-size: 1.15rem; }
    .jx-sep-icon { width: 36px; height: 36px; font-size: 1rem; }
    .jx-new { top: 8px; left: 8px; padding: 3px 8px; font-size: 0.6rem; }
    /* « Bientôt disponible » tient sur une ligne, dans la carte, jusqu'à 320 px */
    .jx-bientot .jx-lock-badge { gap: 5px; padding: 6px 9px; font-size: 0.64rem; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
    .jx-card, .jx-icon-wrap, .jx-filter { transition: none; }
}
