:root {
  --sky: #4FB8F5;
  --sky-light: #9FE2FF;
  --grass: #2E8B3A;
  --grass-light: #58C95E;
  --dirt: #8B5A2B;
  --gold: #FFC93C;
  --gold-dark: #8E1027;
  --purple: #8E3BD8;
  --purple-dark: #5B1F99;
  --ink: #1b1530;
  --night: #16112a;
  --paper: #fff8e7;
  --pixel: "Press Start 2P", monospace;
  --body: "Pixelify Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.5;
  color: var(--paper);
  background: var(--night);
}
canvas { image-rendering: pixelated; display: block; }
a { color: inherit; }
b { color: var(--gold); font-weight: 600; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px;
  background: rgba(22, 17, 42, .92);
  backdrop-filter: blur(6px);
  border-bottom: 4px solid var(--purple-dark);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--pixel); font-size: 14px; color: var(--gold);
  text-decoration: none; text-shadow: 2px 2px 0 var(--gold-dark);
}
.brand img { image-rendering: pixelated; }
.links { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.links a { text-decoration: none; opacity: .85; }
.links a:hover { opacity: 1; color: var(--gold); }
.lang {
  font-family: var(--pixel); font-size: 11px;
  background: none; color: var(--paper);
  border: 3px solid var(--paper); padding: 6px 8px; cursor: pointer;
}
.lang:hover { color: var(--gold); border-color: var(--gold); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  font-family: var(--pixel); font-size: 12px; line-height: 1.4;
  color: var(--ink); background: var(--gold);
  padding: 14px 18px; border: none; cursor: pointer; text-decoration: none;
  box-shadow: inset -4px -4px 0 #d99a16, 4px 4px 0 var(--ink);
  transition: transform .08s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: inset -4px -4px 0 #d99a16, 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: inset -4px -4px 0 #d99a16, 0 0 0 var(--ink); }
.btn-ghost { background: var(--paper); box-shadow: inset -4px -4px 0 #cfc3a6, 4px 4px 0 var(--ink); }
.btn-ghost:hover { box-shadow: inset -4px -4px 0 #cfc3a6, 6px 6px 0 var(--ink); }
.btn-small { padding: 8px 10px; font-size: 10px; opacity: 1 !important; }
.btn-big { font-size: 14px; padding: 18px 26px; }

/* ---------- Héros ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: flex; align-items: flex-start; justify-content: center;
  overflow: hidden;
}
#heroScene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-text { position: relative; text-align: center; padding: 6vh 20px 0; max-width: 1000px; }
.logo {
  margin: 0;
  font-family: var(--pixel); font-weight: 400;
  font-size: clamp(28px, 6.4vw, 72px); letter-spacing: 4px; white-space: nowrap;
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--gold-dark), 8px 8px 0 rgba(0, 0, 0, .15);
}
.tagline {
  margin: 18px 0 8px;
  font-family: var(--pixel); font-size: clamp(12px, 2.2vw, 20px);
  color: #fff; text-shadow: 3px 3px 0 #1d3a5c;
}
.lead {
  margin: 0 auto 24px; max-width: 620px;
  color: #fff; font-size: 20px; font-weight: 600; text-shadow: 2px 2px 0 #1d3a5c;
}
.cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section { padding: 80px 24px; max-width: 1180px; margin: 0 auto; }
.section h2 {
  font-family: var(--pixel); font-weight: 400; text-align: center;
  font-size: clamp(18px, 3vw, 28px); line-height: 1.5;
  color: var(--gold); text-shadow: 3px 3px 0 var(--gold-dark);
  margin: 0 0 12px;
}
.sub { text-align: center; opacity: .8; margin: 0 auto 40px; max-width: 640px; }

.panel, .card, .rule, .dev, .map-card, .gear-card {
  background: #241c44;
  border: 4px solid #3a2e66;
  box-shadow: 6px 6px 0 #0c0919;
}

/* Concept */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.card { padding: 28px; }
.card-icon { font-size: 40px; }
.card h3, .rule h3 { font-family: var(--pixel); font-weight: 400; font-size: 16px; color: var(--gold); margin: 12px 0; }
.card p { margin: 0; opacity: .9; }

/* Démo */
.demo-grid { display: grid; grid-template-columns: auto 1fr; gap: 56px; align-items: center; }
.watch {
  position: relative; width: 430px; height: 430px; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #4b4b55, #18181d 70%);
  box-shadow: 0 0 0 10px #0d0d10, 0 20px 50px rgba(0, 0, 0, .6);
  display: grid; place-items: center;
}
.watch canvas { width: 390px; height: 390px; border-radius: 50%; background: #000; }
.watch-btn { position: absolute; width: 18px; height: 46px; background: #2b2b31; border-radius: 4px; }
.watch-btn.b1 { right: -22px; top: 90px; background: #c0392b; }
.watch-btn.b2 { right: -22px; bottom: 90px; }
.watch-btn.b3 { left: -22px; top: 120px; }
.controls { display: flex; flex-direction: column; gap: 22px; }
.ctrl { display: flex; flex-direction: column; gap: 8px; }
.ctrl.row { flex-direction: row; gap: 16px; flex-wrap: wrap; }
.ctrl-label { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; opacity: .75; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  font-family: var(--body); font-size: 17px;
  background: #241c44; color: var(--paper);
  border: 3px solid #3a2e66; padding: 6px 14px; cursor: pointer;
}
.seg button:hover { border-color: var(--gold); }
.seg button.on { background: var(--purple); border-color: var(--gold); }
input[type=range] { width: 100%; max-width: 360px; accent-color: var(--gold); }
.log {
  list-style: none; margin: 0; padding: 12px 16px; min-height: 130px;
  background: #0c0919; border: 4px solid #3a2e66; font-size: 16px;
}
.log li { opacity: .9; }
.log li:first-child { color: var(--gold); opacity: 1; }

/* Règles */
.rules { background: none; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.rule { padding: 24px 28px; }
.rule ul { margin: 0; padding-left: 20px; }
.rule li { margin: 6px 0; }
.pill {
  font-size: 9px; background: #e63946; color: #fff;
  padding: 4px 6px; vertical-align: middle; margin-left: 6px;
}

/* Équipement */
.gear-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.gear-card { padding: 14px 10px 16px; text-align: center; }
.gear-card canvas { margin: 0 auto 8px; background: linear-gradient(#4FB8F5 0 60%, #2E8B3A 60%); width: 100%; height: auto; aspect-ratio: 1; }
.gear-card h4 { margin: 4px 0 0; font-family: var(--pixel); font-weight: 400; font-size: 11px; color: var(--gold); }
.gear-card p { margin: 6px 0 0; font-size: 16px; opacity: .8; }

/* Cartes */
.map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.map-card { overflow: hidden; }
.map-card canvas { width: 100%; height: auto; aspect-ratio: 2 / 1; }
.map-info { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; }
.map-info h4 { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: 13px; color: var(--gold); }
.map-info span { opacity: .8; font-size: 16px; }

/* Appareils */
.dev-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.dev { padding: 16px 20px; }
.dev h4 { margin: 0 0 6px; font-family: var(--pixel); font-weight: 400; font-size: 12px; color: var(--gold); }
.dev p { margin: 0; opacity: .85; font-size: 17px; }

/* Installer */
.install { text-align: center; }
.steps {
  counter-reset: s; list-style: none; padding: 0;
  max-width: 640px; margin: 24px auto 36px; text-align: left;
}
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 56px; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 6px; width: 38px; height: 38px;
  display: grid; place-items: center;
  font-family: var(--pixel); font-size: 14px; color: var(--ink);
  background: var(--gold); box-shadow: 3px 3px 0 var(--gold-dark);
}
.faq { max-width: 760px; margin: 56px auto 0; text-align: left; }
.faq details { background: #241c44; border: 4px solid #3a2e66; margin-bottom: 12px; padding: 12px 18px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq summary::marker { color: var(--gold); }
.faq p { margin: 10px 0 2px; opacity: .9; }

/* Pied de page */
.footer { position: relative; text-align: center; font-size: 15px; }
#footerScene { width: 100%; height: 140px; }
.footer p { margin: 0; padding: 18px 24px 28px; background: var(--dirt); color: #fff3dc; }

/* ---------- Mobile ---------- */
@media (max-width: 980px) {
  .demo-grid { grid-template-columns: 1fr; justify-items: center; }
  .controls { width: 100%; max-width: 520px; }
  .gear-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .links a:not(.btn) { display: none; }
  .nav { gap: 12px; padding: 10px 14px; }
  .brand { font-size: 11px; }
  .map-grid { grid-template-columns: 1fr; }
  .gear-row { grid-template-columns: repeat(2, 1fr); }
  .watch { width: 330px; height: 330px; }
  .watch canvas { width: 300px; height: 300px; }
  .watch-btn.b1 { top: 70px; } .watch-btn.b2 { bottom: 70px; } .watch-btn.b3 { top: 90px; }
  .lead { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
