/* =========================================================
   Mémoire du Globe — simulations interactives (s'ajoute à pages.css)
   Une page de simulation peut être intégrée dans une leçon : ?embed=1
   ========================================================= */
.sim-wrap { max-width: 1100px; }
.sim {
  margin-top: 22px; padding: 16px; border-radius: 20px;
  background: rgba(9, 13, 25, .7); border: 1px solid var(--line-2);
}
.sim canvas { display: block; width: 100%; height: auto; border-radius: 12px; background: #050913; touch-action: none; }
.sim-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 14px; }
.sim-bar .grow { flex: 1; }
.sim-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); color: var(--ink);
  font: 600 14px/1 var(--f-display); cursor: pointer; transition: background .2s, border-color .2s, transform .2s;
}
.sim-btn:hover { background: rgba(255, 255, 255, .1); }
.sim-btn:active { transform: scale(.97); }
.sim-btn.main { background: var(--neon); color: #0a0d16; border-color: transparent; }
.sim-btn.warn { background: #ff5b3a; color: #fff; border-color: transparent; }
.sim-btn[aria-pressed="true"] { background: rgba(79, 227, 255, .16); border-color: var(--neon); }
.sim-btn:disabled { opacity: .45; cursor: default; }
.sim-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); flex-wrap: wrap; }
.sim-seg button { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 500 13.5px/1 var(--f-body); cursor: pointer; }
.sim-seg button[aria-pressed="true"] { background: var(--ink); color: #0a0d16; font-weight: 600; }
.sim-field { display: flex; flex-direction: column; gap: 6px; min-width: 190px; font-size: 13px; color: var(--ink-2); }
.sim-field b { color: var(--ink); font-family: var(--f-display); }
.sim-field input[type="range"] { width: 100%; accent-color: var(--neon); }
.sim-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 18px; margin-top: 14px; }
.sim-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.sim-kpi { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.sim-kpi b { display: block; font: 700 22px/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sim-kpi span { font-size: 12.5px; color: var(--muted); }
.sim-msg { margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(79, 227, 255, .07); border: 1px solid rgba(79, 227, 255, .25); font-size: 14.5px; line-height: 1.55; }
.sim-msg.bad { background: rgba(255, 91, 58, .08); border-color: rgba(255, 91, 58, .35); }
.sim-msg.good { background: rgba(61, 220, 132, .08); border-color: rgba(61, 220, 132, .35); }
.sim-msg:empty { display: none; }
.sim-cases { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sim-cases a, .sim-cases button {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: none;
  color: var(--ink-2); font: 500 13px/1.2 var(--f-body); text-decoration: none; cursor: pointer;
}
.sim-cases a:hover, .sim-cases button:hover { color: var(--ink); border-color: rgba(255, 255, 255, .35); }
.sim-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); }
.sim-help { margin-top: 26px; }
.sim-help h2 { margin-top: 32px; }
.sim-help ol, .sim-help ul { padding-left: 20px; color: var(--ink-2); }
.sim-help li { margin: 6px 0; }

/* Intégration dans une leçon (iframe) : seule la simulation reste */
body.embed { padding: 0; background: transparent; }
body.embed .top, body.embed .crumbs, body.embed h1, body.embed .intro, body.embed .sim-help,
body.embed .nl, body.embed footer, body.embed .peda-tags { display: none !important; }
body.embed .wrap { max-width: none; }
body.embed .sim { margin: 0; }
@media (max-width: 640px) {
  .sim { padding: 10px; }
  .sim-field { min-width: 0; }
}
