/* Page principale : catalogue de jeux. Carrousel d'affiches verticales (la sélectionnée agrandie au centre), deux onglets, fond animé.
   Les illustrations viendront de Gemini ; en attendant, chaque affiche a un cadre et un numéro sur un fond de jeu (jamais un aplat noir). */
body.hub {
  /* Socle : bleu royal électrique non uniforme (zones vives, zones bleu-nuit presque noires, larges bandes diagonales qui s'éclaircissent) */
  background-color: #2A86D6;
  background-image:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255,255,255,.28), transparent 100%),
    linear-gradient(118deg, transparent 0 8%, rgba(255,255,255,.10) 8% 17%, transparent 17% 24%, rgba(255,255,255,.07) 24% 41%, transparent 41% 47%, rgba(255,255,255,.10) 47% 58%, transparent 58% 66%, rgba(255,255,255,.06) 66% 84%, transparent 84%),
    linear-gradient(180deg, #5BB6F2 0%, #2F8FDE 45%, #1F74C4 85%, #1A63AE 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  overflow-x: hidden;
}
/* Fond animé : bandes lumineuses diagonales qui glissent + particules */
.ambiance { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambiance::before { content: ''; position: absolute; inset: -30%; background: repeating-linear-gradient(118deg, transparent 0 140px, var(--amb-bandes, rgba(120,150,255,.14)) 140px 230px, transparent 230px 420px); animation: bandes 46s linear infinite; }
.ambiance .grain { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,216,74,.8); box-shadow: 0 0 10px rgba(255,194,26,.8); animation: monte linear infinite; }
@keyframes bandes { from { transform: translateX(-420px); } to { transform: translateX(0); } }
@keyframes monte { from { transform: translateY(105vh); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } to { transform: translateY(-10vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ambiance::before, .ambiance .grain { animation: none; } }

.scene { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 14px 14px 36px; }

/* En-tête : logos bien visibles, nom du site en grand */
.entete-site { text-align: center; padding: 6px 0 4px; }
.logos-haut { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 2px 0 12px; }
.logos-haut .logo-puce { background: rgba(255,255,255,.96); border-radius: 12px; padding: 6px 10px; height: 62px; display: flex; align-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.logos-haut .logo-puce img { height: 48px; width: auto; max-width: 150px; object-fit: contain; }
.nom-site { margin: 4px 0 2px; font-family: 'Poppins', 'Montserrat', 'Arial Black', system-ui, sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; font-size: clamp(2.2rem, 10vw, 4.6rem); line-height: 1.05; color: #fff; filter: drop-shadow(0 3px 0 rgba(0,0,40,.6)); }
.slogan-site { margin: 4px 0 8px; color: #FFC21A; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .95rem; }

/* Deux onglets */
.onglets { display: flex; justify-content: center; gap: 10px; margin: 10px 0 6px; }
.onglets button { min-height: 46px; padding: 8px 20px; border-radius: 12px; background: #2b2d33; color: #c9ccd3; font-weight: 900; text-transform: uppercase; border-radius: 0; border: 0; letter-spacing: .04em; }
.onglets button[aria-selected="true"] { background: linear-gradient(180deg, #FFD84A, #FFC21A); color: #1a1204; box-shadow: 0 0 18px rgba(255,194,26,.45); }

/* Carrousel d'affiches */
.carrousel { position: relative; height: clamp(360px, 92vw, 470px); margin: 6px 0 0; touch-action: pan-y; user-select: none; }
.scene-affiches { position: absolute; inset: 0; perspective: 1200px; }
.affiche { position: absolute; left: 50%; top: 8px; width: var(--w, 210px); aspect-ratio: 2 / 3; margin-left: calc(var(--w, 210px) / -2); border-radius: 16px; overflow: hidden; cursor: pointer;
  border: 4px solid var(--bord, #d9b26a); background: var(--art, linear-gradient(160deg, #16264a, #0a1230));
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s, filter .45s; box-shadow: 0 14px 34px rgba(0,0,0,.6);
  -webkit-box-reflect: below 6px linear-gradient(transparent 62%, rgba(255,255,255,.22)); }
.affiche.centre { box-shadow: 0 0 34px var(--lueur, rgba(246,215,123,.55)), 0 18px 40px rgba(0,0,0,.65); }
.affiche img { width: 100%; height: 100%; object-fit: cover; display: block; }
.affiche .motif { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--bord, #d9b26a);
  background: radial-gradient(circle at 50% 36%, rgba(255,255,255,.14), transparent 55%), repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 14px, transparent 14px 38px); }
.affiche .motif .numero { font-family: Georgia, serif; font-weight: 800; font-size: clamp(4rem, 18vw, 6.4rem); text-shadow: 0 0 22px currentColor; line-height: 1; }
.affiche .motif .glyphe { font-size: 2rem; opacity: .85; }
.affiche .pastille { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); color: #f0dba4; border: 1px solid var(--bord, #6b5a3a); border-radius: 8px; padding: 2px 8px; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.affiche.verrou { filter: saturate(.55) brightness(.8); }
.fleche { position: absolute; top: 40%; z-index: 20; width: 46px; height: 62px; border-radius: 12px; border: 2px solid rgba(255,255,255,.3); background: rgba(8,14,36,.75); color: #fff; font-size: 2rem; line-height: 1; padding: 0; }
.fleche.gauche { left: 0; } .fleche.droite { right: 0; }

/* Sous l'affiche centrale */
.detail-jeu { text-align: center; max-width: 560px; margin: 4px auto 0; }
.detail-jeu h2 { margin: 0; font-family: 'Poppins', 'Montserrat', 'Arial Black', system-ui, sans-serif; font-weight: 900; text-transform: uppercase; font-size: clamp(1.4rem, 5.5vw, 2rem); color: #fff1bf; }
.detail-jeu .phrase { margin: 4px 0 10px; opacity: .9; }
.detail-jeu .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.detail-jeu .actions a, .detail-jeu .actions span { background: linear-gradient(180deg, #f6d77b, #c8923a); color: #1a1204; font-weight: 800; padding: 12px 26px; border-radius: 12px; text-decoration: none; letter-spacing: .05em; }
.detail-jeu .actions span { background: rgba(255,255,255,.12); color: #cfd8f5; border: 1px solid rgba(255,255,255,.25); }

.barre-bas { margin-top: 26px; display: grid; gap: 14px; justify-items: center; }
.rejoindre { width: min(520px, 100%); text-align: center; border: 2px solid #3FB6B0; border-radius: 12px; background: linear-gradient(180deg, rgba(15,42,48,.92), rgba(10,26,31,.92)); padding: 12px; box-shadow: 0 0 22px rgba(63,182,176,.25); }
.rejoindre label { margin: 0 0 8px; display: block; font-weight: 700; color: #bfe9e6; }
.rejoindre div { display: flex; gap: 8px; }
.rejoindre input { text-align: center; letter-spacing: .3em; font-size: 1.2rem; }
body.hub #logos { margin-top: 0; width: 100%; }
body.hub #logos img { height: 52px; }

/* Changement d'ambiance : deux calques en fondu enchaîné (≈ 450 ms), couleurs reprises du thème du jeu visé */
.ambiance .calque { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
.ambiance .calque.visible { opacity: 1; }
.ambiance::before { background: repeating-linear-gradient(115deg, transparent 0 90px, var(--amb-bandes, rgba(110,170,255,.10)) 90px 150px, transparent 150px 260px); transition: background .45s; }
.nom-site { transition: filter .45s; }
.affiche { transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .45s, filter .45s, box-shadow .45s; }
.affiche:hover { box-shadow: 0 0 40px var(--lueur, rgba(246,215,123,.6)), 0 18px 40px rgba(0,0,0,.65); cursor: pointer; }
.affiche:focus-visible { outline: 3px solid var(--amb-accent, #f2c14e); outline-offset: 4px; }
.onglets button[aria-selected="true"] { background: linear-gradient(180deg, #FFD84A, #FFC21A); }
.detail-jeu h2 { color: #fff; transition: color .45s; text-shadow: 0 0 22px var(--amb-halo, transparent); }
.detail-jeu .actions a, .detail-jeu .actions span { background: linear-gradient(180deg, color-mix(in srgb, var(--amb-accent, #f6d77b) 80%, #fff), var(--amb-accent, #c8923a)); }
.detail-jeu .actions a.secondaire { background: rgba(255,255,255,.12); color: #fff; border: 1px solid var(--amb-accent, #fff); }
.detail-jeu .actions span { background: rgba(255,255,255,.12); color: #dfe6ff; border: 1px solid rgba(255,255,255,.3); }
.apparition { animation: apparition .38s ease both; }
@keyframes apparition { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ambiance .calque, .affiche, .nom-site, .detail-jeu h2 { transition: none; }
  .apparition { animation: none; }
}

/* Logos vivants : rotation 3D type pièce (deux faces identiques, jamais en miroir), brillance qui traverse, lueur pulsée. transform/opacity seulement ; logos jamais modifiés. */
.logos-haut .logo-puce { position: relative; background: none; box-shadow: none; padding: 0; height: 62px; perspective: 700px; transition: transform .3s ease; }
.logos-haut .logo-puce::before { content: ''; position: absolute; inset: -4px; border-radius: 16px; background: radial-gradient(closest-side, rgba(150,175,255,.75), transparent); opacity: .25; animation: pulse 5s ease-in-out infinite; }
.logo-puce .piece { position: relative; height: 100%; transform-style: preserve-3d; animation: tour 7s ease-in-out infinite; }
.logo-puce .face { position: relative; height: 100%; display: flex; align-items: center; padding: 6px 10px; background: rgba(255,255,255,.96); border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.45); overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.logo-puce .face.dos { position: absolute; inset: 0; transform: rotateY(180deg); }
.logo-puce .face::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.8), transparent); transform: translateX(-160%) skewX(-18deg); animation: balayage 7s ease-in-out infinite; pointer-events: none; }
.logos-haut .logo-puce:nth-child(2) .piece, .logos-haut .logo-puce:nth-child(2) .face::after { animation-delay: 1.7s; }
.logos-haut .logo-puce:nth-child(3) .piece, .logos-haut .logo-puce:nth-child(3) .face::after { animation-delay: 3.4s; }
.logos-haut .logo-puce:nth-child(4) .piece, .logos-haut .logo-puce:nth-child(4) .face::after { animation-delay: 5.1s; }
.logos-haut .logo-puce:hover .piece, .logos-haut .logo-puce:active .piece { animation: tour1 1.2s ease-in-out 1; }
@keyframes tour { 0%, 82%, 100% { transform: rotateY(0); } 82.01% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }
@keyframes tour1 { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .15; } 50% { opacity: .55; } }
@keyframes balayage { 0%, 60% { transform: translateX(-160%) skewX(-18deg); } 100% { transform: translateX(380%) skewX(-18deg); } }
.nom-site { position: relative; display: inline-block; overflow: hidden; }
.nom-site::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: linear-gradient(100deg, transparent, rgba(255,194,26,.55), transparent); mix-blend-mode: overlay; transform: translateX(-160%) skewX(-18deg); animation: balayage 8s ease-in-out infinite; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .logo-puce .piece, .logo-puce .face::after, .logos-haut .logo-puce::before, .nom-site::after { animation: none !important; }
  .logos-haut .logo-puce::before { opacity: .35; }
  .logo-puce .face::after { transform: translateX(120%) skewX(-18deg); opacity: .6; }
}

/* Compact : une seule ligne de logos (4 ou 5), première vue = logos + titre + onglets + haut de l'affiche */
html { scrollbar-width: none; } html::-webkit-scrollbar { display: none; }
.scene { padding-top: 8px; }
.logos-haut { flex-wrap: nowrap; gap: 6px; margin: 0 0 4px; }
.logos-haut .logo-puce { height: 44px; flex: 0 1 auto; min-width: 0; }
.logo-puce .face { padding: 3px 6px; border-radius: 10px; }
.logos-haut .logo-puce img { height: 36px; max-width: 18vw; }
.nom-site { font-size: clamp(1.9rem, 9vw, 3.6rem); margin: 2px 0 0; }
.slogan-site { margin: 0 0 4px; font-size: .8rem; }
.onglets { margin: 6px 0 2px; }
.onglets button { min-height: 38px; padding: 6px 16px; }
.carrousel { height: clamp(300px, 80vw, 430px); margin: 2px 0 0; }
.affiche { top: 4px; }
.fleche { top: 30%; }
@media (min-width: 700px) { .logos-haut .logo-puce { height: 58px; } .logos-haut .logo-puce img { height: 46px; max-width: 150px; } .logos-haut { gap: 10px; } }
/* Masque le débordement horizontal des affiches (sinon le téléphone élargit la page) */
html, body.hub { overflow-x: clip; max-width: 100%; }
.carrousel { overflow-x: clip; overflow-y: visible; }
.logos-haut .logo-puce { flex: none; }
.logos-haut .logo-puce img { height: 30px; max-width: 17vw; }
.logos-haut .logo-puce { height: 38px; }
@media (min-width: 700px) { .logos-haut .logo-puce { height: 58px; } .logos-haut .logo-puce img { height: 46px; max-width: 150px; } }
body.hub { background-image:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255,255,255,.28), transparent 100%),
    linear-gradient(118deg, transparent 0 8%, rgba(255,255,255,.10) 8% 17%, transparent 17% 24%, rgba(255,255,255,.07) 24% 41%, transparent 41% 47%, rgba(255,255,255,.10) 47% 58%, transparent 58% 66%, rgba(255,255,255,.06) 66% 84%, transparent 84%),
    linear-gradient(180deg, #5BB6F2 0%, #2F8FDE 45%, #1F74C4 85%, #1A63AE 100%); }
.detail-jeu { margin-top: 22px; position: relative; z-index: 2; }

/* 5 plaques claires IDENTIQUES (même largeur et hauteur), logo ajusté en « contain » avec la même marge, jamais agrandi au-delà de sa taille native */
.logos-haut { --pw: min(150px, calc((100vw - 28px - 4 * 6px) / 5)); }
.logos-haut .logo-puce { width: var(--pw); height: calc(var(--pw) * .56); }
.logo-puce .face { width: 100%; height: 100%; padding: 4px; justify-content: center; box-sizing: border-box; border: 1px solid rgba(2,1,43,.18); background: #F7F5EE; }
.logos-haut .logo-puce img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
.logos-haut .logo-puce[data-id="chu"] img { max-width: 244px; }
@media (min-width: 700px) { .logos-haut { --pw: 150px; gap: 10px; } .logos-haut .logo-puce img { height: 100%; max-width: none; } .logos-haut .logo-puce[data-id="chu"] img { max-width: 136px; } }
.logo-puce .piece { width: 100%; }
.logo-puce .face { min-width: 0; }
.logo-puce .face.dos { width: 100%; }

/* Plaques de logos plus grandes sur téléphone (≈70x44), identiques pour les cinq */
.logos-haut { --pw: min(150px, calc((100vw - 12px - 4 * 3px) / 5)); gap: 3px; margin-left: -8px; margin-right: -8px; }
.logos-haut .logo-puce { height: calc(var(--pw) * .63); }
.logo-puce .face { padding: 3px; }
@media (min-width: 700px) { .logos-haut { --pw: 150px; gap: 10px; margin-left: 0; margin-right: 0; } .logos-haut .logo-puce { height: calc(var(--pw) * .56); } }
/* Étiquette de statut : seulement sur l'affiche centrale */
.affiche:not(.centre) .pastille { display: none; }

/* Écran large : carrousel plus bas pour garder titre et bouton dans la première vue, fond bleu prolongé jusqu'en bas */
@media (min-width: 700px) { .carrousel { height: 340px; } .detail-jeu { margin-top: 14px; } .detail-jeu .phrase { margin: 2px 0 8px; } }
body.hub { background-image:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255,255,255,.28), transparent 100%),
    linear-gradient(118deg, transparent 0 8%, rgba(255,255,255,.10) 8% 17%, transparent 17% 24%, rgba(255,255,255,.07) 24% 41%, transparent 41% 47%, rgba(255,255,255,.10) 47% 58%, transparent 58% 66%, rgba(255,255,255,.06) 66% 84%, transparent 84%),
    linear-gradient(180deg, #5BB6F2 0%, #2F8FDE 45%, #1F74C4 85%, #1A63AE 100%); }
@media (min-width: 700px) { .detail-jeu { max-width: 820px; } .detail-jeu h2 { font-size: 1.7rem; } }

/* Téléphone : voisines entières avec leur bord arrondi, flèches petites au bord extérieur (sans cacher les numéros) */
@media (max-width: 699px) {
  .carrousel { margin-left: -14px; margin-right: -14px; }
  .fleche { width: 28px; height: 44px; font-size: 1.4rem; border-radius: 10px; top: 36%; }
  .fleche.gauche { left: 2px; } .fleche.droite { right: 2px; }
}
@media (max-width: 699px) { .detail-jeu h2 { font-size: clamp(1.05rem, 5vw, 1.4rem); } }
.affiche img { object-fit: cover; object-position: 70% 40%; }

/* Affiches horizontales (16:9) : l'image entière est visible, plus de recadrage au centre */
.affiche { aspect-ratio: 16 / 9 !important; }
.affiche img { object-position: center; }
.carrousel { height: clamp(210px, 62vw, 300px) !important; }
@media (min-width: 700px) { .carrousel { height: 320px !important; } }
.carrousel { height: clamp(170px, 50vw, 230px) !important; }
@media (min-width: 700px) { .carrousel { height: 250px !important; } }

/* Cinq onglets : ils passent sur deux lignes si besoin, sans déborder de l'écran */
.onglets { flex-wrap: wrap; gap: 6px; padding: 0 8px; }
.onglets button { padding: 6px 12px; font-size: .8rem; min-height: 36px; }
@media (min-width: 700px) { .onglets button { padding: 8px 20px; font-size: 1rem; min-height: 44px; } }

/* Image affichée en entier (jamais coupée) pour les tuiles qui ne sont pas en 16:9 */
.affiche.contenir img { object-fit: contain; background: #0b1230; }
/* Tuiles presque carrées : carrées et entières, à la hauteur du carrousel */
.affiche.contenir { aspect-ratio: 1 / 1 !important; width: clamp(150px, 46vw, 225px) !important; margin-left: calc(clamp(150px, 46vw, 225px) / -2) !important; }

/* Fond vivant : image de l'affiche agrandie et floutée qui dérive, lueurs mobiles par-dessus le bleu */
.ambiance .fond-image { position: absolute; inset: -14%; background-size: cover; background-position: center; filter: blur(24px) saturate(1.9) brightness(1.05); opacity: 0; transition: opacity .9s ease; animation: derive 24s ease-in-out infinite alternate; }
.ambiance .fond-image.visible { opacity: .9; }
/* voile dégradé : garde le titre et les boutons lisibles sur toute image */
.ambiance::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,60,130,.35) 0%, rgba(10,60,130,0) 38%, rgba(10,60,130,0) 62%, rgba(10,60,130,.40) 100%); }
.ambiance .lueur { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: .5; mix-blend-mode: screen; }
.ambiance .l1 { left: -20vmax; top: -15vmax; background: radial-gradient(circle, rgba(120,225,255,.75), transparent 62%); animation: flotte1 19s ease-in-out infinite alternate; }
.ambiance .l2 { right: -25vmax; bottom: -20vmax; background: radial-gradient(circle, rgba(255,200,120,.55), transparent 62%); animation: flotte2 23s ease-in-out infinite alternate; }
@keyframes derive { from { transform: translate(-4%, -3%) scale(1.12) rotate(-1.5deg); } to { transform: translate(4%, 3%) scale(1.32) rotate(1.5deg); } }
@keyframes flotte1 { from { transform: translate(0, 0) scale(1); } to { transform: translate(30vw, 22vh) scale(1.25); } }
@keyframes flotte2 { from { transform: translate(0, 0) scale(1.1); } to { transform: translate(-28vw, -20vh) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .ambiance .fond-image, .ambiance .lueur { animation: none; } }
/* Ordre des couches du fond : dégradé de l'affiche (0), image floutée (1), bandes lumineuses (2), lueurs (3), voile de lisibilité (4), particules (5) */
.ambiance .calque { z-index: 0; }
.ambiance .fond-image { z-index: 1; }
.ambiance::before { z-index: 2; }
.ambiance .lueur { z-index: 3; }
.ambiance::after { z-index: 4; }
.ambiance .grain { z-index: 5; }
/* Les bandes lumineuses restent, mais en transparence : l'image de l'affiche doit se voir derrière */
.ambiance::before { opacity: .28; }
/* Réglage final : lueurs plus petites et discrètes, image de l'affiche plus vive pour que le fond la reflète */
.ambiance .lueur { width: 46vmax; height: 46vmax; opacity: .3; filter: blur(48px); }
.ambiance .fond-image { filter: blur(22px) saturate(2.1) brightness(.95); }
.ambiance .fond-image.visible { opacity: .95; }
.ambiance .lueur { mix-blend-mode: normal; opacity: .22; }
/* Bandes lumineuses très discrètes (elles masquaient l'image de fond) */
.ambiance::before { background: repeating-linear-gradient(115deg, transparent 0 90px, rgba(130,180,255,.07) 90px 150px, transparent 150px 260px) !important; opacity: 1 !important; }
/* Voile un peu plus marqué au milieu : le texte reste lisible même sur une image claire */
.ambiance::after { background: linear-gradient(180deg, rgba(4,10,60,.55) 0%, rgba(4,10,60,.12) 36%, rgba(4,10,60,.22) 64%, rgba(4,10,60,.72) 100%); }

/* Mur de photos : colonnes d'affiches qui défilent en sens contraires, légèrement penchées, sous le voile de lisibilité */
.ambiance .mur { position: absolute; inset: -20% -10%; display: flex; gap: 14px; justify-content: center; transform: rotate(-8deg); opacity: .38; z-index: 2; filter: saturate(1.3); }
.ambiance .colonne { flex: 0 0 clamp(120px, 22vw, 230px); display: flex; flex-direction: column; gap: 14px; animation: defile linear infinite; will-change: transform; }
.ambiance .colonne img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; display: block; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
@keyframes defile { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (max-width: 600px) { .ambiance .colonne:nth-child(n+4) { display: none; } }
@media (prefers-reduced-motion: reduce) { .ambiance .colonne { animation: none; } }

/* Personnages perchés sur les carreaux des logos : sans cadre ni fond, ils sautent sur place, puis un autre prend la relève */
.logos-haut { padding-top: calc(var(--pw) * 1.3); }
.logos-haut .logo-puce { isolation: isolate; }
.logos-haut .logo-puce img.perso { position: absolute; left: 50%; bottom: 100%; margin: 0 0 -3px; translate: -50% 0; width: auto; height: calc(var(--pw) * 1); max-width: none; border: 0; border-radius: 0; background: none; box-shadow: none; object-fit: contain; z-index: 3; pointer-events: none; transform-origin: 50% 100%; animation: saute-sur-logo 4.2s ease-in-out infinite; filter: drop-shadow(0 3px 4px rgba(0,0,0,.55)); }
@keyframes saute-sur-logo {
  0%, 62%, 100% { transform: translateY(0) scale(1, 1); }
  8%  { transform: translateY(0) scale(1.08, .92); }
  20% { transform: translateY(-30%) scale(.96, 1.05); }
  32% { transform: translateY(0) scale(1.08, .92); }
  44% { transform: translateY(-20%) scale(.97, 1.04); }
  54% { transform: translateY(0) scale(1.05, .95); }
}
.logos-haut .logo-puce:nth-child(2) img.perso { animation-delay: .8s; }
.logos-haut .logo-puce:nth-child(3) img.perso { animation-delay: 1.6s; }
.logos-haut .logo-puce:nth-child(4) img.perso { animation-delay: 2.4s; }
.logos-haut .logo-puce:nth-child(5) img.perso { animation-delay: 3.2s; }
@media (prefers-reduced-motion: reduce) { .logos-haut .logo-puce img.perso { animation: none; } }

/* Personnages visibles seulement dans « Jeux de classe » et « Simulation » (pour les étudiants) ; cachés, avec leur place, dans Études, Présentation et Entraînement (professeurs dans la salle) */
body:not([data-onglet="classe"]):not([data-onglet="simulation"]) .logo-puce .perso { display: none; }
body:not([data-onglet="classe"]):not([data-onglet="simulation"]) .logos-haut { padding-top: 0; }

/* Tuiles : l'image est entièrement visible (contenue), les bords sont remplis par une copie floutée */
.affiche .photo { position: absolute; inset: 0; background: #0b1230; }
.affiche .photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.affiche .photo img.flou { object-fit: cover; filter: blur(14px) brightness(.65) saturate(1.3); transform: scale(1.25); }
.affiche .photo img.nette { object-fit: contain; object-position: center; }

/* Six onglets : sur téléphone, une seule rangée qu'on fait défiler du doigt (l'onglet choisi est ramené dans la vue) */
@media (max-width: 699px) {
  .onglets { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 0 12px; }
  .onglets::-webkit-scrollbar { display: none; }
  .onglets button { flex: none; scroll-snap-align: center; white-space: nowrap; }
}

/* Téléphone : on voit qu'il y a d'autres onglets (bord qui s'estompe côté suite) */
@media (max-width: 699px) {
  .onglets.plus-droite { -webkit-mask-image: linear-gradient(90deg, #000 78%, transparent); mask-image: linear-gradient(90deg, #000 78%, transparent); }
  .onglets.plus-gauche { -webkit-mask-image: linear-gradient(270deg, #000 78%, transparent); mask-image: linear-gradient(270deg, #000 78%, transparent); }
  .onglets.plus-gauche.plus-droite { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
  .indice-onglets { display: flex; justify-content: center; gap: 5px; margin: 2px 0 4px; }
  .indice-onglets i { width: 18px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.28); transition: background .25s, width .25s; }
  .indice-onglets i.actif { background: #FFC21A; width: 26px; }
}
@media (min-width: 700px) { .indice-onglets { display: none; } }

/* Bouton « son » (couper ou remettre les petits sons) */
.bouton-son { position: fixed; bottom: 12px; right: 12px; z-index: 60; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(8,16,60,.6); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.affiche.contenir .photo img.nette { object-fit: cover; }
.affiche.contenir .photo img.flou { display: none; }

/* Recherche */
.recherche{display:flex;align-items:center;gap:8px;max-width:560px;margin:6px auto 2px;padding:0 16px;flex-wrap:wrap;justify-content:center}
.recherche input{flex:1 1 220px;min-width:0;padding:9px 14px;border-radius:999px;border:1px solid rgba(255,255,255,.22);background:rgba(8,14,34,.7);color:inherit;font:inherit}
.recherche input::placeholder{opacity:.6}
.recherche .portee{padding:8px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.22);background:rgba(8,14,34,.7);color:inherit;font:inherit;font-size:.85em;cursor:pointer}
.recherche .compteur-recherche{font-size:.85em;opacity:.75;min-width:70px}

/* Fond clair : la scène du catalogue ne recouvre plus l ambiance d un aplat sombre */
body.hub .scene { background: transparent; }
body.hub .scene::before { background: none; }

/* Lien discret vers le briefing enseignant, sous le bouton du jeu */
.detail-jeu .lien-briefing { display: block; width: fit-content; margin: 8px auto 0; font-size: .8rem; color: #cfd8f5; opacity: .75; text-decoration: underline; text-underline-offset: 3px; }
.detail-jeu .lien-briefing:hover, .detail-jeu .lien-briefing:focus-visible { opacity: 1; }
