/* 🧪 Labos de Lumen — habillage commun.
 * Même thème que l'explorateur ; un cadre pour le monde, un panneau d'outils. */
:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1f2630;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent2: #3fb950;
  --warn: #d29922;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); }
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
}
header h1 { font-size: 1rem; margin: 0; white-space: nowrap; }
header h1 .sub { color: var(--muted); font-weight: normal; font-size: 0.85rem; }
header .spacer { flex: 1; }
header nav a { margin-left: 12px; font-size: 0.85rem; text-decoration: none; }
header nav a:hover { text-decoration: underline; }

main { flex: 1; display: flex; min-height: 0; }
#monde {
  flex: 1;
  min-width: 0;
  background: #000;
  position: relative;
}
#monde iframe { width: 100%; height: 100%; border: 0; display: block; }
#voile {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #ffd866;
  font-family: Consolas, monospace;
  font-size: 0.95rem;
  pointer-events: none;
}
#voile.on { display: flex; }

aside {
  flex: 0 0 380px;
  overflow-y: auto;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  padding: 14px;
}
aside h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 16px 0 8px;
}
aside h2:first-child { margin-top: 0; }
.row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.row label { flex: 0 0 auto; font-size: 0.85rem; min-width: 92px; }
.row.slider { flex-direction: column; align-items: stretch; gap: 3px; }
.row.slider label { display: flex; justify-content: space-between; min-width: 0; }
.row.slider output { color: var(--accent); font-family: Consolas, monospace; }
.row.check label { min-width: 0; cursor: pointer; }
select, input[type="text"], input[type="number"] {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 0.85rem;
  min-width: 0;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
button, a.btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, a.btn:hover { border-color: var(--accent); }
button.primary { background: #1f4066; border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
.hint { font-size: 0.78rem; color: var(--muted); line-height: 1.45; margin: 8px 0; }
.mono { font-family: Consolas, monospace; }
.barre { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; margin: 6px 0; }
.barre > div { height: 100%; width: 0; background: var(--accent); transition: width 0.15s; }
.stats { font-family: Consolas, monospace; font-size: 0.8rem; color: var(--muted); white-space: pre-line; }

/* grilles de vignettes */
.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grille .vign {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.grille .vign:hover { border-color: var(--accent); }
.grille .vign img { width: 100%; height: 100%; display: block; object-fit: cover; }
.grille .vign .tag {
  position: absolute; left: 4px; bottom: 4px;
  font-size: 0.7rem; font-family: Consolas, monospace;
  background: rgba(0, 0, 0, 0.6); color: #ffd866;
  padding: 1px 5px; border-radius: 4px;
}
.grille .vign.ko { opacity: 0.45; }
.lignee { display: flex; gap: 4px; flex-wrap: wrap; }
.lignee img { width: 64px; height: 36px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; }
.lignee img:hover { border-color: var(--accent); }

/* la carte des espèces */
.carte { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.carte .case {
  aspect-ratio: 4 / 3;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.carte .case img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte .case.vide { cursor: default; opacity: 0.35; }
.carte .case:hover { outline: 1px solid var(--accent); }

/* aperçu 2D (maillage, cartes) */
canvas.apercu { width: 100%; height: auto; display: block; background: #05070a; border: 1px solid var(--border); border-radius: 6px; }

/* le hub */
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 20px; max-width: 1200px; margin: 0 auto; }
.carte-labo {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.carte-labo:hover { border-color: var(--accent); }
.carte-labo h3 { margin: 0 0 6px; font-size: 1.05rem; }
.carte-labo p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.carte-labo .etat { font-size: 0.72rem; color: var(--warn); margin-top: 8px; }

@media (max-width: 900px) {
  main { flex-direction: column; }
  #monde { min-height: 45vh; }
  aside { flex: 1 0 auto; border-left: 0; border-top: 1px solid var(--border); }
}
