#key-message {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #222;
  color: #ffd700;
  padding: 20px 40px;
  border-radius: 15px;
  font-size: 22px;
  font-weight: bold;
  z-index: 20;
  box-shadow: 0 8px 32px #000a;
  text-align: center;
}

/* Barre commune (css/games.css) aux couleurs du labyrinthe */
.lb-jeu {
  --mg-jeu-largeur: 1204px; /* barre de 1180 px + marges de 12 px */
  --mgb-fond: radial-gradient(120% 160% at 0% 0%, rgba(255, 215, 0, 0.18), transparent 55%),
    linear-gradient(120deg, #0d0d1a, #1a1a2e);
  --mgb-accent: #ffd700;
  --mgb-titre: linear-gradient(100deg, #ffd700, #ffffff);
  --mg-fs-fond: #000;
  --mg-bulle-fond: #1a1a2e;
}

/* Plein écran : le labyrinthe occupe la place sous la barre */
.lb-jeu.mg-fs #container {
  flex: 1;
  align-self: stretch;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  border-radius: 12px;
}

#container {
  position: relative;
  /* Même largeur que la barre ; hauteur posée par game.js (place disponible, sans défilement) */
  box-sizing: border-box;
  align-self: center;
  width: min(var(--mg-barre-largeur, 1180px), calc(100vw - 24px));
  height: 700px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #2e3133;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  padding: 30px;
}

#minimap-canvas {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 5;
  cursor: pointer;
  border-radius: 6px;
  transition: box-shadow 0.2s;
}

#minimap-canvas:hover {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

#canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #1a1a2e;
  color: white;
  padding: 30px 35px;
  border-radius: 16px;
  max-width: 420px;
  width: calc(100% - 40px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-box h3 {
  margin-top: 0;
  color: #ffd700;
}

.modal-box ul {
  padding-left: 20px;
  line-height: 1.8;
}

.modal-box button {
  margin-top: 16px;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #ffd700;
  color: #1a1a2e;
  font-weight: bold;
  cursor: pointer;
}

/* Déclarée après .modal-box (même spécificité) pour que ces règles la
   remplacent bien, au lieu d'être écrasées par celles de .modal-box. */
.map-modal-box {
  text-align: center;
  width: fit-content; /* épouse la taille réelle de la carte, pas 100% */
  max-width: 95vw;
  padding: 16px;
}

#full-map-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px auto 12px;
  border-radius: 4px;
}

#victory {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px 60px;
  border-radius: 20px;
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s ease;
  z-index: 10;
}

#victory.show {
  transform: translate(-50%, -50%) scale(1);
}

#victory button {
  margin-top: 20px;
  padding: 12px 30px;
  font-size: 16px;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.2s;
}

#victory button:hover {
  transform: scale(1.05);
}
