/* Lecteur de la BD dans le jeu : mêmes couleurs, polices et cadres que le film « La Brigade augmentée ». */
@font-face {
  font-family: "Bangers";
  src: url("../bd/polices/bangers-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Bangers";
  src: url("../bd/polices/bangers-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-024F;
  font-display: swap;
}
@font-face {
  font-family: "Comic Neue";
  font-weight: 700;
  src: url("../bd/polices/comic-neue-latin-700-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Comic Neue";
  font-weight: 400;
  src: url("../bd/polices/comic-neue-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
#bd {
  --navy: #0b2545;
  --yellow: #ffd640;
  --orange: #f59b0a;
  --cream: #fff6dc;
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow: hidden;
  background: var(--navy);
  color: var(--navy);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
#bd[hidden] {
  display: none;
}
#bd .bd-fond {
  position: absolute;
  inset: -60px;
  background: center / cover no-repeat;
  filter: blur(36px) brightness(0.5);
}
/* La case garde ses proportions (2:3) : entière sur téléphone en portrait, centrée et cadrée en paysage. */
#bd .bd-case {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
#bd .bd-case img {
  height: 100%;
  width: 100%;
  max-width: calc(100dvh * 2 / 3);
  object-fit: cover;
  box-shadow: 0 0 60px #0008;
}
#bd .bd-case.anime img {
  animation: bd-ken-burns 9s ease-out both;
}
@keyframes bd-ken-burns {
  from {
    opacity: 0.2;
    transform: scale(1.02) translateX(calc(var(--sens, 1) * -1.5%));
  }
  12% {
    opacity: 1;
  }
  to {
    transform: scale(1.1) translateX(calc(var(--sens, 1) * 1.5%));
  }
}
#bd .bd-texte {
  position: absolute;
  left: 50%;
  bottom: max(86px, calc(env(safe-area-inset-bottom) + 86px));
  transform: translateX(-50%);
  width: min(620px, calc(100vw - 32px));
}
#bd .bd-cartouche,
#bd .bd-bulle,
#bd .bd-titre {
  animation: bd-entree 0.35s ease-out both;
}
#bd .bd-cartouche {
  background: var(--cream);
  border: 3px solid var(--navy);
  border-radius: 10px;
  padding: 12px 16px;
  font: 700 clamp(16px, 2.4vw, 22px) / 1.3 "Comic Neue", system-ui, sans-serif;
  box-shadow: 0 6px 0 #0004;
}
#bd .bd-bulle {
  background: white;
  border: 3px solid var(--navy);
  border-radius: 26px;
  padding: 12px 18px 16px;
  font: 700 clamp(17px, 2.6vw, 24px) / 1.3 "Comic Neue", system-ui, sans-serif;
  box-shadow: 0 6px 0 #0004;
}
#bd .bd-titre {
  background: var(--navy);
  border: 4px solid var(--yellow);
  border-radius: 18px;
  padding: 14px 18px;
  color: var(--yellow);
  font: clamp(24px, 4.4vw, 40px) / 1.05 "Bangers", system-ui, sans-serif;
  letter-spacing: 1px;
}
#bd .bd-qui {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
#bd .bd-qui img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--navy);
  object-fit: cover;
  background: var(--navy);
}
#bd .bd-qui span {
  color: var(--orange);
  font-size: 0.8em;
  letter-spacing: 1px;
}
#bd p {
  margin: 0;
}
#bd p span {
  animation: bd-mot 0.25s ease-out both;
}
@keyframes bd-mot {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
@keyframes bd-entree {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
#bd .bd-haut {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  background: linear-gradient(#0b2545e6, #0b254500);
}
#bd .bd-progres {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 4px;
  background: #ffffff33;
  overflow: hidden;
}
#bd .bd-progres i {
  display: block;
  height: 100%;
  background: var(--yellow);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.3s;
}
#bd .bd-chapitre {
  color: var(--yellow);
  font: clamp(16px, 2.6vw, 22px) "Bangers", system-ui, sans-serif;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#bd button {
  min-width: 48px;
  min-height: 48px;
  border-radius: 24px;
  border: 2px solid #ffffff66;
  background: #0b2545cc;
  color: white;
  font-size: 18px;
  cursor: pointer;
}
#bd .bd-bas {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 14px;
}
#bd.en-pause .bd-case img {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  #bd .bd-case.anime img,
  #bd p span,
  #bd .bd-cartouche,
  #bd .bd-bulle,
  #bd .bd-titre {
    animation: none;
  }
}

/* Liste des chapitres dans le menu du jeu. */
.chapitres {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.chapitres button {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 8px 12px 8px 8px;
  min-height: 72px;
}
.chapitres img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}
.chapitres small {
  display: block;
  opacity: 0.8;
}
.chapitres button:disabled img {
  filter: grayscale(1) brightness(0.5);
}
