:root {
  --fond: #101810;
  --carte: #1d2a1e;
  --fond-secondaire: #172318;
  --fond-sombre: #0b100b;
  --vert: #3fa34d;
  --vert-clair: #7ee787;
  --or: #ffd166;
  --texte: #f4f4f4;
  --gris: #b8c2b8;
  --bordure: #315535;
}

/* Réinitialisation générale */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-width: 320px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: var(--fond);
  color: var(--texte);
}

/* En-tête */

.hero-redstone {
  position: relative;
  min-height: 420px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 40px 20px;
  text-align: center;

  background:
    linear-gradient(
      rgba(0, 0, 0, 0.55),
      rgba(0, 0, 0, 0.7)
    ),
    url("https://images.unsplash.com/photo-1500534623283-312aade485b7?auto=format&fit=crop&w=1800&q=80")
    center / cover no-repeat;
}

.hero-overlay {
  width: 100%;
  max-width: 850px;
}

.hero-redstone h1 {
  margin-bottom: 20px;

  color: var(--or);
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1.1;
  text-shadow: 4px 4px #000;
}

.hero-redstone p {
  max-width: 700px;
  margin: 15px auto;

  color: var(--texte);
  font-size: 1.2rem;
}

/* Style du bouton */

.bouton {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 999;

  display: inline-block;
  padding: 14px 24px;

  color: white;
  background: linear-gradient(
    135deg,
    #5826b9,
    #8d55ff 50%,
    #237fa8
  );

  border: 3px solid #bca0ff;
  border-radius: 4px;

  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;

  cursor: pointer;

  box-shadow:
    0 0 8px #8f5cff,
    0 0 20px rgba(102, 53, 255, 0.8),
    inset 0 0 10px rgba(255, 255, 255, 0.25);

  transition:
    transform 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

.bouton:hover {
  transform: translateY(-4px) scale(1.05);

  background: linear-gradient(
    135deg,
    #7041ff,
    #a66cff,
    #00aeca
  );

  box-shadow:
    0 0 12px #a77aff,
    0 0 30px #7041ff,
    0 0 50px rgba(0, 217, 255, 0.7);
}

.bouton:active {
  transform: translateY(0) scale(0.98);
}

/* Navigation */

.menu {
  position: sticky;
  top: 0;
  z-index: 10;

  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;

  min-height: 58px;
  padding: 14px 20px;

  background: var(--fond-secondaire);
  border-bottom: 2px solid var(--vert);
}

.menu a {
  display: inline-block;
  padding: 9px 14px;

  color: white;
  font-size: 1rem;
  line-height: 1.4;
  text-decoration: none;

  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.menu a:hover,
.menu a.active {
  background: var(--vert);
}

/* Contenu principal */

.simulator {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 60px 0;
}

.simulator h2 {
  margin-bottom: 25px;

  color: var(--or);
  font-size: 2.3rem;
  line-height: 1.2;
}

/* Contrôles */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.controls label {
  color: var(--gris);
  font-size: 1rem;
}

.controls select,
.controls button,
.viewer-actions button,
.information button {
  min-height: 44px;
  padding: 11px 18px;

  color: white;
  background: var(--vert);

  border: none;
  border-radius: 7px;

  font-family: Arial, sans-serif;
  font-size: 1rem;
  font-weight: bold;

  cursor: pointer;

  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
}

.controls select {
  color: white;
  background: var(--fond-secondaire);
  border: 1px solid var(--bordure);
}

.controls button:hover,
.viewer-actions button:hover,
.information button:hover {
  background: #64c96d;
  transform: translateY(-2px);
}

.controls button.active,
.version.active {
  color: #222;
  background: var(--or);
}

/* Organisation du simulateur */

.simulator-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 25px;
  align-items: start;
}

.viewer,
.information {
  padding: 22px;

  background: var(--carte);
  border: 1px solid var(--bordure);
  border-radius: 12px;
}

/* Simulateur de porte */

.door-scene {
  min-height: 400px;

  display: grid;
  grid-template-columns: repeat(2, 100px);
  grid-template-rows: repeat(2, 100px);
  justify-content: center;
  align-content: center;
  gap: 4px;

  background: #050805;
  border: 1px solid var(--vert);
  border-radius: 8px;
}

.door-block {
  background: #9a5c2e;
  border: 2px solid #c47b3d;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);

  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
}

/* Boutons du visualiseur */

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.viewer-actions button {
  flex: 1;
}

/* Informations */

.information h3 {
  margin-bottom: 15px;

  color: var(--or);
  font-size: 1.35rem;
  line-height: 1.3;
}

.information p {
  margin-bottom: 15px;
  color: var(--gris);
  font-size: 1rem;
}

.information ul {
  padding-left: 20px;
  color: var(--gris);
}

.information li {
  margin: 8px 0;
}

.information span {
  color: var(--vert-clair);
  font-weight: bold;
}

.information button {
  width: 100%;
  margin-top: 20px;
}

/* Version mobile */

@media (max-width: 700px) {
  .hero-redstone {
    min-height: 360px;
    padding: 30px 15px;
  }

  .hero-redstone h1 {
    font-size: 2.7rem;
  }

  .hero-redstone p {
    font-size: 1rem;
  }

  .bouton {
    top: 15px;
    right: 15px;
    padding: 10px 14px;
    font-size: 0.8rem;
  }

  .menu {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .menu a {
    flex-shrink: 0;
    font-size: 0.95rem;
  }

  .simulator {
    width: min(92%, 500px);
    padding: 40px 0;
  }

  .simulator h2 {
    font-size: 2rem;
  }

  .simulator-layout {
    grid-template-columns: 1fr;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .controls select,
  .controls button {
    width: 100%;
  }

  .door-scene {
    min-height: 300px;
    grid-template-columns: repeat(2, 75px);
    grid-template-rows: repeat(2, 75px);
  }

  .viewer-actions {
    flex-direction: column;
  }

  .viewer-actions button {
    width: 100%;
  }
}
