:root {
  --bg: #060a0c;
  --ink: #e2efe6;
  --dim: #8fa89a;
  --accent: #aef0c0;
  --accent2: #ffd9a0;
  --panel: rgba(10, 18, 16, 0.72);
  --line: rgba(174, 240, 192, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  cursor: crosshair;
}

/* ---------- overlay de démarrage ---------- */
#start-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(12, 26, 20, 0.88), rgba(4, 8, 7, 0.97));
  backdrop-filter: blur(6px);
  z-index: 30;
  transition: opacity 0.8s ease;
}
#start-overlay.hidden { opacity: 0; pointer-events: none; }

.start-card { text-align: center; max-width: 32rem; padding: 2rem; }
.start-card h1 {
  margin: 0;
  font-size: 3.1rem;
  font-weight: 200;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  color: var(--accent);
  text-shadow: 0 0 30px rgba(174, 240, 192, 0.4);
}
.start-card .tagline {
  margin: 0.4rem 0 1.6rem;
  color: var(--accent2);
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.start-card .desc { color: var(--dim); line-height: 1.8; font-size: 0.95rem; }
.start-card .hint-midi { color: var(--dim); font-size: 0.75rem; opacity: 0.7; margin-top: 1.4rem; line-height: 1.6; }

#btn-start {
  margin-top: 1.6rem;
  padding: 0.9rem 2.6rem;
  font-size: 1rem;
  letter-spacing: 0.2em;
  color: #08130d;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(174, 240, 192, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#btn-start:hover { transform: scale(1.05); box-shadow: 0 0 60px rgba(255, 217, 160, 0.5); }

/* ---------- panneau ---------- */
#panel {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 20;
}

#panel-toggle {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(10px);
}

.panel-body {
  margin-top: 2.8rem;
  width: 15.5rem;
  max-height: calc(100vh - 5.5rem);
  overflow-y: auto;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: rgba(174, 240, 192, 0.25) transparent;
}
#panel:not(.open) .panel-body { display: none; }

.panel-body header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.panel-body h2 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  color: var(--accent);
}

#btn-play {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(174, 240, 192, 0.08);
  color: var(--accent);
  font-size: 0.95rem;
  cursor: pointer;
}
#btn-play:hover { background: rgba(174, 240, 192, 0.2); }

.panel-body section {
  padding: 0.55rem 0;
  border-top: 1px solid rgba(174, 240, 192, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.panel-body section.row { flex-direction: row; gap: 0.5rem; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-transform: uppercase;
}
label span { color: var(--accent); text-transform: none; }
label .sub { display: block; color: var(--dim); font-size: 0.62rem; text-transform: none; letter-spacing: 0; opacity: 0.8; }

label.check {
  flex-direction: row;
  align-items: baseline;
  gap: 0.5rem;
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: var(--ink);
}
label.check input { accent-color: var(--accent); }

select {
  background: rgba(6, 12, 10, 0.9);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.8rem;
  outline: none;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

section.row button {
  flex: 1;
  padding: 0.5rem 0.3rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  background: rgba(174, 240, 192, 0.07);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  cursor: pointer;
}
section.row button:hover { background: rgba(174, 240, 192, 0.18); }

/* ---------- aide ---------- */
#hints {
  position: fixed;
  bottom: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: rgba(6, 12, 10, 0.55);
  border: 1px solid rgba(174, 240, 192, 0.1);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

@media (max-width: 760px) {
  #hints { display: none; }
}
