body {
  margin: 0;
  overflow: hidden;
  background-color: #050505;
  font-family: "Segoe UI", sans-serif;
  color: white;
  user-select: none;
}

canvas {
  display: block;
}

#vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.9) 100%);
  pointer-events: none;
  z-index: 5;
}

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  padding: 25px;
  font-size: 28px;
  font-weight: 900;
  text-shadow: 2px 2px 0px black;
  font-family: "Courier New", monospace;
}

.xp-bar-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 15px;
  background: #222;
  border-bottom: 2px solid #000;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00bfff, #00ffff);
  width: 0%;
  box-shadow: 0 0 15px #00bfff;
  transition: width 0.2s ease-out;
}

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.menu-content {
  text-align: center;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Logo Principal avec effet Glitch CSS */
.game-logo {
  font-size: 100px;
  font-weight: 900;
  color: #fff;
  margin: 0;
  letter-spacing: 15px;
  position: relative;
  text-shadow: 4px 4px 0px #8a0303;
  animation: textShudder 2s infinite;
}

/* Le sous-titre sanglant */
.game-subtitle {
  font-size: 40px;
  color: #ff0000;
  margin: -10px 0 40px 0;
  letter-spacing: 20px;
  text-transform: uppercase;
  font-weight: 300;
  text-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
  opacity: 0.9;
}

/* Bouton Stylisé */
.btn-menu {
  background: linear-gradient(180deg, #1a1a1a, #000);
  border: 2px solid #444;
  padding: 20px 60px;
  font-size: 28px;
  color: #ccc;
  font-family: "Segoe UI", sans-serif;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Effet Hover sur le bouton */
.btn-menu:hover {
  border-color: #ff0000;
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.4);
  text-shadow: 0 0 10px white;
}

.btn-icon {
  margin-right: 15px;
}

/* Boite de contrôles discrète */
.controls-box {
  margin-top: 30px;
  border-top: 1px solid #333;
  padding-top: 20px;
  color: #666;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.controls-box span {
  color: #aaa;
  border: 1px solid #444;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 0 5px;
}

/* Version en bas à droite */
.version-tag {
  position: absolute;
  bottom: 20px;
  right: 20px;
  color: #333;
  font-family: monospace;
  font-size: 12px;
}

/* Animation de tremblement du texte */
@keyframes textShudder {
  0% {
    transform: translate(0, 0);
    text-shadow: 4px 4px 0px #8a0303;
  }

  95% {
    transform: translate(0, 0);
    text-shadow: 4px 4px 0px #8a0303;
  }

  96% {
    transform: translate(-2px, 2px);
    text-shadow: 2px 2px 0px #ff0000;
  }

  97% {
    transform: translate(2px, -2px);
    text-shadow: -2px 2px 0px #8a0303;
  }

  98% {
    transform: translate(0, 2px);
  }

  100% {
    transform: translate(0, 0);
  }
}

.title-glitch {
  font-size: 80px;
  color: #ff0000;
  text-transform: uppercase;
  letter-spacing: 10px;
  text-shadow: 4px 4px 0px #330000;
  margin-bottom: 10px;
  font-weight: 900;
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0% {
    transform: translate(0);
  }

  98% {
    transform: translate(0);
    opacity: 1;
  }

  99% {
    transform: translate(-5px, 2px);
    opacity: 0.8;
  }

  100% {
    transform: translate(5px, -2px);
    opacity: 1;
  }
}

/* --- CARTES LEVEL UP (SYSTÈME 3D FLIP) --- */
.cards-container {
  display: flex;
  gap: 30px;
  margin-top: 40px;
  perspective: 1000px;
  /* Nécessaire pour l'effet 3D */
}

/* Le conteneur global de la carte (ne bouge pas) */
.card {
  width: 220px;
  height: 320px;
  /* Hauteur fixe nécessaire pour le flip */
  background: transparent;
  cursor: pointer;
  border-radius: 15px;
  position: relative;
  opacity: 0;
  /* Pour l'animation d'entrée */
  animation: cardAppear 0.5s forwards ease-out;
}

@keyframes cardAppear {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* L'élément qui tourne */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Classe ajoutée en JS pour retourner */
.card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* Effet de survol (seulement si pas encore validé) */
.card:hover .card-inner {
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
  transform: scale(1.05) rotateY(0deg);
  /* Si pas flip */
}

.card.flipped:hover .card-inner {
  transform: scale(1.05) rotateY(180deg);
  /* Si flip */
}

/* Les deux faces de la carte */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  box-sizing: border-box;
  border: 3px solid #555;
  /* Bordure par défaut */
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
}

/* FACE CACHÉE (DOS) */
.card-back {
  justify-content: center;
  /* Le dos reste centré */
  color: #555;
  font-size: 80px;
  font-weight: bold;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  background: radial-gradient(circle, #333 0%, #111 100%);
}

/* FACE VISIBLE (CONTENU) - MISE À JOUR ALIGNEMENT */
.card-front {
  transform: rotateY(180deg);
  justify-content: flex-start;
  /* Aligne tout depuis le haut */
  padding-top: 40px;
  /* Espace pour le tag "ARME/PASSIF" */
  gap: 10px;
  /* Espace régulier entre les éléments */
}

/* MISE À JOUR : Titre à hauteur fixe */
.card h3 {
  margin: 0;
  font-size: 20px;
  text-transform: uppercase;
  font-weight: 900;
  height: 60px;
  /* Force une hauteur pour 2 lignes */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  overflow: hidden;
}

/* MISE À JOUR : Description à hauteur fixe */
.card p {
  margin: 0;
  font-size: 13px;
  color: #ccc;
  line-height: 1.3;
  height: 70px;
  /* Force une hauteur fixe */
  width: 100%;
  display: flex;
  align-items: flex-start;
  /* Le texte commence en haut de la zone */
  justify-content: center;
  overflow: hidden;
}

/* MISE À JOUR : Icône à hauteur fixe */
.card .icon {
  font-size: 60px;
  height: 80px;
  /* Force une hauteur fixe */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.card .tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  background: #000;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
  z-index: 2;
}

/* --- RARETÉS (Bordures & Glow sur les DEUX faces) --- */

/* COMMUN */
.card-inner.common .card-front,
.card-inner.common .card-back {
  border-color: #888;
}

/* RARE (Bleu) */
.card-inner.rare .card-front,
.card-inner.rare .card-back {
  border-color: #3498db;
  box-shadow: inset 0 0 20px rgba(52, 152, 219, 0.2);
}

.card-inner.rare .card-back {
  box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
}

/* Glow externe dos */
.card-inner.rare h3 {
  color: #3498db;
}

/* ÉPIQUE (Violet) */
.card-inner.epic .card-front,
.card-inner.epic .card-back {
  border-color: #9b59b6;
  box-shadow: inset 0 0 25px rgba(155, 89, 182, 0.3);
}

.card-inner.epic .card-back {
  box-shadow: 0 0 30px rgba(155, 89, 182, 0.7);
}

.card-inner.epic h3 {
  color: #9b59b6;
}

/* LÉGENDAIRE (Or) */
.card-inner.legendary .card-front,
.card-inner.legendary .card-back {
  border-color: #ffd700;
  background: linear-gradient(145deg, #3a2a00, #101010);
}

.card-inner.legendary .card-back {
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
  animation: legendaryPulse 2s infinite;
}

.card-inner.legendary h3 {
  color: #ffd700;
  text-shadow: 0 0 10px orange;
}

/* HÉROÏQUE (Rouge - V2) */
.card-inner.heroic .card-front,
.card-inner.heroic .card-back {
  border-color: #ff0000;
  background: linear-gradient(145deg, #2a0505, #101010);
}

.card-inner.heroic .card-back {
  box-shadow: 0 0 50px rgba(255, 0, 0, 0.9);
  animation: heroicPulse 1.5s infinite;
}

.card-inner.heroic h3 {
  color: #ff3333;
  text-shadow: 0 0 15px red;
}

/* ULTIMATE (Arc-en-ciel - V3) */
.card-inner.ultimate .card-front,
.card-inner.ultimate .card-back {
  border: 4px solid transparent;
  /* Astuce gradient border */
  background-image: linear-gradient(#1a1a1a, #1a1a1a),
    linear-gradient(90deg,
      #ff0000,
      #ffff00,
      #00ff00,
      #00ffff,
      #0000ff,
      #ff00ff,
      #ff0000);
  background-origin: border-box;
  background-clip: content-box, border-box;
}

.card-inner.ultimate .card-back {
  box-shadow: 0 0 60px rgba(255, 255, 255, 0.4);
  animation: rgbBorder 3s linear infinite;
  /* Le glow tourne */
}

/* Texte Arc-en-ciel */
.card-inner.ultimate h3 {
  background: linear-gradient(90deg,
      #ff0000,
      #ffff00,
      #00ff00,
      #00ffff,
      #0000ff,
      #ff00ff,
      #ff0000);
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rgbText 3s linear infinite;
}

/* RECOVERY (Vital - Vert) */
.card-inner.recovery .card-back {
  background: linear-gradient(135deg, #001a00, #003300);
  border: 2px solid #00ff00;
  box-shadow: 0 0 10px #00ff00;
  color: #00ff00;
}

.card-inner.recovery .card-front {
  background: linear-gradient(135deg, #111, #002200);
  border: 2px solid #00ff00;
  box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.3);
}

.card-inner.recovery h3 {
  color: #00ff00;
  text-shadow: 0 0 5px #006600;
}

.card-inner.recovery .tag {
  background: #00ff00;
  color: #000;
  font-weight: bold;
}

.card-inner.recovery p {
  color: #ccffcc;
}

/* Animations Glow */
@keyframes legendaryPulse {
  50% {
    box-shadow: 0 0 60px rgba(255, 200, 0, 1);
    border-color: #ffaa00;
  }
}

@keyframes heroicPulse {
  50% {
    box-shadow: 0 0 70px rgba(255, 50, 50, 1);
    border-color: #ff4444;
  }
}

@keyframes rgbBorder {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}

@keyframes rgbText {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

/* INVENTAIRE */
#inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
  width: 500px;
  max-height: 400px;
  overflow-y: auto;
}

.inv-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #444;
  padding: 10px 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inv-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.inv-icon {
  font-size: 24px;
}

.inv-name {
  font-size: 16px;
  color: #eee;
  font-weight: bold;
}

.inv-lvl {
  color: #ffd700;
  font-family: monospace;
  font-size: 18px;
  text-shadow: 0 0 5px orange;
}

/* BOUTONS */
button.btn-primary {
  padding: 20px 60px;
  font-size: 24px;
  background: transparent;
  color: #fff;
  border: 3px solid #fff;
  cursor: pointer;
  font-weight: bold;
  margin-top: 20px;
  text-transform: uppercase;
  transition: 0.3s;
  letter-spacing: 2px;
}

button.btn-primary:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 0 20px white;
}

.controls-hint {
  margin-top: 30px;
  color: #666;
  font-size: 14px;
}

.card.heroic {
  border-color: #ff0000;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
  background: linear-gradient(145deg, #2a0505, #101010);
  animation: cardReveal 0.5s forwards ease-out,
    heroicPulse 2s infinite ease-in-out;
}

.card.heroic h3 {
  color: #ff3333;
  text-shadow: 0 0 10px #800000;
  font-size: 24px;
}

.card.heroic .icon {
  filter: drop-shadow(0 0 10px red);
}

@keyframes heroicPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
  }

  50% {
    transform: scale(1.03);
    box-shadow: 0 0 50px rgba(255, 50, 50, 0.9);
    border-color: #ff4444;
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
  }
}

/* ULTIMATE (Arc-en-ciel) - Pour le passage V3 */
.card.ultimate {
  /* Astuce pour bordure gradient arrondie */
  border: 4px solid transparent;
  background-image: linear-gradient(#1a1a1a, #1a1a1a),
    linear-gradient(90deg,
      #ff0000,
      #ffff00,
      #00ff00,
      #00ffff,
      #0000ff,
      #ff00ff,
      #ff0000);
  background-origin: border-box;
  background-clip: content-box, border-box;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
  animation: cardReveal 0.5s forwards ease-out, rgbBorder 3s linear infinite;
}

.card.ultimate h3 {
  background: linear-gradient(90deg,
      #ff0000,
      #ffff00,
      #00ff00,
      #00ffff,
      #0000ff,
      #ff00ff,
      #ff0000);
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
  font-size: 26px;
  animation: rgbText 3s linear infinite;
  text-shadow: none !important;
}

.card.ultimate .icon {
  animation: rgbIcon 3s linear infinite;
}

@keyframes rgbBorder {
  0% {
    filter: hue-rotate(0deg);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
  }

  50% {
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
  }

  100% {
    filter: hue-rotate(360deg);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
  }
}

@keyframes rgbText {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

@keyframes rgbIcon {
  0% {
    filter: drop-shadow(0 0 10px red);
  }

  33% {
    filter: drop-shadow(0 0 10px lime);
  }

  66% {
    filter: drop-shadow(0 0 10px blue);
  }

  100% {
    filter: drop-shadow(0 0 10px red);
  }
}

/* TEXTE ARC-EN-CIEL (Pour l'inventaire) */
.rainbow-text {
  background: linear-gradient(90deg,
      #ff0000,
      #ffff00,
      #00ff00,
      #00ffff,
      #0000ff,
      #ff00ff);
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: bold;
  animation: rgbText 3s linear infinite;
}

.pause-title {
  font-size: 60px;
  margin: 0 0 20px 0;
  letter-spacing: 10px;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.pause-container {
  display: flex;
  gap: 40px;
  width: 800px;
  height: 500px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #444;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* GAUCHE : PERSO */
.pause-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 2px solid #333;
  padding-right: 20px;
}

.char-preview-box {
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, #333 0%, #000 100%);
  border: 3px solid #ffd700;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.stats-list {
  width: 100%;
  font-family: "Courier New", monospace;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #333;
  font-size: 18px;
  color: #ccc;
}

.stat-val {
  color: #ffd700;
  font-weight: bold;
}

/* DROITE : INVENTAIRE */
.pause-right {
  flex: 2;
  display: flex;
  flex-direction: column;
}

.pause-right h2 {
  margin-top: 0;
  border-bottom: 2px solid #fff;
  padding-bottom: 10px;
  color: #aaa;
  letter-spacing: 3px;
}

#inventory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* 2 colonnes */
  gap: 10px;
  overflow-y: auto;
  padding-right: 10px;
  max-height: 400px;
}

/* Scrollbar custom pour l'inventaire */
#inventory-grid::-webkit-scrollbar {
  width: 8px;
}

#inventory-grid::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}

/* Item Inventaire (Repris et adapté) */
.inv-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #444;
  padding: 8px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: 0.2s;
}

.inv-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pause-buttons {
  margin-top: 30px;
  display: flex;
  gap: 20px;
}

.sub-btn {
  border-color: #666 !important;
  color: #aaa !important;
  font-size: 18px !important;
  padding: 20px 40px !important;
}

.sub-btn:hover {
  background: #333 !important;
  color: #fff !important;
}

/* --- GAME OVER REPORT --- */
.report-card {
  background: rgba(20, 20, 20, 0.9);
  border: 2px solid #444;
  border-radius: 15px;
  padding: 30px;
  width: 400px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.report-row {
  display: flex;
  justify-content: space-between;
  font-size: 24px;
  font-family: "Courier New", monospace;
  font-weight: bold;
  margin-bottom: 15px;
  border-bottom: 1px dashed #333;
  padding-bottom: 5px;
}

.end-weapons-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.end-weapon-slot {
  width: 50px;
  height: 50px;
  background: #111;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  position: relative;
  border: 2px solid #444;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Bordures spéciales pour le rapport de fin */
.end-weapon-slot.v2 {
  border-color: #ff0000;
  box-shadow: 0 0 10px red;
}

.end-weapon-slot.v3 {
  border-color: transparent;
  background-image: linear-gradient(#111, #111),
    linear-gradient(90deg, red, yellow, lime, blue, magenta);
  background-origin: border-box;
  background-clip: content-box, border-box;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.end-lvl-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: #000;
  color: #fff;
  font-size: 10px;
  padding: 2px 4px;
  border-radius: 4px;
  font-weight: bold;
}

.card-inner.recovery .card-back {
  background: linear-gradient(135deg, #001a00, #003300);
  border: 2px solid #00ff00;
  box-shadow: 0 0 10px #00ff00;
  color: #00ff00;
}

.card-inner.recovery .card-front {
  background: linear-gradient(135deg, #111, #002200);
  border: 2px solid #00ff00;
  box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.3);
}

.card-inner.recovery h3 {
  color: #00ff00;
  text-shadow: 0 0 5px #006600;
}

.card-inner.recovery .tag {
  background: #00ff00;
  color: #000;
  font-weight: bold;
}

.card-inner.recovery p {
  color: #ccffcc;
}

/* --- MODALE SUCCÈS --- */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* 2 colonnes */
  gap: 15px;
  max-height: 60vh;
  /* Hauteur max avec scroll */
  overflow-y: auto;
  width: 800px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  border: 1px solid #333;
}

/* Scrollbar custom pour la liste */
.achievements-grid::-webkit-scrollbar {
  width: 8px;
}

.achievements-grid::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.ach-card {
  display: flex;
  align-items: center;
  background: #111;
  border: 1px solid #333;
  padding: 15px;
  border-radius: 8px;
  transition: 0.3s;
  opacity: 0.5;
  /* Grisé par défaut (verrouillé) */
  filter: grayscale(100%);
}

.ach-card.unlocked {
  opacity: 1;
  filter: grayscale(0%);
  border-color: #ffd700;
  background: linear-gradient(135deg, #222, #1a1a00);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.ach-card-icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-right: 20px;
  border-radius: 6px;
  border: 1px solid #444;
}

.ach-card.unlocked .ach-card-icon img {
  border-color: #ffd700;
}

.ach-card-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ach-card-title {
  font-size: 18px;
  font-weight: bold;
  color: #888;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.ach-card.unlocked .ach-card-title {
  color: #ffd700;
  text-shadow: 0 0 5px orange;
}

.ach-card-desc {
  font-size: 14px;
  color: #555;
}

.ach-card.unlocked .ach-card-desc {
  color: #ccc;
}

/* ===================================================== */
/* === HUD ARMES ACTIVES ================================ */
/* ===================================================== */

#active-weapons-hud {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  pointer-events: none;
  z-index: 100;
}

/* SLOT */
.hud-slot {
  width: 56px;
  height: 56px;
  background: #111;
  border: 2px solid #444;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  transition: border-color 0.2s, transform 0.15s;
}

/* ICON */
.hud-icon {
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================= COOLDOWN ================= */

/* Icône assombrie quand recharge */
.hud-slot.on-cooldown .hud-icon {
  filter: grayscale(100%) brightness(35%);
}

/* Camembert */
.hud-cooldown {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;

  /* IMPORTANT : syntaxe correcte */
  background: conic-gradient(rgba(0, 0, 0, 0.85) calc(100% - var(--cd-pct)),
      transparent 0);
}

/* Texte du temps restant */
.hud-timer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
  z-index: 3;
  pointer-events: none;
}

/* ================= PRÊT ================= */

.hud-slot.ready {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
  transform: scale(1.06);
}

.hud-slot.ready .hud-cooldown,
.hud-slot.ready .hud-timer {
  display: none;
}


/* --- RARETÉ INTERDITE (FORBIDDEN) --- */
.card-inner.forbidden .card-front,
.card-inner.forbidden .card-back {
  border: 2px solid #000;
  background: repeating-linear-gradient(
    45deg,
    #000,
    #000 10px,
    #1a0000 10px,
    #1a0000 20px
  );
  box-shadow: 0 0 20px rgba(0,0,0,1), inset 0 0 50px #300;
}

.card-inner.forbidden h3 {
    color: #ff0000;
    text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000;
    font-family: 'Courier New', monospace; /* Police technique pour le glitch */
    letter-spacing: 5px;
}

.card-inner.forbidden .card-back {
  animation: forbiddenBackPulse 0.2s infinite;
}

.card-inner.forbidden .card-front {
  animation: forbiddenFrontPulse 0.2s infinite;
}

@keyframes forbiddenBackPulse {
  0%   { transform: translate(0,0); border-color:#500; }
  25%  { transform: translate(1px,1px); border-color:#f00; }
  50%  { transform: translate(-1px,-1px); border-color:#000; }
  75%  { transform: translate(1px,-1px); border-color:#f00; }
  100% { transform: translate(0,0); border-color:#500; }
}

/* Le recto DOIT garder rotateY(180deg) sinon il s'affiche direct */
@keyframes forbiddenFrontPulse {
  0%   { transform: rotateY(180deg) translate(0,0); border-color:#500; }
  25%  { transform: rotateY(180deg) translate(1px,1px); border-color:#f00; }
  50%  { transform: rotateY(180deg) translate(-1px,-1px); border-color:#000; }
  75%  { transform: rotateY(180deg) translate(1px,-1px); border-color:#f00; }
  100% { transform: rotateY(180deg) translate(0,0); border-color:#500; }
}
/* CLASSE POUR LES RUNES ILLISIBLES */
.rune-text {
    font-family: 'Courier New', monospace;
    filter: blur(0.8px); /* Un peu flou */
    color: #ff0000 !important;
    text-shadow: 0 0 5px red;
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: glitchText 0.2s infinite; /* Ça tremble */
}

@keyframes glitchText {
    0% { opacity: 1; transform: skewX(0deg); }
    20% { opacity: 0.8; transform: skewX(-10deg); }
    40% { opacity: 1; transform: skewX(10deg); }
    60% { opacity: 0.9; transform: skewX(-5deg); }
    80% { opacity: 1; transform: skewX(5deg); }
    100% { opacity: 1; transform: skewX(0deg); }
}

/* --- ECRAN TITRE (Mis à jour pour images) --- */
#main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Espace entre le titre et les boutons */
    gap: 50px; 
    z-index: 100;
    color: white;
    font-family: sans-serif;
}

/* STYLE DU TITRE (IMAGE) */
.menu-title-img {
    /* Largeur de base, ajuste selon la taille réelle de ton image */
    width: 600px; 
    /* S'assure que ça ne dépasse pas sur petits écrans */
    max-width: 90%; 
    height: auto; /* Garde les proportions */
    /* Ajoute une ombre portée pour faire ressortir l'image du fond */
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8));
    /* Petite animation d'entrée */
    animation: titleFloat 3s ease-in-out infinite alternate;
}

@keyframes titleFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-15px); }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 25px; /* Espace entre les boutons images */
    align-items: center;
}

/* STYLE DES BOUTONS (IMAGES) */
.menu-btn-img {
    /* Taille des boutons, ajuste selon tes images */
    width: 250px;
    height: auto;
    cursor: pointer; /* Curseur main au survol */
    transition: all 0.2s ease; /* Transition fluide pour le hover */
    /* Ombre légère de base */
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.5));
}

/* EFFET AU SURVOL DES BOUTONS IMAGES */
.menu-btn-img:hover {
    /* Agrandit légèrement */
    transform: scale(1.08);
    /* Éclaircit l'image et renforce l'ombre */
    filter: brightness(1.2) drop-shadow(0 10px 15px rgba(0,0,0,0.8));
}

/* EFFET AU CLIC */
.menu-btn-img:active {
    transform: scale(0.98);
    filter: brightness(0.9);
}

