/* ==========================================================
   Norex Gaming — strict minimum visuel du modèle Norex Music
   Tokens + body gradient + panels rgba(18,18,18,0.9) 15px +
   title-banner header + hover
   accent-bar sur filtres (modèle playlist).
   Note : ce CSS est partagé entre accueil.html, les pages
   saga-<slug>.html (catalogue réduit) et les pages
   game-<slug>.html (mono-jeu avec modal de preview).
   - .title-banner.is-saga : page saga + page game (fond vert)
   - .btn-back (pilule ⇦) : assure le retour à l'accueil ou à la
     saga parente selon la page.
   - .is-game-page : hook de body pour tweaks spécifiques aux
     pages mono-jeu (toolbar cachée, etc.).
   ========================================================== */

:root {
    /* Accent neutre de l'accueil : ce sont les univers (sagas) qui
       apportent la couleur, via --card-accent et le fond "nébuleuse"
       multivers construit en JS à partir des covers. */
    --main-color: #d6d0c2;
    --banner-color: #3a3a3a;
    --bg-color-2: rgb(12, 12, 14);
    --panel-bg:  rgba(13, 13, 15, 0.92);
    --line:      rgba(255, 255, 255, 0.10);
    --text-1:    rgba(255, 255, 255, 0.96);
    --text-2:    rgba(255, 255, 255, 0.74);
    --radius:    15px;
    --card-accent: var(--main-color);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    /* Base très sombre neutre. L'accueil reçoit en plus la nébuleuse
       multivers (body.style.backgroundImage, posée par accueil.js) ;
       les pages thémées remplacent entièrement le fond via leur classe
       .theme--xxx. */
    background-color: #0a0a0c;
    background-image:
        radial-gradient(1100px 560px at 82% -8%, rgba(255, 255, 255, 0.05), transparent 62%),
        linear-gradient(160deg, #101014 0%, #0a0a0c 55%, #050506 100%);
    background-attachment: fixed;
    color: #fff;
    /* Police Norex Music appliquée — Bitcount Single domine l'identité
       de marque ; les paragraphes longs (.game-card__desc,
       .game-hero__desc, .game-card__footer, meta dd) gardent un
       override `sans-serif` pour la lisibilité multi-lignes. */
    font-family: system-ui, sans-serif;
    min-height: 100vh;
}

/* === Atmosphère "nuit de garde" : grain CRT + vignette ===
   Deux overlays fixes (pointer-events:none → ne bloquent ni clic ni
   lecture vidéo). Ils cassent l'uniformité du fond et donnent la
   texture sombre de l'univers FNAF sans ajouter de décor. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
    background-size: 140px 140px;
    opacity: 0.07;
    mix-blend-mode: overlay;
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

/* === Jeu de lumière : halo neutre très subtil qui dérive lentement
   sur le fond (gris → noir demandé pour la catégorie globale). === */
html::before {
    content: "";
    position: fixed;
    inset: -12%;
    z-index: 9997;
    pointer-events: none;
    background:
        radial-gradient(55% 45% at 30% 22%, rgba(255, 255, 255, 0.05), transparent 65%),
        radial-gradient(40% 34% at 72% 72%, rgba(255, 255, 255, 0.035), transparent 65%);
    animation: light-drift 26s ease-in-out infinite alternate;
}
@keyframes light-drift {
    from { transform: translate3d(-1.6%, -1%, 0); }
    to   { transform: translate3d(1.6%, 1.2%, 0); }
}
html.no-animations::before { animation: none; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }


/* === Header — modèle Norex Music : flex row (back pill | title-banner) === */
.custom-header {
    display: flex;
    width: 94vw;
    margin: 20px auto;
    height: 100px;
    gap: 4px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
}

/* Bouton back — pilule noire 160px, glyphe ⇦, hover vert + halo.
   Sur la page d'accueil il n'est PAS rendu : cf. saga-<slug>.html */
.btn-back {
    flex: 0 0 160px;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    font-size: 2.8rem;
    border: 5px solid rgba(0,0,0,0.8);
    border-radius: 25px;
    box-sizing: border-box;
    z-index: 2;
    transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, transform 0.3s ease;
}
.btn-back:hover,
.btn-back:focus-visible {
    background-color: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
    box-shadow: 0 0 30px var(--main-color), inset 0 0 18px rgba(255,255,255,0.12);
    transform: translateX(-2px);
    outline: none;
}

/* Sur les pages saga le banner est vert : on propage le thème au back-pill
   pour qu'il fasse partie du même bloc visuel. */
.custom-header:has(.title-banner.is-saga) .btn-back {
    background-color: var(--main-color);
    border-color: var(--main-color);
}
.custom-header:has(.title-banner.is-saga) .btn-back:hover,
.custom-header:has(.title-banner.is-saga) .btn-back:focus-visible {
    background-color: var(--bg-color-2);
    border-color: var(--bg-color-2);
    box-shadow: 0 0 30px var(--bg-color-2), inset 0 0 18px rgba(255,255,255,0.12);
}

.title-banner {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    border-radius: 25px;
    background-color: rgba(0,0,0,0.8);
    border: 5px solid rgba(0,0,0,0.8);
    box-sizing: border-box;
    text-align: left;
    padding-left: 150px;
}

/* Variante saga : fond vert, padding compact (pas de logo à gauche). */
.title-banner.is-saga {
    padding-left: 30px;
    background-color: var(--main-color);
    border-color: var(--main-color);
}
.title-banner.is-saga h1 {
    letter-spacing: 1px;
    text-shadow: 0 0 14px rgba(0, 0, 0, 0.45);
}

.clipart-left {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
    padding-left: 45px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 1;
}

.title-banner h1 {
    font-family: system-ui, sans-serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}


/* === Main === */
.main {
    width: 94vw;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 0 24px;
}



/* === Toolbar — panneau style modèle === */
.toolbar {
    background: var(--panel-bg);
    border-radius: var(--radius);
    padding: 18px 22px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
    box-sizing: border-box;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 1rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--main-color);
    border-radius: 12px;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}
.search-input::placeholder { color: var(--text-2); }
.search-input:focus { border-color: #fff; }

/* === Filters (liste de pills style modèle) === */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}
/* Sur une page de saga on omet les pills de genres — la div reste vide
   est repliée pour ne pas créer d'espace fantôme. */
#filters:empty { display: none; }

/* Pills : comportement "item de liste" du modèle — padding-left + barre d'accent */
.filter-pill {
    position: relative;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: padding-left 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    white-space: nowrap;
}
.filter-pill::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--main-color);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 6px var(--main-color);
    transition: height 0.3s ease;
}
.filter-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--main-color);
    padding-left: 18px;
}
.filter-pill:hover::before { height: 60%; }
.filter-pill.is-active {
    background: var(--main-color);
    color: #000;
    border-color: var(--main-color);
}
.filter-pill:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

.results-count {
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
    color: var(--text-2);
    margin-left: auto;
}

.sort-btn {
    font-family: system-ui, sans-serif;
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text-1);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.sort-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--main-color);
}
.sort-btn:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}


/* === Hub-sagas (page principale uniquement — section de découverte) === */
.sagas-hub {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 26px;
}
.sagas-hub[hidden] { display: none; }

.sagas-hub__label {
    font-family: system-ui, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-2);
}

/* Tête de section : flèche COLLÉE au label « Universes » (pas à droite,
   pour qu'on comprenne instinctivement qu'elle lui appartient). */
.sagas-hub__head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}
.sagas-hub__toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text-2);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.sagas-hub__toggle svg {
    width: 12px;
    height: 12px;
    display: block;
    transition: transform 0.3s ease;
}
.sagas-hub__toggle:hover,
.sagas-hub__toggle:focus-visible {
    border-color: var(--main-color);
    color: #fff;
    outline: none;
}
.sagas-hub.is-collapsed .sagas-hub__toggle svg {
    transform: rotate(-90deg);
}
.sagas-hub.is-collapsed .sagas-hub__grid {
    display: none;
}

.sagas-hub__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

/* Card saga : même langage que .game-card mais en accent lien (a, pas bouton) */
.saga-card {
    --card-accent: var(--main-color);
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.saga-card:hover {
    border-color: var(--card-accent);
    transform: translateY(-3px);
    box-shadow: 0 14px 40px color-mix(in srgb, var(--card-accent) 22%, transparent);
}
.saga-card:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

.saga-card__cover {
    position: relative;
    /* Pochette verticale 2:3 (box art classique) */
    aspect-ratio: 2 / 3;
    background: #1a1a1a;
    overflow: hidden;
}
/* Barre néon en haut de cover : la couleur de la cover EN COURS
   d'animation dans le diaporama (--card-accent est mis à jour par
   accueil.js à chaque slide). */
.saga-card__cover::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 2;
    background: var(--saga-bar, linear-gradient(90deg, transparent, var(--card-accent) 35%, var(--card-accent) 65%, transparent));
    box-shadow: 0 0 14px var(--card-accent);
    opacity: 0.9;
    transition: height 0.2s ease, box-shadow 0.2s ease;
}
.saga-card:hover .saga-card__cover::before {
    height: 5px;
    box-shadow: 0 0 22px var(--card-accent);
}
/* Diaporama des covers de la saga : les couvertures de tous les
   épisodes sont empilées en absolute, seule .is-visible est opaque
   (le JS fait tourner la classe → fondu enchaîné). */
.saga-card__slides {
    position: relative;
    width: 100%;
    height: 100%;
}
.saga-card__slides img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.9s ease;
}
.saga-card__slides img.is-visible {
    opacity: 1;
}
.saga-card__cover-fallback {
    width: 100%; height: 100%;
    display: grid;
    place-items: center;
    font-family: system-ui, sans-serif;
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.10);
    background: linear-gradient(135deg, #2a2e2a, #0b0b0b);
}

.saga-card__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
}
.saga-card__title {
    font-family: system-ui, sans-serif;
    font-size: 1.05rem;
    color: #fff;
}
.saga-card__count {
    font-size: 0.75rem;
    color: var(--text-2);
    font-family: monospace;
}
.saga-card__cta {
    margin-top: 4px;
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--card-accent);
}


/* === Grid & cards === */
.games-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.game-card {
    --card-accent: var(--main-color);
    background: var(--panel-bg);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--line);
}

.game-card:hover {
    border-color: var(--card-accent);
    transform: translateY(-2px);
    box-shadow:
        0 0 24px color-mix(in srgb, var(--card-accent) 26%, transparent),
        0 12px 34px color-mix(in srgb, var(--card-accent) 14%, transparent);
}
.game-card:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

.game-card__cover {
    /* Pochette verticale 2:3 (box art classique) */
    aspect-ratio: 2 / 3;
    background: #1a1a1a;
    overflow: hidden;
}
.game-card__cover img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.game-card__cover-fallback {
    width: 100%; height: 100%;
    display: grid;
    place-items: center;
    font-family: system-ui, sans-serif;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.10);
    background: linear-gradient(135deg, #2a2e2a, #0b0b0b);
}

.game-card__body {
    padding: 14px 16px 16px;
}

.game-card__title {
    font-family: system-ui, sans-serif;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 6px;
}

.game-card__desc {
    /* Override explicite `sans-serif` : texte long multi-lignes, on
       préserve la lisibilité (Bitcount Single est une display font,
       pas une UI text font). */
    font-family: sans-serif;
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.45;
    margin-bottom: 10px;
}

.game-card__footer {
    display: flex;
    justify-content: space-between;
    font-family: sans-serif;
    font-size: 0.75rem;
    color: var(--text-2);
    padding-top: 8px;
    border-top: 1px solid var(--line);
}
/* La catégorie porte l'accent de l'univers du jeu. */
.game-card__cat {
    color: var(--card-accent);
    font-weight: 700;
}


/* === Empty state === */
.empty-state {
    text-align: center;
    color: var(--text-2);
    font-size: 0.95rem;
    padding: 48px 16px;
}


/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid var(--line);
    transition: background 0.2s ease, border-color 0.2s ease;
}
.btn--primary {
    background: var(--main-color);
    color: #000;
    border-color: var(--main-color);
    flex: 1;
}
.btn--primary:hover {
    filter: brightness(1.15);
}
.btn__sub {
    font-family: monospace;
    font-size: 0.75rem;
    padding-left: 8px;
    border-left: 1px solid rgba(0, 0, 0, 0.3);
    opacity: 0.75;
}
.btn--ghost {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
}
.btn--ghost:hover { border-color: var(--main-color); }


/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: var(--panel-bg);
    border: 1px solid var(--main-color);
    border-radius: 12px;
    color: #fff;
    font-size: 0.9rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.toast.is-visible { opacity: 1; }


/* === Pages mono-jeu (game-<slug>.html) ===
   Layout 2-cols :
   - Gauche : carousel Steam-like (UN SEUL containeur `.game-hero__media-flow`) :
       • Tabs TRAILERS | SCREENSHOTS en haut (un seul .is-active)
       • Viewer : un seul pane visible (big <video> ou <img>)
       • Thumb strip : horizontal scrollable, click pour switch dans le big
   - Droite : catégorie, titre, desc, meta, tags, boutons
   - Bas    : autres épisodes de la saga (si game.saga)
   */
.game-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas:
        "media body"
        "more more";
    gap: 28px;
    background: var(--panel-bg);
    border-radius: var(--radius);
    padding: 28px;
    box-sizing: border-box;
}

/* Panneau hero sur pages mono-jeu : bordure teintée à la couleur de
   l'univers + lueur interne très subtile (--main-color est posé par la
   classe .theme--xxx du body). */
body.is-game-page .game-hero {
    border: 1px solid color-mix(in srgb, var(--main-color) 30%, transparent);
    box-shadow:
        0 24px 70px rgba(0, 0, 0, 0.55),
        inset 0 0 90px color-mix(in srgb, var(--main-color) 8%, transparent);
}

.game-hero__media {
    grid-area: media;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

/* UN seul containeur "media-flow" = Steam media panel.
   Pas de max-height, pas d'overflow interne sur le containeur lui-même :
   c'est la THUMB STRIP qui gère son propre scroll interne. */
.game-hero__media-flow {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* Tabs strip */
.game-media__tabs {
    display: flex;
    gap: 6px;
}
.game-media__tab {
    position: relative;
    padding: 9px 16px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.80);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line);
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.game-media__tab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--main-color);
}
.game-media__tab.is-active {
    background: var(--main-color);
    color: #000;
    border-color: var(--main-color);
}
.game-media__tab:focus-visible {
    outline: 2px solid var(--main-color);
    outline-offset: 2px;
}

/* Viewer : un pane visible à la fois */
.game-media__viewer {
    position: relative;
}
.game-media__pane {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.game-media__pane[hidden] { display: none; }

/* Big preview (un seul <video> ou <img>) — 16/9, plein largeur, contain */
.game-media__big {
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    display: grid;
    place-items: center;
}
.game-media__big video,
.game-media__big img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.game-media__big-fallback {
    width: 100%; height: 100%;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #2a2e2a, #0b0b0b);
}

/* Thumb strip : scroll horizontal avec custom scrollbar dark */
.game-media__strip {
    list-style: none;
    margin: 0;
    padding: 4px 2px;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-color: rgba(255,255,255,0.15) rgba(0,0,0,0.3);
    scrollbar-width: thin;
}
/* Custom scrollbar WebKit pour matcher le dark UI (CRITIQUE sur Windows) */
.game-media__strip::-webkit-scrollbar { height: 8px; }
.game-media__strip::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}
.game-media__strip::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
.game-media__strip::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.30);
}

/* Chaque thumb : 16/9 fixed width, clickable, hover/active visual */
.game-media__strip li {
    flex: 0 0 auto;
    position: relative;
    width: 130px;
    aspect-ratio: 16 / 9;
    background: #1a1a1a;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.15s ease;
}
.game-media__strip li:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}
.game-media__strip li.is-active {
    border-color: var(--main-color);
}
.game-media__strip li button {
    width: 100%;
    height: 100%;
    padding: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.game-media__strip li img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.game-media__thumb-fallback {
    width: 100%; height: 100%;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.30);
    background: linear-gradient(135deg, #2a2e2a, #0b0b0b);
}

/* Trailer thumbs : pas de poster image, on dessine un placeholder
   avec un mini triangle ▶ + numéro (visible sur fond foncé). */
.game-media__thumb-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 22px; height: 22px;
    display: grid;
    place-items: center;
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}
.game-media__thumb-play svg { width: 100%; height: 100%; }
.game-media__thumb-label {
    position: absolute;
    bottom: 4px; right: 6px;
    font-family: monospace;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.55);
    padding: 1px 5px;
    border-radius: 3px;
    pointer-events: none;
}

.game-hero__body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.game-hero__category {
    font-family: system-ui, sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--main-color);
    font-weight: 800;
}

.game-hero__title {
    font-family: system-ui, sans-serif;
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    color: #fff;
    line-height: 1.1;
    margin: 0;
}

.game-hero__desc {
    font-family: sans-serif;  /* Long texte : lisibilité > brand */
    font-size: 1rem;
    color: var(--text-1);
    line-height: 1.6;
    margin: 0;
}

.game-hero__meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 16px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    margin: 0;
}
.game-hero__meta div { display: flex; flex-direction: column; gap: 2px; }
.game-hero__meta dt {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
    margin: 0;
}
.game-hero__meta dd {
    margin: 0;
    color: #fff;
    font-family: monospace;  /* Data tabulaire : mono reste idéal */
    font-size: 0.9rem;
}
.game-hero__meta dd a {
    color: #fff;
    text-decoration: underline;
    text-decoration-color: var(--main-color);
    text-underline-offset: 3px;
}

.game-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.game-hero__tag {
    padding: 4px 10px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.game-hero__actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.game-hero__more {
    grid-area: more;
    border-top: 1px solid var(--line);
    padding-top: 18px;
    margin-top: 4px;
}
.game-hero__more[hidden] { display: none; }
.game-hero__more-title {
    font-family: system-ui, sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-2);
    font-weight: 700;
    margin: 0 0 10px;
}
.game-hero__more-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.game-hero__more-list li {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.85rem;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.game-hero__more-list a { color: #fff; }
.game-hero__more-list li:hover {
    border-color: var(--main-color);
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 720px) {
    .game-hero {
        grid-template-columns: 1fr;
        grid-template-areas: "media" "body" "more";
        padding: 18px;
        gap: 18px;
    }
    .game-hero__title { font-size: 1.5rem; }
    .game-hero__meta  { grid-template-columns: 1fr; }
    .game-media__strip li { width: 96px; }
    .game-media__tab { padding: 7px 12px; font-size: 0.75rem; }
}


/* === Responsive === */
@media (max-width: 720px) {
    .custom-header { height: 80px; }
    .title-banner { padding-left: 110px; height: 80px; }
    .title-banner.is-saga { padding-left: 24px; }
    .title-banner.is-saga h1 { font-size: 1.45rem; }
    .clipart-left { padding-left: 24px; }
    .btn-back { flex: 0 0 110px; font-size: 2.2rem; height: 80px; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .results-count { margin-left: 0; }
    .sagas-hub__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
    .games-grid { grid-template-columns: 1fr; }
    .sagas-hub__grid { grid-template-columns: 1fr; }
}

/* === Pages mono-jeu (game-<slug>.html)
//   Sur une page avec un seul jeu, la search-bar/sort de la toolbar
//   n'a aucun sens (1 seul résultat garanti). On la cache via le
//   hook <body class="is-game-page"> posé en dur sur ces pages. */
.is-game-page .toolbar { display: none; }

/* === Thèmes par univers (pages game-<slug>.html + saga-<slug>.html) ===
   Chaque page porte une classe .theme--xxx sur <body> : elle teinte
   --main-color / --banner-color / --bg-color-2 (le banner is-saga, les
   boutons, tabs et panneaux suivent via les tokens) et pose un fond
   multi-couches (2 halos colorés + dégradé de base) propre à l'univers.
   Les couleurs sont tirées des covers de chaque jeu :
   FNAF 1 brun Freddy · FNAF 2 cramoisi · FNAF 3 vert Springtrap ·
   FNAF 4 rouge agressif. (L'accueil construit sa nébuleuse multivers
   dynamiquement dans accueil.js.)
   ============================================================ */

/* FNAF 1 — brun Freddy (caméras du bureau ; hue ≈ 28° de la cover) */
body.theme--fnaf1 {
    --main-color: #c07a32;
    --banner-color: #8a5a26;
    --bg-color-2: rgb(13, 8, 4);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(192, 122, 50, 0.34), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(138, 84, 34, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(13, 8, 4) 0%, #0a0603 55%, #040201 100%);
}

/* Pages "catégorie globale" (saga) : fond sombre NEUTRE gris → noir
   avec jeu de lumière. Les couleurs ne vivent que sur les cartes de
   chaque jeu (et sur les pages de jeu elles-mêmes). */
body.theme--saga-fnaf {
    --main-color: #d6d0c2;
    --banner-color: #2a2a2d;
    --bg-color-2: rgb(12, 12, 14);
    background-image:
        radial-gradient(1100px 620px at 82% -10%, rgba(255, 255, 255, 0.05), transparent 62%),
        linear-gradient(160deg, #101014 0%, #0a0a0c 55%, #050506 100%);
}

/* FNAF 2 — cramoisi profond (cover rouge sombre du remake 1987) */
body.theme--fnaf2 {
    --main-color: #c2331a;
    --banner-color: #8f2a16;
    --bg-color-2: rgb(18, 5, 4);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(194, 51, 26, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(122, 22, 10, 0.18), transparent 62%),
        linear-gradient(165deg, rgb(18, 5, 4) 0%, #100303 55%, #050202 100%);
}

/* FNAF 3 — vert Springtrap (rouille moisi de Fazbear's Fright ; hue ≈ 60° de la cover) */
body.theme--fnaf3 {
    --main-color: #98a92c;
    --banner-color: #6f7c1e;
    --bg-color-2: rgb(12, 13, 4);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(152, 169, 44, 0.30), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(90, 98, 18, 0.18), transparent 62%),
        linear-gradient(165deg, rgb(12, 13, 4) 0%, #080902 55%, #030401 100%);
}

/* FNAF 4 — rouge sang profond #7b0a04 (agressif mais pas clair).
   Banner dans la même couleur. */
body.theme--fnaf4 {
    --main-color: #7b0a04;
    --banner-color: #7b0a04;
    --bg-color-2: rgb(18, 3, 2);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(123, 10, 4, 0.40), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(86, 7, 3, 0.22), transparent 62%),
        linear-gradient(165deg, rgb(18, 3, 2) 0%, #120302 55%, #070101 100%);
}

/* FNAF SL (Sister Location) — bleu violet électrique #4432da (hue ≈ 246°
   de la cover). Ambiance néon du sous-sol : halos bleus, fond nuit sombre. */
body.theme--fnafsl {
    --main-color: #4432da;
    --banner-color: #2a1f8f;
    --bg-color-2: rgb(10, 8, 26);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(68, 50, 218, 0.36), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(42, 31, 143, 0.22), transparent 62%),
        linear-gradient(165deg, rgb(10, 8, 26) 0%, #07051a 55%, #03020c 100%);
}

/* FFPS (Freddy Fazbear's Pizzeria Simulator) — orange doré #f19d00 (hue ≈ 37°
   de la cover). Ambiance "tycoon" de la pizzeria : halos ambrés chaleureux,
   contre-jour brun ambré profond, nuit brune sombre. */
body.theme--fnafpizzeria {
    --main-color: #f19d00;
    --banner-color: #8f5c00;
    --bg-color-2: rgb(18, 10, 4);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(241, 157, 0, 0.30), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(143, 92, 0, 0.22), transparent 62%),
        linear-gradient(165deg, rgb(18, 10, 4) 0%, #0d0703 55%, #050301 100%);
}

/* Stardew Valley — bleu ciel clair #45b7f7 (hue ≈ 202° de la cover) sur fond
   nuit bleutée. Ambiance ciel d'été sur la ferme : halos bleus lumineux,
   contre-jour plus profond, ciel sombre. */
body.theme--stardew {
    --main-color: #45b7f7;
    --banner-color: #1b6a98;
    --bg-color-2: rgb(6, 12, 18);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(69, 183, 247, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(27, 106, 152, 0.22), transparent 62%),
        linear-gradient(165deg, rgb(6, 12, 18) 0%, #04070c 55%, #020407 100%);
}

/* Page "catégorie globale" FNAC (saga) : fond sombre NEUTRE, comme la
   page saga FNAF — les couleurs ne vivent que sur les cartes et les
   pages de jeu. */
body.theme--saga-fnac {
    --main-color: #d6d0c2;
    --banner-color: #2a2a2d;
    --bg-color-2: rgb(12, 12, 14);
    background-image:
        radial-gradient(1100px 620px at 82% -10%, rgba(255, 255, 255, 0.05), transparent 62%),
        linear-gradient(160deg, #101014 0%, #0a0a0c 55%, #050506 100%);
}

/* FNAC 1 — rouge bonbon Candy (cover de la saga) */
body.theme--fnac1 {
    --main-color: #d6455f;
    --banner-color: #8f2a3c;
    --bg-color-2: rgb(20, 5, 9);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(214, 69, 95, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(143, 42, 60, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(20, 5, 9) 0%, #130306 55%, #060102 100%);
}

/* FNAC 2 — bleu nuit (cover de la suite) */
body.theme--fnac2 {
    --main-color: #4f7fe0;
    --banner-color: #2f4d99;
    --bg-color-2: rgb(7, 10, 22);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(79, 127, 224, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(47, 77, 153, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(7, 10, 22) 0%, #05070f 55%, #020308 100%);
}

/* FNAC 3 — ambre terni (cover du final de la trilogie) */
body.theme--fnac3 {
    --main-color: #d97e2e;
    --banner-color: #8f5318;
    --bg-color-2: rgb(20, 11, 5);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(217, 126, 46, 0.30), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(143, 83, 24, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(20, 11, 5) 0%, #120a03 55%, #060301 100%);
}

/* FNAC Remastered — rouge remaster (relecture de la cover d'origine) */
body.theme--fnacremake {
    --main-color: #e23b4e;
    --banner-color: #991f2e;
    --bg-color-2: rgb(22, 5, 8);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(226, 59, 78, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(153, 31, 46, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(22, 5, 8) 0%, #150305 55%, #060102 100%);
}

/* FNAF 4 Halloween Edition — ambre (cover Halloween de FNAF 4) */
body.theme--fnafhalloween {
    --main-color: #c16b25;
    --banner-color: #8a4a18;
    --bg-color-2: rgb(20, 12, 5);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(193, 107, 37, 0.34), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(138, 74, 24, 0.22), transparent 62%),
        linear-gradient(165deg, rgb(20, 12, 5) 0%, #130b03 55%, #060301 100%);
}

/* FNAF World — violet (cover du RPG spin-off) */
body.theme--fnafworld {
    --main-color: #6534b2;
    --banner-color: #45238a;
    --bg-color-2: rgb(10, 7, 18);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(101, 52, 178, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(69, 35, 138, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(10, 7, 18) 0%, #070410 55%, #030206 100%);
}

/* Ultimate Custom Night — bleu (cover de l'ultime custom night) */
body.theme--ucn {
    --main-color: #3463b2;
    --banner-color: #22448a;
    --bg-color-2: rgb(5, 9, 18);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(52, 99, 178, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(34, 68, 138, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(5, 9, 18) 0%, #040710 55%, #020307 100%);
}

/* Ultra Custom Night — rouge-orangé (cover du fan-game) */
body.theme--ultraucn {
    --main-color: #b24e34;
    --banner-color: #82351f;
    --bg-color-2: rgb(20, 8, 6);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(178, 78, 52, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(130, 53, 31, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(20, 8, 6) 0%, #130503 55%, #060201 100%);
}

/* Ib — rouge rose (la rose d'Ib, emblème du jeu) */
body.theme--ib {
    --main-color: #c62845;
    --banner-color: #8f1b31;
    --bg-color-2: rgb(20, 4, 8);
    background-image:
        radial-gradient(1200px 620px at 82% -12%, rgba(198, 40, 69, 0.32), transparent 60%),
        radial-gradient(900px 520px at 8% 112%, rgba(143, 27, 49, 0.20), transparent 62%),
        linear-gradient(165deg, rgb(20, 4, 8) 0%, #130205 55%, #060102 100%);
}

/* Banner + back-pill des pages thémées : version assombrie de l'accent
   (--banner-color) pour garder un titre blanc lisible. shared-header.css
   est chargé APRÈS accueil.css → on monte la spécificité avec `body`. */
body .title-banner.is-saga {
    background-color: var(--banner-color, var(--main-color));
    border-color: var(--banner-color, var(--main-color));
}
body .custom-header:has(.title-banner.is-saga) .btn-back {
    background-color: var(--banner-color, var(--main-color));
    border-color: var(--banner-color, var(--main-color));
}

/* Sur fond coloré, les textes #000 (bouton principal, tab active,
   pill active) manquent de contraste : on passe en blanc sur les
   pages thémées. */
body.theme--fnaf1 .btn--primary,
body.theme--fnaf1 .game-media__tab.is-active,
body.theme--fnaf1 .filter-pill.is-active,
body.theme--fnaf2 .btn--primary,
body.theme--fnaf2 .game-media__tab.is-active,
body.theme--fnaf2 .filter-pill.is-active,
body.theme--fnaf3 .btn--primary,
body.theme--fnaf3 .game-media__tab.is-active,
body.theme--fnaf3 .filter-pill.is-active,
body.theme--fnaf4 .btn--primary,
body.theme--fnaf4 .game-media__tab.is-active,
body.theme--fnaf4 .filter-pill.is-active,
body.theme--fnafsl .btn--primary,
body.theme--fnafsl .game-media__tab.is-active,
body.theme--fnafsl .filter-pill.is-active,
body.theme--fnafpizzeria .btn--primary,
body.theme--fnafpizzeria .game-media__tab.is-active,
body.theme--fnafpizzeria .filter-pill.is-active,
body.theme--stardew .btn--primary,
body.theme--stardew .game-media__tab.is-active,
body.theme--stardew .filter-pill.is-active,
body.theme--fnac1 .btn--primary,
body.theme--fnac1 .game-media__tab.is-active,
body.theme--fnac1 .filter-pill.is-active,
body.theme--fnac2 .btn--primary,
body.theme--fnac2 .game-media__tab.is-active,
body.theme--fnac2 .filter-pill.is-active,
body.theme--fnac3 .btn--primary,
body.theme--fnac3 .game-media__tab.is-active,
body.theme--fnac3 .filter-pill.is-active,
body.theme--fnacremake .btn--primary,
body.theme--fnacremake .game-media__tab.is-active,
body.theme--fnacremake .filter-pill.is-active,
body.theme--fnafhalloween .btn--primary,
body.theme--fnafhalloween .game-media__tab.is-active,
body.theme--fnafhalloween .filter-pill.is-active,
body.theme--fnafworld .btn--primary,
body.theme--fnafworld .game-media__tab.is-active,
body.theme--fnafworld .filter-pill.is-active,
body.theme--ucn .btn--primary,
body.theme--ucn .game-media__tab.is-active,
body.theme--ucn .filter-pill.is-active,
body.theme--ultraucn .btn--primary,
body.theme--ultraucn .game-media__tab.is-active,
body.theme--ultraucn .filter-pill.is-active,
body.theme--ib .btn--primary,
body.theme--ib .game-media__tab.is-active,
body.theme--ib .filter-pill.is-active {
    color: #fff;
}

