@font-face {
  font-family: 'LatinKilubaiser';
  src: local('LatinKilubaiser-Regular'), url('fonts/LatinKilubaiser-Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Kiluba';
  src: url('fonts/Kiluba.ttf') format('truetype');
  font-display: block;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #000;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  font-family: 'LatinKilubaiser', monospace, sans-serif;
}

/* Bouton Chatbot Flottant = bouton info */
#chatbot-trigger {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 100px;
  height: 100px;
  cursor: pointer;
  z-index: 6000;               /* au-dessus des portes (5000) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  opacity: 0;                  /* caché jusqu'à la fin du rituel */
  pointer-events: none;
  transition: transform 0.3s ease, opacity 1.5s ease;
}

#chatbot-trigger.ready {
  opacity: 1;
  pointer-events: auto;
}

#chatbot-trigger img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.3s ease, transform 0.9s cubic-bezier(0.77, 0, 0.18, 1);
}

#chatbot-trigger.open img {
  transform: rotate(90deg);    /* revient à 0 (-90°) à la fermeture */
}

#chatbot-trigger:hover {
  transform: scale(1.08);
}

#chatbot-trigger:hover img {
  filter: drop-shadow(0 0 5px #39FF14) drop-shadow(0 0 10px rgba(57, 255, 20, 0.8));
}

/* Vidéo de fond (élément HTML derrière le canvas) */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: fill;            /* "cover" pour garder les proportions */
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}

#bg-video.visible {
  opacity: 1;
}

/* Conteneur WebGL 3D (lukasa seul, fond transparent) */
#canvas-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10;
  opacity: 0;
  transition: opacity 2s ease;
}

#canvas-container.visible {
  opacity: 1;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Écran de chargement */
#progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  transition: opacity 1s ease;
}

#progress {
  font-size: 2.5em;
  color: #39FF14;
  text-shadow: 0 0 15px rgba(57, 255, 20, 0.6);
  text-align: center;
  letter-spacing: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#percent-text {
  font-size: 0.8em;
  opacity: 0.8;
}

#enter-btn {
  display: none;
  margin-top: 20px;
  font-size: 0.8em;
  color: #39FF14;
  border: 1px solid #39FF14;
  padding: 10px 30px;
  cursor: pointer;
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(57, 255, 20, 0.8);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
  transition: background 0.3s ease, transform 0.2s ease;
}

#enter-btn:hover {
  background: rgba(57, 255, 20, 0.2);
  transform: scale(1.05);
}

/* Avertissement de restriction d'écran */
#desktop-warning {
  position: fixed;
  inset: 0;
  background: black;
  color: #39FF14;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  text-align: center;
  padding: 40px;
}

#desktop-warning.show {
  display: flex;
}

.ritual-message {
  max-width: 500px;
  font-size: 1.4rem;
  line-height: 1.8;
  letter-spacing: 0.05em;
}

/* Stage 1 - Sub-stage B : Le Vaisseau & la Boisson (Kabwelulu) */
#vessel-container {
  position: fixed;
  inset: 0;
  background-color: #000000;
  z-index: 500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

#vessel-container.active {
  opacity: 1;
  pointer-events: auto;
}

#vessel-wrapper {
  width: 340px;
  height: 500px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

#vessel-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgba(20, 234, 0, 0.938));
}

#liquid-fill {
  transform-origin: bottom;
  transition: transform 0.05s linear;
}

.ritual-instruction {
  font-size: 1rem;
  letter-spacing: 0.25em;
  color: #666;
  margin-top: 30px;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
}

/* Stage 2 : Encrypt Panel Container */
#kusubula-container {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
}

#kusubula-container.active {
  display: flex;
}

/* Enrobage vertical du titre + panneau */
.kusubula-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* Style des titres au-dessus du panneau */
.kusubula-header {
  text-align: center;
  color: #39FF14;
}

.kusubula-title {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(57, 255, 20, 0.7);
}

.kusubula-subtitle {
  margin-top: 8px;
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: rgba(57, 255, 20, 0.75);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
}

/* Encrypt Panel styling - Version grand format fixe */
.panel {
  position: relative;
  width: 1080px;
  height: 420px;
  border: 4px solid #00ff41;
  border-radius: 26px;
  background: #000;
  box-shadow: 
    0 0 25px rgba(0, 255, 65, 0.65),
    inset 0 0 20px rgba(0, 255, 65, 0.12);
}

/* Bead buttons grand format avec positions fixes */
.btn {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    inset 0 3px 6px rgba(255,255,255,0.25),
    inset 0 -3px 6px rgba(0,0,0,0.6),
    0 2px 4px rgba(0,0,0,0.8);
}

.btn::after {
  content: "";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ccc, #666 60%, #222);
  box-shadow: inset 0 1px 3px rgba(255,255,255,0.4);
}

.btn-green {
  top: 90px;
  left: 35px;
  background: linear-gradient(145deg, #1a9a3a, #0d5c22);
  border-color: #0a4a1a;
}

.btn-red {
  top: 250px;
  left: 35px;
  background: linear-gradient(145deg, #c43a2a, #7a1e14);
  border-color: #5a1510;
}

.btn-white {
  top: 90px;
  right: 35px;
  background: linear-gradient(145deg, #e8e8e8, #a8a8a8);
  border-color: #888;
}

.btn-black {
  top: 250px;
  right: 35px;
  background: linear-gradient(145deg, #3a3a3a, #111);
  border-color: #1e1d1d;
}

/* Disposition des barres et champs de texte agrandis */
.bars {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.bars-left {
  left: 115px;
  top: 60px;
}

.bars-right {
  right: 115px;
  top: 60px;
}

.bar-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.bar-input {
  width: 400px;
  height: 56px;
  background: #003b12;
  border: 3.5px solid #00ff41;
  border-radius: 28px;
  padding: 0 22px;
  color: #00ff41;
  font-family: inherit;
  font-size: 18px;
  outline: none;
  box-shadow: 
    0 0 12px rgba(0, 255, 65, 0.45),
    inset 0 0 10px rgba(0, 255, 65, 0.2);
  transition: all 0.3s ease;
}

.bar-input::placeholder {
  color: rgba(0, 255, 65, 0.45);
}

.bar-input:focus {
  background: #005c1d;
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.9), inset 0 0 12px rgba(0, 255, 65, 0.4);
}

/* Bouton ENCRYPT agrandi */
.encrypt {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  border: 3.5px solid #00ff41;
  border-radius: 16px;
  padding: 8px 40px;
  color: #00ff41;
  font-family: inherit;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 
    0 0 12px rgba(0, 255, 65, 0.6),
    inset 0 0 8px rgba(0, 255, 65, 0.2);
  transition: all 0.3s ease;
}

.encrypt:hover {
  background: rgb(2, 67, 18);
  box-shadow: 0 0 22px rgba(0, 255, 65, 1);
  transform: translateX(-50%) scale(1.05);
}

/* Stage 2.5 : Transition GIF après la corde */
#ritual-gif-container {
  position: fixed;
  inset: 0;
  z-index: 300;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

#ritual-gif-container.active {
  opacity: 1;
  pointer-events: auto;
}

#ritual-gif {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

/* Symbols Container */
#symbols-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}

/* Floating Symbol Entity */
.floating-symbol {
  position: absolute;
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) blur(1.5px) invert(67%) sepia(99%) saturate(452%) hue-rotate(68deg) brightness(105%) drop-shadow(0 0 12px rgba(57, 255, 20, 0.7));
  opacity: 1;
  transform: translateY(0) scale(0.9);
  transition: transform 2.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 2.5s ease-out;
}

.floating-symbol.fade-out {
  transform: translateY(70px) scale(1);
  opacity: 0;
}



/* --- KASALA CINEMATIC ANIMATIONS (anciennes, inutilisées) --- */
@keyframes slideRightToLeft {
  0% {
    right: -100vw;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    right: 105vw;
    opacity: 0;
  }
}

.animating-transit {
  animation: slideRightToLeft 7s linear forwards;
}

.kasala-stacked-line {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInStack 0.6s ease forwards;
}

@keyframes fadeInStack {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* --- KASALA FLOW : droite -> gauche, changement de police, pile à gauche --- */
#kasala-flow {
  --lh: 24px;                  /* hauteur de ligne */
  --fs: 20px;                  /* taille du texte */
  --line-y: max(24vh, 200px);  /* hauteur de la ligne de droite */
  --stack-up: 4px;             /* de combien la pile monte */
  --max: 8;                    /* identique à MAX_LINES dans kasala-flow.js */
  position: fixed;
  inset: 0;
  z-index: 5;                  /* au-dessus de la vidéo (1), sous le lukasa (10) */
  pointer-events: none;        /* les clics passent aux perles */
  display: none;
  color: #7dffb0;
  font-size: var(--fs);
  line-height: var(--lh);
  white-space: pre;

  opacity: 0;
  transition: opacity 0.8s ease;   /* durée du fade */
}

#kasala-flow.active {
  display: block;
}

#kasala-flow.visible {
  opacity: 1;
}

#kasala-ticker {
  position: absolute;
  left: 3vw;
  width: 100%;
  top: var(--line-y);
  height: var(--lh);
}

#kasala-stack {
  position: absolute;
  left: 0;                 /* la pile touche le bord gauche */
  top: calc(var(--line-y) - (var(--max) - 1) * var(--lh) - var(--stack-up));
  height: calc(var(--max) * var(--lh));
  overflow: hidden;
}

/* Caractère du flux de droite : texte clair + symbole superposés */
.kch {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  font-family: "Bodoni Moda", Georgia, serif;
  font-weight: 700;
}

.kch .kt {
  text-transform: uppercase;
}

.kch .kg {
  position: absolute;
  left: 0;
  top: 0;
  text-align: center;
  opacity: 0;
  font-family: 'Kiluba', sans-serif;
  font-weight: normal;
}

/* Lignes empilées à gauche */
.kline {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: var(--lh);
  transition: transform .45s ease, opacity .45s ease;
  will-change: transform;
}

.kin {
  position: absolute;
  right: 0;
  top: 0;
  white-space: pre;
  will-change: transform;
}

.kgl {
  display: inline-block;
  font-family: 'Kiluba', sans-serif;
  font-weight: normal;
}


/* --- PANNEAU INFO : portes en verre dépoli --- */
.info-door {
  position: fixed;
  top: 0;
  width: 50vw;
  height: 100vh;
  overflow: hidden;
  z-index: 5000;
  visibility: hidden;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  backdrop-filter: blur(22px) saturate(1.15);
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.18, 1), visibility 0s linear 0.9s;
}

.info-door.left  { left: 0;  width: calc(50vw + 1px); transform: translateX(-100%); }
.info-door.right { right: 0; transform: translateX(100%); }

.info-door.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.9s cubic-bezier(0.77, 0, 0.18, 1), visibility 0s;
}

/* Le contenu fait toute la largeur de l'écran ; la porte de droite le décale de moitié */
.info-layout {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
}

.info-door.right .info-layout {
  left: -50vw;
}

.info-art {
  position: absolute;
  left: 9vw;
  right: 5vw;
  top: 3vh;
  height: 54vh;
}

.info-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.info-text {
  position: absolute;
  left: 14vw;
  width: 74vw;
  top: 58vh;
  font-size: clamp(12px, 1.2vw, 24px);
  line-height: 1;
}

.info-text p {
  margin: 0 0 1.4em;
}


.info-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  text-decoration-thickness: 1px;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.info-text a:hover {
  opacity: 0.55;
}

.info-side {
  position: absolute;
  font-size: clamp(11px, 1vw, 20px);
  writing-mode: vertical-rl;
  transform: rotate(180deg);   /* se lit de bas en haut */
  white-space: nowrap;
}

.info-side-left  { left: 1.2vw;  top: 46vh; }
.info-side-right { right: 1.2vw; top: 6vh; }