:root{
  --bg: #0f0f0f;
  --bg-2: #151515;
  --text: #e8e8e8;
  --muted: #b7c2b5;
  --accent: #2f8f4b;     /* Green, echoing BB title card */
  --accent-2: #8cc63f;   /* Lighter green accent */
  --card: #1a1a1a;
  --border: #2a2a2a;
  --yellow: #caa351;     /* Desert parchment hint */
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: none !important;
  color: var(--text);
  font-family: Montserrat, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  scroll-behavior: smooth;
}

.brand-logo {
  height: 120px;
  width: auto;
  display: block;
}

.brand a {
  display: inline-block;
}
.brand a:hover img {
  opacity: 0.85;
}

/* Header / Nav */
.site-header {
  position: sticky; top: 0; z-index: 999;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.5px; }
.brand-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 1px solid var(--accent);
  color: var(--text); font-weight: 800;
}
.brand-text { font-family: Oswald, sans-serif; text-transform: uppercase; }
.nav { background: none; display: flex; gap: 14px; flex-wrap: wrap; }
.nav-link {
  color: var(--text); text-decoration: none; padding: 8px 10px; border-radius: 6px;
  transition: background .2s ease, color .2s ease;
}
.nav-link:hover { background: var(--bg-2); color: var(--accent-2); }

.site-header {
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

.site-header::before,
.site-header::after {
  content: none !important;
  background: none !important;
  opacity: 0 !important;
}

/* Hero */

/* Sections */
.section { padding: 50px 20px; max-width: 1200px; margin: 0 auto; position: relative; }
.section-head { margin-bottom: 2rem; position: relative; z-index: 0; }
#membres { margin-bottom: 4rem; position: relative; z-index: 2; }
#hotlines { margin-top: 2rem; position: relative; z-index: 1; }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-items: center; }
.grid-3 .card.member-card:last-child {
  grid-column: 2; /* forces the last card into the middle column */
}
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }



#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;       /* behind everything */
}


/* Debug helpers (toggle on if needed) */
/*
#membres { outline: 2px solid lime; }
#hotlines { outline: 2px solid magenta; }
.section-head { background: rgba(255,0,0,0.08); }
*/


/* Remove any tint/overlay around the hero content */
.hero,
.hero-inner {
  background: none !important;
  box-shadow: none !important;
  border: none !important;
}

/* Kill hero overlays if they exist */
.hero::before,
.hero::after,
.hero-inner::before,
.hero-inner::after {
  content: none !important;
  background: none !important;
  box-shadow: none !important;
  opacity: 0 !important;
}

/* Ensure the button itself isn’t creating a dark backdrop */
.hero .btn,
.hero .btn-primary {
  background: linear-gradient(0deg, #92ff4b, #eaff89); /* adjust to taste */
  color: #031c0f;
  border: none;
  box-shadow: 0 0 12px rgba(150, 255, 120, 0.35);     /* soft glow */
}

/* If a wrapper is imposing a band, clear it */
.hero .hero-inner > * {
  background: transparent !important;
  box-shadow: none !important;
}

/* Safety: remove any backdrop-filter panels */
.hero,
.hero-inner {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}


/* Base: keep card clipping + flip working */
.card.hotline-card {
  perspective: 1000px;
  width: 100%;
  aspect-ratio: 3 / 4;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.card.hotline-card .card-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.card.hotline-card:hover .card-inner {
  transform: rotateY(180deg);
}

/* Faces must fully match the card size */
.card.hotline-card .card-front,
.card.hotline-card .card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  box-sizing: border-box;
  padding: 0; /* no face padding */
  border: none;
}

.card.hotline-card .card-back {
  transform: rotateY(180deg);
  background: var(--card);
}

/* Optional: padding only inside back content wrapper */
.card.hotline-card .card-back .card-back-content {
  padding: 1rem;
}

/* Modifiez juste ce bloc dans votre CSS actuel */

.card.hotline-card .card-front,
.card.hotline-card .card-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  box-sizing: border-box;
  padding: 0;
  border: none;
}

/* --- AJOUTEZ JUSTE ÇA --- */
.card.hotline-card .card-back {
  transform: rotateY(180deg);
  background: var(--card);
  /* AJOUT 1 : Par défaut, le dos n'est pas cliquable */
  pointer-events: none; 
}

/* AJOUT 2 : Quand on survole la carte... */
.card.hotline-card:hover .card-back,
.card.hotline-card:active .card-back {
  /* ... le dos devient cliquable */
  pointer-events: auto;
}

.card.hotline-card:hover .card-front,
.card.hotline-card:active .card-front {
  /* ... et le devant laisse passer les clics */
  pointer-events: none;
}
/* ------------------------ */

/* Media must fill completely, no tint */
.card.hotline-card .card-media.hotline-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: none !important;     /* kill gradient overlay */
}

.card.hotline-card .card-media.hotline-media img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;    /* fill card, crop if needed */
  display: block;
  max-width: none !important;
  max-height: none !important;
}

/* Bottom overlay text: sits over the image but doesn’t affect image size */
.card.hotline-card .card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  color: var(--text);
  z-index: 2; /* ensure above image */
}

.card.hotline-card .card-front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.card.hotline-card .card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: none !important;
  z-index: 1;
}

.card.hotline-card .card-media img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
  max-width: none !important;
  max-height: none !important;
  border: none !important;
}

.section-desc-breakfast {
    color: var(--text)
}

/* =========================================
   GALERIE BANDEROLE & GRILLE (V2)
   ========================================= */

.gallery-section {
  position: relative;
  overflow: hidden;
  padding-bottom: 80px;
}

/* --- 1. LE STYLE BANDEROLE (CARROUSEL) --- */
.gallery-banderole {
  display: flex;
  gap: 10px; /* Écart réduit entre les photos */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 40px 50vw 40px 20px;
  scroll-behavior: smooth; /* Important pour les flèches */
  
  /* Cacher la barre de scroll */
  scrollbar-width: none; 
  -ms-overflow-style: none;
}

.gallery-banderole::-webkit-scrollbar { 
  display: none;
}

.banderole-item {
  flex: 0 0 60vw;
  max-width: 800px;
  aspect-ratio: 16/9;
  scroll-snap-align: center;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  transition: transform 0.4s ease, opacity 0.4s ease;
  
  /* MODIFICATION : Moins transparent qu'avant */
  opacity: 0.6; 
  transform: scale(0.92); 
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.banderole-item img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;   /* évite le zoom */
  object-position: center;
  background-color: black;          /* optionnel (évite les trous transparents) */
  display: block;
}



/* L'élément actif (celui au centre) */
.banderole-item.is-active {
  opacity: 1; /* Totalement visible */
  transform: scale(1);
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 10;
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .banderole-item {
    flex: 0 0 85vw;
  }
}

/* --- 2. LIGHTBOX (Grand écran) --- */
.lightbox {
  display: none; 
  position: fixed; 
  z-index: 10000; 
  left: 0; top: 0;
  width: 100%; height: 100%; 
  background-color: rgba(0, 0, 0, 0.98);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-content {
  max-width: 90%;
  max-height: 75vh;
  box-shadow: 0 0 50px rgba(0,0,0,1);
  border-radius: 4px;
  transition: opacity 0.2s; /* Pour fluidifier le changement au pad */
}

/* Bouton Voir Grille */
.btn-grid-view {
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: 0.3s;
}

.btn-grid-view:hover {
  background: white;
  color: black;
}

.grid-icon { font-size: 1.2rem; }

/* Navigation Lightbox */
.close-lightbox, .close-grid {
  position: absolute;
  top: 20px; right: 30px;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
  z-index: 10002;
  font-family: sans-serif;
}

.prev-lightbox, .next-lightbox {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 30px;
  transition: 0.3s;
  user-select: none;
}
.prev-lightbox { left: 20px; }
.next-lightbox { right: 20px; }
.prev-lightbox:hover, .next-lightbox:hover { background: var(--accent); }

/* --- 3. GRILLE OVERLAY --- */
.grid-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0f0f0f;
  z-index: 10001;
  padding: 80px 20px 20px 20px;
  overflow-y: auto;
}

.grid-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  background: rgba(15, 15, 15, 0.95);
  display: flex;
  align-items: center;
  padding-left: 30px;
  z-index: 2;
  border-bottom: 1px solid #333;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-width: 1400px;
  margin: 0 auto;
}

.grid-item-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}

.grid-item-thumb:hover {
  transform: scale(1.05);
  z-index: 1;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}


/* =========================================
   PLANNING ESTHÉTIQUE (STYLE CHIMIE) - CORRIGÉ
   ========================================= */

.planning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); 
  gap: 25px;
  margin-top: 20px;
}

/* La Carte du Jour */
.planning-card {
  background: rgba(26, 26, 26, 0.6); 
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 25px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.planning-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

/* En-tête "Tableau Périodique" */
.chemical-header {
  display: flex; align-items: center; gap: 15px; margin-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 15px;
}

.element-square {
  width: 60px; height: 60px; background-color: var(--accent); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; border-radius: 4px; position: relative;
}

.atomic-number { position: absolute; top: 2px; left: 4px; font-size: 0.7rem; opacity: 0.8; }
.symbol { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.day-name { margin: 0; font-size: 1.5rem; text-transform: uppercase; font-family: 'Oswald', sans-serif; color: var(--text); }

/* --- C'EST ICI LA CORRECTION D'ALIGNEMENT --- */

.schedule-items {
  display: flex; flex-direction: column; gap: 20px;
}

.time-slot {
  display: flex;
  /* Cette ligne assure que le texte de droite est toujours CENTRÉ par rapport à l'heure */
  align-items: center; 
  position: relative;
}

/* On supprime l'ancienne barre faite avec ::before car elle gérait mal le centrage */
.time-slot::before { display: none; }

.time {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  color: var(--accent-2); /* Vert clair */
  font-size: 1rem;
  
  /* Largeur fixe OBLIGATOIRE pour que tout soit aligné */
  width: 80px; 
  flex-shrink: 0; /* Empêche de rétrécir */
  
  text-align: right; /* Colle le texte à droite vers la barre */
  padding-right: 15px; /* Espace avant la barre */
  line-height: 1.2; /* Pour que les doubles heures soient jolies */
}

.event {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  flex: 1;
  
  /* La barre verticale est maintenant ici (bordure gauche du texte) */
  border-left: 2px solid rgba(255,255,255,0.15);
  padding-left: 15px; /* Espace après la barre */
}

.event a { color: inherit; text-decoration: none; }
.event a:hover { color: var(--accent); }
.event small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; font-size: 0.85rem; }


/* =========================================
   PIXEL WAR (STYLES)
   ========================================= */
body.pixelwar-page {
    overflow: hidden; /* Empêche le scroll sur la page de dessin */
    background-color: var(--bg);
}

.pixelwar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 80px); /* Toute la hauteur moins le header */
    position: relative;
}

.canvas-wrapper {
    position: relative;
    box-shadow: 0 0 50px rgba(47, 143, 75, 0.2);
    border: 2px solid var(--border);
    cursor: crosshair;
    background: #111;
    overflow: auto; /* Permet de scroller si l'écran est petit */
    max-width: 95vw;
    max-height: 70vh;
    border-radius: 4px;
}

canvas {
    display: block;
    image-rendering: pixelated; /* Garde les pixels bien nets */
}

/* Barre d'outils flottante */
.pixel-toolbar {
    margin-top: 20px;
    background: var(--card);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid var(--border);
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10;
    max-width: 90%;
    flex-wrap: wrap;
    justify-content: center;
}

.color-palette {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.color-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: transform 0.1s, border-color 0.1s;
}

.color-btn:hover { transform: scale(1.2); }

.color-btn.active {
    border-color: #fff;
    transform: scale(1.3);
    box-shadow: 0 0 10px currentColor;
}

.tool-btn {
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Oswald', sans-serif;
    transition: 0.2s;
}
.tool-btn:hover { background: var(--accent); border-color: var(--accent); }

/* Indicateur En Ligne */
.status-indicator {
    display: flex; align-items: center; gap: 8px;
    margin-right: 20px;
    font-family: monospace; color: #888; font-size: 0.85rem;
}
.dot { width: 10px; height: 10px; background: #555; border-radius: 50%; transition: 0.3s;}
.dot.online { background: #2f8f4b; box-shadow: 0 0 8px #2f8f4b; }


/* ============================================================
   FIX : IMAGE DE FOND POUR LE DOS DES CARTES
   ============================================================ */

/* Le conteneur de l'image au dos */
.card-back-bg {
    position: absolute;
    inset: 0;          /* Colle aux 4 bords */
    width: 100%;
    height: 100%;
    z-index: 0;        /* Se met en arrière-plan */
    border-radius: 12px; 
    overflow: hidden;
}

/* L'image elle-même */
.card-back-bg img {
    width: 100% !important; /* Force la largeur */
    height: 100% !important; /* Force la hauteur */
    object-fit: cover !important; /* Remplit tout l'espace sans déformer */
    display: block;
    opacity: 1;      /* Sombre pour lire le texte par dessus */
    max-width: none !important; /* Annule les restrictions précédentes */
    max-height: none !important;
}

/* On s'assure que le texte passe DEVANT l'image */
.card-back h3, 
.card-back p,
.card-back div {
    position: relative;
    z-index: 2; 
    text-shadow: 0 2px 5px rgba(0,0,0,1); /* Ombre pour lisibilité */
}

/* Ajustement du conteneur parent pour centrer le texte */
.card.member-card .card-back {
    padding: 0; 
    justify-content: center; 
}

/* ============================================================
   CORRECTIF : ADAPTATION MOBILE (PRIORITAIRE)
   ============================================================ */

@media (max-width: 900px) {
    
    /* 1. GRILLE : Force une colonne unique */
    .grid-3, .planning-grid {
        display: flex !important; /* On passe en Flex pour empiler simplement */
        flex-direction: column;
        align-items: center;
        gap: 30px; /* Espace entre les cartes */
    }

    /* 2. DERNIER MEMBRE : Annule le centrage forcé qui cassait tout */
    .grid-3 .card.member-card:last-child {
        grid-column: auto !important;
        margin-left: 0;
        margin-right: 0;
    }

    /* 3. TAILLE DES CARTES : Taille idéale pour téléphone */
    .card {
        width: 100%;
        max-width: 320px !important; /* Largeur standard iPhone/Android */
        margin: 0 auto; /* Centrage */
    }

    /* 4. HEADER : Menu adapté */
    .site-header {
        flex-direction: column;
        padding: 10px;
        background: rgba(15, 15, 15, 0.95) !important; /* Fond plus opaque */
    }
    
    .brand-logo {
        height: 60px; /* Logo plus petit */
        margin-bottom: 10px;
    }

    .nav {
        justify-content: center;
        gap: 8px;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 6px 10px;
        background: rgba(255,255,255,0.08); /* Petit fond pour voir les boutons */
    }
}


/* =========================================
   ZONE MEME & BANNIÈRE (VERSION REELS)
   ========================================= */

/* --- 1. BANNIÈRE ACCUEIL (Reste inchangée) --- */
.meme-section-link {
  text-decoration: none; display: block; margin: 40px 0; overflow: hidden;
  position: relative; border-top: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  background: rgba(47, 143, 75, 0.1); transform: rotate(-1deg);
  transition: transform 0.3s, background 0.3s;
}
.meme-section-link:hover { transform: rotate(0deg) scale(1.02); background: var(--accent); }
.meme-banner-content { display: flex; white-space: nowrap; padding: 15px 0; }
.scrolling-text {
  font-family: 'Oswald', sans-serif; font-size: 1.5rem; font-weight: 800;
  text-transform: uppercase; color: #fff; padding-left: 20px;
  animation: scrollText 20s linear infinite;
}
@keyframes scrollText { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }


/* --- 2. PAGE MEMES STYLE REELS --- */

/* Conteneur principal qui gère le scroll */
.reels-container {
  height: 100vh; /* Toute la hauteur de l'écran */
  width: 100%;
  overflow-y: scroll; /* Scroll vertical */
  scroll-snap-type: y mandatory; /* Effet magnétique vertical */
  background-color: #000;
  position: relative;
  scrollbar-width: none; /* Cache la barre de scroll Firefox */
}
.reels-container::-webkit-scrollbar { display: none; /* Cache la barre Chrome/Safari */ }

/* Chaque "Reel" individuel */
.reel-item {
  height: 100vh;
  width: 100%;
  max-width: 600px; /* Largeur max type mobile */
  margin: 0 auto;   /* Centré sur PC */
  scroll-snap-align: start; /* C'est ici que l'écran s'arrête */
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #111;
  border-left: 1px solid #333;
  border-right: 1px solid #333;
}

/* Le média (Image ou Vidéo) */
.reel-media {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Affiche tout le meme sans couper */
  display: block;
}

/* Interface par-dessus (Texte, Like, etc.) */
.reel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  color: white;
  pointer-events: none; /* Laisse passer les clics vers la vidéo */
  z-index: 10;
}

.reel-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.reel-avatar {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--accent);
}
.reel-username { font-weight: bold; font-family: 'Oswald', sans-serif; }
.reel-caption { font-size: 0.95rem; line-height: 1.4; color: #eee; }

/* Bouton Muet/Son */
/* Bouton Son TOUJOURS visible */
.sound-indicator {
  position: absolute; 
  top: 20px; 
  right: 20px;
  background: rgba(0,0,0,0.6); 
  color: white;
  padding: 8px 12px; 
  border-radius: 20px; 
  font-size: 0.8rem;
  pointer-events: none; /* Le clic passe au travers pour activer le script */
  opacity: 1; /* RESTE TOUJOURS VISIBLE */
  z-index: 20;
  border: 1px solid rgba(255,255,255,0.3); /* Petit bord pour faire joli */
}