/* ============================================================
   VOXELMANA - THEME NEON SF (adapte du frontend React)
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cyber-cyan: #00ffff;
  --cyber-purple: #9333ea;
  --cyber-pink: #ec4899;
  --cyber-dark: #0a0a0f;
  --neon-yellow: #ffff33;
}

html, body {
  background: radial-gradient(ellipse at 50% 40%, #120a24 0%, #000 70%) fixed, #000;
  color: #fff;
  font-family: 'Rajdhani', 'Segoe UI', Helvetica, Arial, sans-serif;
  min-height: 100%;
}

/* Ciel etoile pixel-art (canvas injecte par gallery3d.js) : fond fixe derriere tout */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
  image-rendering: pixelated;
}

h1, h2, h3, h4 { font-family: 'Orbitron', sans-serif; }

a { color: var(--cyber-cyan); text-decoration: none; }
a:hover { color: #fff; }

/* ---------- Ligne de scan SF ---------- */
@keyframes scan {
  0%   { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}
.scan-line {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(transparent, rgba(0,255,255,0.5), transparent);
  animation: scan 4s linear infinite;
  pointer-events: none;
  z-index: 9999;
}

/* ---------- Splash ---------- */
/* Le CSS du splash est désormais INLINE dans le <head> de index.html (critique, zéro FOUC,
   animations 100% compositeur). Ne pas le redéclarer ici pour éviter toute dérive/conflit. */

/* ---------- Navbar ---------- */
nav.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cyber-cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
}
nav.topbar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--cyber-cyan), var(--cyber-purple), var(--cyber-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
nav.topbar .brand img {
  width: 36px; height: 36px;
  image-rendering: pixelated;
}
nav.topbar .links { display: flex; gap: 20px; align-items: center; }
nav.topbar .links a { color: #7fdfdf; font-weight: 600; }
nav.topbar .links a:hover { color: var(--cyber-cyan); }

/* site-wide language selector */
.site-lang-wrap { display: flex; align-items: center; }
#site-lang-sel {
  background: transparent; color: #7fdfdf; border: 1px solid #7fdfdf44;
  border-radius: 4px; font-family: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 2px 6px; cursor: pointer; outline: none;
  -webkit-appearance: none; appearance: none;
}
#site-lang-sel:hover { border-color: var(--cyber-cyan); color: var(--cyber-cyan); }
#site-lang-sel option { background: #0d0d1a; color: #ddd; }

.shop-only { display: none !important; }   /* re-affiche via JS si SHOP_ENABLED */
body.shop-enabled .shop-only { display: inline-flex !important; }

/* ---------- Gallery (home) ---------- */
#gallery-wrap {
  position: fixed;
  inset: 0;
  background: transparent;   /* le fond etoile (#starfield) doit transparaitre */
}
#gallery-canvas { position: absolute; inset: 0; z-index: 1; }
#gallery-canvas canvas { display: block; outline: none; }

.overlay-top {
  position: absolute;
  top: 70px; left: 0; right: 0;
  text-align: center;
  pointer-events: none;
  z-index: 5;
}
.overlay-top .tagline {
  color: #cccccc;
  letter-spacing: 3px;
  font-size: 14px;
}
.overlay-top .tagline .gx { color: #33ff33; font-weight: 700; }

/* Filtres types */
.filters {
  position: absolute;
  top: 112px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 6;
  padding: 0 10px;
}
.filters button {
  background: rgba(0,255,255,0.08);
  border: 1px solid rgba(0,255,255,0.4);
  color: #7fdfdf;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all .25s;
}
.filters button:hover { background: rgba(0,255,255,0.25); color: #fff; }
.filters button.active {
  background: rgba(0,255,255,0.3);
  color: #fff;
  box-shadow: 0 0 15px rgba(0,255,255,0.5);
}
/* recherche par titre = console verte : sous les filtres, large, curseur bloc qui pulse */
.filters .navsearch {
  order: 99; flex: 1 1 100%; max-width: 620px; min-width: 0; margin: 6px auto 0;   /* ligne du dessous, pleine largeur (barre Google) */
  background: rgba(4,20,8,0.62); border: 1px solid rgba(110,255,140,0.5);
  border-radius: 8px; padding: 8px 14px;
  color: #9bff7a; caret-color: #5dff7a; caret-shape: block;
  font-family: 'Courier New', 'Rajdhani', monospace; font-weight: 700; font-size: 14px; letter-spacing: 1px;
  outline: none; text-shadow: 0 0 6px rgba(110,255,140,0.45);
  animation: searchpulse 1.5s ease-in-out infinite;
}
.filters .navsearch::placeholder { color: #4f8f5e; }
.filters .navsearch:focus { animation: none; border-color: #9bff7a; box-shadow: 0 0 16px rgba(110,255,140,0.55); }
@keyframes searchpulse {
  0%, 100% { box-shadow: 0 0 2px rgba(110,255,140,0.15); border-color: rgba(110,255,140,0.4); }
  50%      { box-shadow: 0 0 16px rgba(110,255,140,0.55); border-color: rgba(110,255,140,0.95); }
}
.filters .navbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(147,51,234,0.2); border: 1px solid var(--cyber-purple);
  color: #cda6f5; border-radius: 8px; padding: 6px 14px; cursor: pointer;
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
}
.filters .navbtn:hover { background: rgba(147,51,234,0.35); color: #fff; }

/* Boutons navigation carrousel */
.carousel-nav {
  position: absolute;
  bottom: 110px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 6;
}
.carousel-nav button {
  background: rgba(0,255,255,0.12);
  border: 1px solid var(--cyber-cyan);
  color: #7fdfdf;
  padding: 10px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  transition: all .25s;
}
.carousel-nav button:hover {
  background: rgba(0,255,255,0.3);
  color: #fff;
  box-shadow: 0 0 20px rgba(0,255,255,0.4);
}
.carousel-nav button.alt { border-color: var(--cyber-purple); color: #cda6f5; }
.carousel-nav button.alt:hover { background: rgba(147,51,234,0.3); box-shadow: 0 0 20px rgba(147,51,234,0.4); color:#fff; }

/* Caption projet actif */
#active-caption {
  position: absolute;
  bottom: 175px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 6;
  pointer-events: auto;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 10px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(0,255,255,0.35);
  backdrop-filter: blur(6px);
  max-width: 90vw;
}
#active-caption .t {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  color: var(--cyber-cyan);
  text-shadow: 0 0 12px rgba(0,255,255,0.6);
}
#active-caption .s { font-size: 13px; color: #cda6f5; letter-spacing: 1px; }
#active-caption .hint { font-size: 11px; color: #666; }

/* Tooltip survol */
#tooltip {
  position: fixed;
  display: none;
  z-index: 100;
  background: rgba(0,0,0,0.85);
  border: 1px solid var(--cyber-cyan);
  color: var(--cyber-cyan);
  padding: 5px 10px;
  font-size: 13px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
}

/* Vue grille (fallback / toggle) */
#grid-view {
  display: none;
  position: relative;
  z-index: 4;
  padding: 150px 24px 60px;
  max-width: 1200px;
  margin: 0 auto;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  perspective: 1000px;   /* tilt 3D des cartes (parallax souris facon Balatro) */
}
body.grid-mode #grid-view { display: grid; }
body.grid-mode #gallery-canvas,
body.grid-mode .carousel-nav,
body.grid-mode #tooltip,
body.grid-mode #active-caption { display: none !important; }
body.grid-mode #gallery-wrap { position: static; min-height: 100vh; }
body.grid-mode footer.footer-fixed { display: none; }   /* pas de footer flottant pendant la navigation grille -> contact dispo dans le menu */

.gcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 14px;
  border-radius: 12px;
  border: 2px solid;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  transition: transform .5s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
  text-align: center;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}
.gcard:hover { box-shadow: 0 0 26px currentColor; }
.gcard .cover {
  width: 140px; height: 140px;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 40px;
  font-weight: 900;
  color: rgba(0,0,0,0.65);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
  transform: translateZ(26px);   /* profondeur : la cover "flotte" devant la carte au tilt */
}
/* reflet brillant qui suit la souris (feel Balatro) */
.gcard .glare {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  background: radial-gradient(circle at var(--gx,50%) var(--gy,50%),
              rgba(255,255,255,0.28), rgba(255,255,255,0) 55%);
  transform: translateZ(40px);
}
.gcard.tilt-on .glare { opacity: 1; }
/* fallback carte SANS image : texture pixel + initiales (au lieu d'un aplat) */
.gcard .cover.noimg {
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.18) 0 6px, rgba(255,255,255,0.05) 6px 12px),
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.18), rgba(0,0,0,0.25));
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
/* badge langue sur la vignette d'un livre (Kindle multi-langues, meme cover) */
.gcard .cover-lang {
  position: absolute; bottom: 6px; left: 6px; z-index: 2;
  background: rgba(0,0,0,0.78); color: #fff;
  font-family: 'Rajdhani', sans-serif; font-size: 20px; font-weight: 700;
  letter-spacing: 0.5px; padding: 2px 10px; border-radius: 6px; line-height: 1.5;
}
.gcard .t { font-family: 'Orbitron', sans-serif; font-size: 15px; color: var(--cyber-cyan); }
.gcard .y { font-size: 12px; color: #cda6f5; letter-spacing: 1px; }
.gcard .wip { font-size: 11px; color: var(--neon-yellow); }
.gcard .wip.soon { color: #9aa; }

/* carte collection (franchise/arc/tome) */
.gcard.collection .cover { position: relative; }
.gcard.collection .cover::after {
  content: "📂"; position: absolute; top: 6px; right: 8px;
  font-size: 20px; filter: drop-shadow(0 0 4px #000);
}
.gcard.collection .y { color: #7fdfff; }
/* carte coming-soon (placeholder, non cliquable) */
.gcard.coming { cursor: default; opacity: 0.6; }
.gcard.coming:hover { transform: none; }
.gcard.coming .cover { filter: grayscale(0.7); }

/* fil d'Ariane */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 12px 0 4px; font-size: 13px; }
.crumbs a { color: #9bd; }
.crumbs a:hover { color: var(--cyber-cyan); }
.crumbs span { color: #889; }
.crumbs .sep { color: #556; }
.crumbs > span:last-child { color: #cda6f5; }

/* grille d'une page collection */
.collgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }

/* section cross-media franchise */
.universe-section { margin-top: 2rem; }
.universe-section h2 { font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.universe-section h2 a { text-decoration: none; }
.universe-section h2 a:hover { text-decoration: underline; }

/* carte livre Kindle (lien externe Amazon) */
.gcard.book .cover { image-rendering: auto; }
.gcard.book .y { color: #ffcf99; }
.gcard.book .ex {
  font-size: 11px; color: #9a9; line-height: 1.35; margin-top: 4px;
  max-height: 4.1em; overflow: hidden; text-align: left;
}
.gcard.book::after {
  content: "↗ Amazon"; font-size: 10px; color: #ffb066; letter-spacing: 1px;
}

/* ---------- Page projet ---------- */
.project-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 100px 24px 60px;
  position: relative;
  z-index: 2;
}
.back-link { font-size: 14px; letter-spacing: 1px; }
.project-head {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.project-cover {
  width: 260px; height: 260px;
  border-radius: 14px;
  border: 2px solid;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', sans-serif;
  font-size: 72px;
  font-weight: 900;
  color: rgba(0,0,0,0.65);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}
.project-info { flex: 1 1 300px; min-width: 260px; }
.project-info h1 {
  font-size: 34px;
  color: var(--cyber-cyan);
  text-shadow: 0 0 14px rgba(0,255,255,0.5);
  margin-bottom: 6px;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--cyber-purple);
  color: #cda6f5;
  margin-right: 8px;
}
.badge.wip { border-color: var(--neon-yellow); color: var(--neon-yellow); }
.project-info .blurb { margin-top: 14px; font-size: 17px; color: #ddd; line-height: 1.5; }

/* About / language picker / screenshots / trailer (pages projet riches) */
.psection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.psection-head h2 { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; }
.lang-pick select {
  background: rgba(0,255,255,0.07);
  border: 1px solid rgba(0,255,255,0.4);
  color: #aef;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.lang-pick select:hover { border-color: var(--cyber-cyan); box-shadow: 0 0 10px rgba(0,255,255,0.3); }
.lang-pick select option { background: #120a24; color: #aef; }
.prose { margin-top: 14px; }
.prose p { font-size: 15px; color: #cfcfcf; line-height: 1.65; margin-bottom: 11px; }
.prose p:last-child { margin-bottom: 0; }
.prose hr.psep { border: none; border-top: 1px solid rgba(147,51,234,0.35); margin: 18px 0; }
.prose[dir="rtl"] { text-align: right; }

.shotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.shotgrid a {
  display: block; line-height: 0; overflow: hidden; border-radius: 10px;
  border: 1px solid rgba(147,51,234,0.4); transition: all .25s;
}
.shotgrid a:hover { border-color: var(--cyber-cyan); box-shadow: 0 0 18px rgba(0,255,255,0.35); }
.shotgrid img { width: 100%; height: auto; display: block; image-rendering: pixelated; }

.video-poster {
  position: relative; display: block; max-width: 600px;
  aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(0,255,255,0.4);
  background-size: cover; background-position: center;
  transition: all .25s;
}
.video-poster:hover { border-color: var(--cyber-cyan); box-shadow: 0 0 22px rgba(0,255,255,0.4); }
.video-poster .play {
  position: absolute; inset: 0; margin: auto; width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  background: rgba(0,0,0,0.55); border: 2px solid #fff; border-radius: 50%;
}
.video-poster .vlabel {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 12px; font-size: 13px; font-weight: 600; color: #eee;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

/* Like */
.like-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(236,72,153,0.1);
  border: 1px solid var(--cyber-pink);
  color: var(--cyber-pink);
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .25s;
}
.like-btn:hover { background: rgba(236,72,153,0.25); box-shadow: 0 0 18px rgba(236,72,153,0.4); }
.like-btn .like-heart { font-size: 22px; line-height: 1; }
.like-btn.liked { background: rgba(236,72,153,0.3); color: #fff; }

/* Sections page projet */
.psection { margin-top: 36px; }
.psection h2 {
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--cyber-purple);
  border-bottom: 1px solid rgba(147,51,234,0.4);
  padding-bottom: 6px;
  margin-bottom: 14px;
}
.linklist { display: flex; flex-wrap: wrap; gap: 10px; }
.linklist a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,255,255,0.07);
  border: 1px solid rgba(0,255,255,0.4);
  color: #aef;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  transition: all .25s;
}
.linklist a:hover { background: rgba(0,255,255,0.22); color: #fff; box-shadow: 0 0 14px rgba(0,255,255,0.35); }
.linklist .chip { font-size: 11px; color: #cda6f5; border: 1px solid rgba(147,51,234,0.5); border-radius: 999px; padding: 1px 8px; }
.empty-note { color: #666; font-size: 14px; }

/* "WHERE TO FIND IT" remonte a cote du bouton like (acces direct depuis la fiche) */
.project-info .store-inline { margin-top: 16px; }
.project-info .store-inline h2 { font-size: 14px; margin-bottom: 10px; }

/* Bloc boutique (cache si SHOP_ENABLED=false) */
#shop-block { display: none; }
body.shop-enabled #shop-block { display: block; }
#shop-block .price { font-size: 30px; font-weight: 700; color: var(--cyber-pink); margin-bottom: 12px; }
#shop-block .add-cart {
  background: linear-gradient(90deg, #06b6d4, var(--cyber-purple));
  border: none;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 17px;
  padding: 12px 26px;
  border-radius: 10px;
  cursor: pointer;
}

/* ---------- Footer ---------- */
footer.site-footer {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 26px 16px 30px;
  color: #666;
  font-size: 13px;
}
#gallery-wrap footer.site-footer,
.footer-fixed {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 12px 16px;
}
footer .social img { width: 30px; height: 30px; margin: 0 5px; vertical-align: middle; }
footer .mail a { color: #888; }
footer .mail a:hover { color: var(--cyber-cyan); }
footer .policies { margin-top: 6px; font-size: 11px; color: #555; }
footer .policies a { color: #557777; }
footer .policies a:hover { color: var(--cyber-cyan); }
footer .legal { margin-top: 4px; font-size: 11px; color: #555; }

/* ---------- Responsive ---------- */
@media (max-width: 700px) {
  nav.topbar { padding: 8px 12px; }
  nav.topbar .brand { font-size: 16px; letter-spacing: 1px; gap: 8px; }
  nav.topbar .brand img { width: 28px; height: 28px; }
  nav.topbar .links { gap: 10px; }
  nav.topbar .links a { font-size: 13px; }
  #site-lang-sel { font-size: 0.72rem; padding: 2px 4px; }
  .overlay-top { top: 56px; }
  .overlay-top .tagline { font-size: 11px; letter-spacing: 1px; padding: 0 8px; }
  .filters { top: 92px; gap: 6px; padding: 0 8px; }
  .filters button { padding: 5px 9px; font-size: 12px; }
  .filters .navsearch { order: 99; flex: 1 1 100%; min-width: 0; max-width: none; }   /* recherche pleine largeur, ligne du dessous */
  .filters .navbtn { padding: 5px 10px; font-size: 12px; }
  .carousel-nav { bottom: 118px; }
  .carousel-nav button { padding: 8px 16px; font-size: 14px; }
  #active-caption { bottom: 182px; max-width: 94vw; padding: 6px 14px; }
  #active-caption .t { font-size: 16px; }
  .project-head { flex-direction: column; gap: 18px; }
  .project-cover { width: 100%; height: 220px; font-size: 56px; }
}
@media (max-width: 480px) {
  nav.topbar .brand { font-size: 0; gap: 0; }    /* garde l'icone, masque le texte VOXELMANA (gagne de la place) */
  nav.topbar .brand img { width: 30px; height: 30px; }
  nav.topbar .links { gap: 8px; }
  nav.topbar .links a { font-size: 12px; }
  .overlay-top .tagline { font-size: 10px; letter-spacing: .5px; }
  .filters button { font-size: 11px; padding: 4px 8px; }
  #active-caption .t { font-size: 15px; }
}
