/* ================================================================
   Murder Board — board.css
   ================================================================ */
:root {
  --mb-dark: #0b1622;
  --mb-paper: #f5f0e8;
  --mb-yellow: #fde74c;
  --mb-green: #2d6a4f;
  --mb-green-lt: #d8f3dc;
  --mb-accent: #c0392b;
  --mb-ink: #1a1a1a;
  --mb-font: 'Special Elite', 'Courier New', serif;
}

/* ── Masquer le texte injecté par le thème CTFd ─────────────── */
#challenges-container,
.challenge-container,
.jumbotron h3 {
  /* certains thèmes affichent le nom de la page */
  display: none !important;
}

.mb-wrapper {
  width: 100%;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6.5rem 20px 24px 20px;
  overflow: hidden;
  background: #050a0f;
  box-sizing: border-box;
}

.mb-wrapper::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/plugins/murder_board/assets/img/BG_mur.png') center/cover no-repeat;
  filter: brightness(0.5) grayscale(0.7);
  pointer-events: none;
  z-index: 0;
}

.mb-outer {
  width: 100%;
  max-width: 1600px;
  position: relative;
  z-index: 1;
}

.mb-stage {
  position: relative;
  width: 100%;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 0 6px #6b3a1f, 0 0 0 10px #4a2810, 0 14px 55px rgba(0, 0, 0, .75);
  /* Curseur par défaut sur le stage — le JS le change en pointer sur hover opaque */
  cursor: default;
}

/* bg.png : définit la hauteur du stage */
.mb-bg {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  pointer-events: none;
  user-select: none;
}

/* Tous les calques empilés */
.mb-layer {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  /* pointer-events: none — le clic est géré par délégation JS avec hit-test alpha */
  pointer-events: none;
  user-select: none;
  transition: filter .18s ease, transform .22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mb-layer[data-state="postit"],
.mb-layer[data-state="resolved"] {
  z-index: 2;
}

/* Caméras au-dessus de tout pour rester cliquables */
.mb-layer[data-state="camera"] {
  z-index: 3;
}

/* Fils rouges au-dessus des persos mais sous les reveals finaux */
.mb-liens {
  z-index: 5;
}

/* Éléments finaux (ID 27) au-dessus de TOUT, même des fils rouges */
[data-ctfd-id="27"].mb-layer {
  z-index: 10 !important;
}

/* Curseur pointer quand on survole un pixel opaque — géré par JS */
.mb-stage.hovering {
  cursor: pointer;
}

/* Effet hover marqué : rebond et éclaircissement */
.mb-layer.hovered {
  filter: brightness(1.2) drop-shadow(0 0 15px rgba(255, 255, 255, .4));
}

@keyframes mb-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
    transform-origin: center center;
  }

  100% {
    transform: scale(1);
  }
}

.mb-pulse {
  animation: mb-pulse 5s infinite ease-in-out;
}

/* ================================================================
   MODALE
   ================================================================ */
.mb-modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 30, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mb-modal-bg.open {
  display: flex;
}

@keyframes mb-modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.97);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.mb-modal {
  background: var(--mb-paper);
  background-image: repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(0, 0, 0, .06) 27px, rgba(0, 0, 0, .06) 28px);
  border-radius: 3px;
  padding: 36px 32px 28px;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .12), inset 0 0 0 1px rgba(255, 255, 255, .5);
  animation: mb-modal-in .22s cubic-bezier(.34, 1.56, .64, 1) both;
}

.mb-modal::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 48px;
  width: 2px;
  background: rgba(192, 57, 43, .28);
}

.mb-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: color .15s, background .15s;
}

.mb-modal-close:hover {
  color: #000;
  background: rgba(0, 0, 0, .07);
}

.mb-modal-cat {
  font-family: var(--mb-font);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #888;
}

.mb-modal-title {
  font-family: var(--mb-font);
  font-size: clamp(20px, 3vw, 30px);
  color: var(--mb-ink);
  margin: 4px 0 10px;
  line-height: 1.15;
}

.mb-modal-pts {
  display: inline-block;
  background: var(--mb-yellow);
  padding: 2px 12px;
  border-radius: 2px;
  font-family: var(--mb-font);
  font-size: 14px;
  color: #333;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, .2);
  margin-bottom: 18px;
}

.mb-modal-desc {
  font-family: var(--mb-font);
  font-size: clamp(14px, 1.7vw, 17px);
  line-height: 1.6;
  color: #2c2c2c;
  border-top: 1px dashed #bbb;
  padding-top: 14px;
  margin-bottom: 18px;
  min-height: 40px;
}

.mb-solved-banner {
  display: none;
  background: var(--mb-green);
  color: var(--mb-green-lt);
  text-align: center;
  padding: 12px 16px;
  border-radius: 3px;
  font-family: var(--mb-font);
  font-size: 20px;
  letter-spacing: .12em;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .2);
}

.mb-solved-banner.visible {
  display: block;
}

.mb-submit-zone {
  display: flex;
  gap: 8px;
}

.mb-flag-input {
  flex: 1;
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  border: 2px solid #ccc;
  border-radius: 2px;
  background: white;
  outline: none;
  color: var(--mb-ink);
  transition: border-color .2s;
}

.mb-flag-input:focus {
  border-color: var(--mb-accent);
  box-shadow: 0 0 0 3px rgba(192, 57, 43, .12);
}

.mb-submit-btn {
  padding: 10px 22px;
  background: var(--mb-accent);
  color: white;
  border: none;
  border-radius: 2px;
  font-family: var(--mb-font);
  font-size: 15px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}

.mb-submit-btn:hover:not(:disabled) {
  background: #a93226;
}

.mb-submit-btn:disabled {
  background: #aaa;
  cursor: default;
}

.mb-feedback {
  margin-top: 10px;
  font-family: var(--mb-font);
  font-size: 14px;
  text-align: center;
  min-height: 22px;
  letter-spacing: .04em;
}

.mb-feedback.correct {
  color: var(--mb-green);
}

.mb-feedback.incorrect {
  color: var(--mb-accent);
}

.mb-feedback.ratelimit {
  color: #e67e22;
}

.mb-feedback.error {
  color: #e67e22;
  font-size: 11px;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .mb-wrapper {
    padding: 8px;
  }

  .mb-modal {
    padding: 28px 20px 22px;
  }

  .mb-submit-zone {
    flex-direction: column;
  }

  .mb-submit-btn {
    width: 100%;
  }
}

/* ================================================================
   MODALE SLIDES
   ================================================================ */
.mb-slides-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  /* Fond très sombre pour focus sur l'image */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.mb-slides-bg.open {
  display: flex;
}

.mb-slides-modal {
  background: transparent;
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: mb-modal-in .22s cubic-bezier(.34, 1.56, .64, 1) both;
}

.mb-slides-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  transition: color .15s;
  z-index: 1000;
}

.mb-slides-close:hover {
  color: var(--mb-accent);
}