* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

html, body {
  width: 100%;
  height: 100%;
  background: #0d0d1f;
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #fff;
}

#jeu {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(100vw, 177.78vh);
  height: min(56.25vw, 100vh);
  background: #1a1a40;
}

.ecran {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
  background: rgba(13, 13, 31, 0.92);
  z-index: 10;
  overflow-y: auto;
}

.cache {
  display: none !important;
}

h1 { font-size: clamp(28px, 6vw, 52px); }
h2 { font-size: clamp(22px, 5vw, 36px); }

.ecran p {
  max-width: 640px;
  font-size: clamp(15px, 2.6vw, 19px);
  line-height: 1.5;
}

.gros-bouton {
  font-size: clamp(18px, 3.4vw, 24px);
  padding: 14px 38px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.45);
}

.gros-bouton:active { transform: scale(0.96); }

#liste-heros {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  max-width: 900px;
}

.carte-heros {
  width: 180px;
  padding: 18px 12px;
  border: 3px solid #fff;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 15px;
}

.carte-heros:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.14); }

.carte-heros.tombe {
  opacity: 0.35;
  filter: grayscale(1);
  cursor: not-allowed;
}

.carte-heros.tombe:active { transform: none; background: rgba(255, 255, 255, 0.06); }

.badge-tombe {
  font-size: 15px;
  font-weight: bold;
  color: #ff5252;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.icone-heros {
  width: 64px;
  height: 85px;
}

.avertissement {
  color: #ffd23f;
  max-width: 680px;
  font-size: clamp(14px, 2.6vw, 18px) !important;
  line-height: 1.6;
}

.pastille {
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.phrase {
  font-size: 12px;
  font-weight: normal;
  opacity: 0.85;
}

.texte-recompense {
  font-size: clamp(18px, 3.6vw, 26px) !important;
  font-weight: bold;
  color: #ffd23f;
}

#liste-mesures {
  list-style: none;
  text-align: left;
  max-width: 620px;
  font-size: clamp(14px, 2.4vw, 18px);
  line-height: 1.8;
}

#liste-mesures li::before { content: '✅ '; }

.intro-texte {
  max-width: 720px;
  font-size: clamp(17px, 3.2vw, 23px) !important;
  line-height: 1.7;
}

.aide-liste {
  list-style: none;
  text-align: left;
  font-size: clamp(16px, 3vw, 20px);
  line-height: 2;
}

.stats-contenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 560px;
}

.stats-bloc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 480px;
}

.stat-ligne {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(14px, 2.6vw, 17px);
}

.stat-label {
  width: 110px;
  text-align: left;
  flex-shrink: 0;
}

.barres {
  display: flex;
  gap: 4px;
  flex: 1;
}

.barre {
  width: 22px;
  height: 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.barre.rempli.c1 { background: #e74c3c; }
.barre.rempli.c2 { background: #e67e22; }
.barre.rempli.c3 { background: #f1c40f; }
.barre.rempli.c4 { background: #82e0aa; }
.barre.rempli.c5 { background: #1e8449; }

.stat-ligne b {
  min-width: 90px;
  text-align: right;
}

.stats-pouvoir {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: clamp(14px, 2.6vw, 17px) !important;
  line-height: 1.6;
}

.micros {
  font-size: 46px;
  letter-spacing: -10px;
}

.micros span {
  display: inline-block;
}

.micros span:first-child { transform: rotate(-45deg); }
.micros span:last-child { transform: rotate(45deg); }

#vs-texte {
  max-width: 800px;
}

.choix-niveau-label {
  font-weight: bold;
  margin-bottom: -6px;
}

.choix-niveau {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.bouton-niveau {
  font-size: clamp(15px, 3vw, 20px) !important;
  padding: 12px 24px !important;
}

.niv-facile { background: linear-gradient(135deg, #27ae60, #1e8449); box-shadow: 0 6px 18px rgba(39, 174, 96, 0.45); }
.niv-moyen { background: linear-gradient(135deg, #e67e22, #ca6f1e); box-shadow: 0 6px 18px rgba(230, 126, 34, 0.45); }
.niv-dur { background: linear-gradient(135deg, #e74c3c, #c0392b); box-shadow: 0 6px 18px rgba(231, 76, 60, 0.45); }

@media (max-height: 560px) {
  .ecran {
    gap: 8px;
    padding: 10px;
    justify-content: flex-start;
    overflow-y: auto;
  }

  .ecran h2 { font-size: 22px; }
  .ecran p { font-size: 14px !important; }

  .stats-contenu { gap: 8px; }
  .stats-contenu .icone-heros { width: 56px !important; height: 75px !important; }
  .stats-bloc { gap: 5px; }
  .stat-ligne { font-size: 13px; }
  .stat-label { width: 92px; }
  .barre { width: 16px; height: 10px; }
  .stats-pouvoir { padding: 8px 12px; font-size: 13px !important; }
  .gros-bouton { padding: 10px 22px !important; font-size: 16px !important; }
  .bouton-plein-ecran { padding: 8px 14px; font-size: 13px; }
  .intro-texte { font-size: 15px !important; }
  .aide-liste { font-size: 14px; line-height: 1.6; }
}

.bouton-musique {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 200;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(13, 13, 31, 0.75);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.bouton-speciale {
  width: 64px;
  height: 64px;
  font-size: 26px;
}

.bouton-plein-ecran {
  font-size: 15px;
  padding: 10px 22px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.bouton-plein-ecran:active { background: rgba(255, 255, 255, 0.2); }

.astuce {
  font-size: 13px;
  opacity: 0.7;
}

#controles {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 5;
  pointer-events: none;
}

.groupe {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.groupe-gauche {
  align-items: flex-end;
  padding-bottom: 10px;
}

.groupe-triangle {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ligne-bas {
  display: flex;
  gap: 12px;
}

.bouton {
  width: 68px;
  height: 68px;
  font-size: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}

.bouton:active { background: rgba(255, 255, 255, 0.35); }

.niveau-choisi {
  font-weight: bold;
  font-size: clamp(14px, 2.8vw, 18px) !important;
  margin: 0;
}

.indice-melenchon {
  font-size: clamp(12px, 2.4vw, 15px) !important;
  color: #ffd23f;
  margin: 0;
}

.bosses-vaincus {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.icone-boss {
  width: 44px;
  height: 59px;
  border-radius: 8px;
  border: 2px solid #ffd23f;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.boss-nom {
  min-height: 20px;
  font-weight: bold;
  color: #ffd23f;
  margin: 0;
}

.carte-heros.verrouille {
  opacity: 0.9;
  filter: none;
  border-style: dashed;
  cursor: not-allowed;
}

.carte-heros.verrouille .badge-tombe {
  color: #ffd23f;
}

@media (max-width: 560px) {
  .carte-heros { width: 150px; padding: 12px 8px; }
}

@keyframes zoomPan1 {
  from { background-size: 125% auto; background-position: 0% 50%; }
  to   { background-size: 138% auto; background-position: 100% 50%; }
}

@keyframes zoomPan2 {
  from { background-size: 155% auto; background-position: 100% 50%; }
  to   { background-size: 175% auto; background-position: 0% 50%; }
}

#ecran-intro1 {
  background: linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.38)), url('assets/intro/paysage-dystopique.png') center/cover no-repeat;
  animation: zoomPan1 45s ease-in-out infinite alternate;
}

#ecran-intro2 {
  background: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.65)), url('assets/intro/grok.jpg') center/cover no-repeat;
  animation: zoomPan2 30s ease-in-out infinite alternate;
}

#ecran-intro2 p {
  background: rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  padding: 12px 16px;
}

#ecran-victoire {
  justify-content: flex-start;
  overflow-y: auto;
}

#liste-mesures {
  max-height: 45vh;
  overflow-y: auto;
  text-align: left;
  padding-right: 10px;
}

.ecran {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

#liste-mesures {
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.ecran-sombre {
  background: radial-gradient(ellipse at center, #1a0b2e 0%, #000 80%);
}

#texte-fantome {
  min-height: 120px;
  font-size: clamp(20px, 5vw, 32px) !important;
  font-weight: bold;
  color: #d7b8ff;
}

#ecran-victoire {
  display: block;
}

@keyframes voleFantome {
  0%   { transform: translate(-50%, 60px) scale(0.7); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translate(340px, -460px) scale(1.3) rotate(15deg); opacity: 1; }
}

#ghost-fly {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: 140px;
  z-index: 0;
  animation: voleFantome 2.2s ease-in forwards;
  pointer-events: none;
}
