@charset "UTF-8";
/* ==========================================================================
   How MCMC Works dependency-free stylesheet.

   Every selector is namespaced under .mcmc-root and every class is prefixed
   "mcmc-", so this cannot leak into a host site. The palette is the one the
   rest of the playground uses. Violet is this demo's lit colour: it is the
   colour of the walker, and of the histogram its footprints pile up into.
   Green and red are the two verdicts a proposal can get, and amber is the
   true map when the fog is lifted.
   ========================================================================== */

.mcmc-root {
  /* ---- palette ---- */
  --mcmc-panel: #0e1115;
  --mcmc-surface: #141720;
  --mcmc-surface-2: #1c2030;
  --mcmc-border: rgba(255, 255, 255, 0.08);
  --mcmc-border-strong: rgba(255, 255, 255, 0.16);

  --mcmc-text: #e8e4d9;
  --mcmc-dim: rgba(232, 228, 217, 0.62);
  --mcmc-faint: rgba(232, 228, 217, 0.38);

  --mcmc-accent: #4d9ee8;
  --mcmc-walker: #a78bfa;
  --mcmc-good: #34d399;
  --mcmc-bad: #ff5f6d;
  --mcmc-truth: #fbbf24;

  /* ---- geometry ---- */
  --mcmc-radius: 14px;
  --mcmc-radius-sm: 8px;

  --mcmc-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mcmc-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  position: relative;
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
  color: var(--mcmc-text);
  font-family: var(--mcmc-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

.mcmc-root *,
.mcmc-root *::before,
.mcmc-root *::after {
  box-sizing: border-box;
}

.mcmc-root button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

.mcmc-root button:disabled {
  cursor: default;
  opacity: 0.45;
}

.mcmc-root select,
.mcmc-root input {
  font-family: inherit;
  color: inherit;
}

/* The hidden attribute has to beat the display each control sets. */
.mcmc-root [hidden] {
  display: none !important;
}

.mcmc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   Panel
   ========================================================================== */

.mcmc-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 50% -10%, rgba(167, 139, 250, 0.1), transparent 70%),
    radial-gradient(900px 520px at 100% 100%, rgba(77, 158, 232, 0.07), transparent 70%),
    var(--mcmc-panel);
  border: 1px solid var(--mcmc-border);
  border-radius: var(--mcmc-radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

/* faint grid texture, the same one the other demos carry */
.mcmc-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000 40%, transparent 100%);
}

.mcmc-panel > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Header
   ========================================================================== */

.mcmc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-bottom: 1px solid var(--mcmc-border);
}

.mcmc-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--mcmc-walker);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.16);
}

.mcmc-root.is-running .mcmc-dot {
  animation: mcmc-pulse 1.4s ease-in-out infinite;
}

@keyframes mcmc-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.16); }
  50% { box-shadow: 0 0 0 6px rgba(167, 139, 250, 0.05); }
}

.mcmc-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mcmc-title-sub {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--mcmc-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mcmc-spacer {
  flex: 1;
}

/* live pill */
.mcmc-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 4px 10px 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mcmc-faint);
  border: 1px solid var(--mcmc-border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  transition: color 0.2s, border-color 0.2s;
}

.mcmc-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.mcmc-live.is-on {
  color: var(--mcmc-walker);
  border-color: rgba(167, 139, 250, 0.4);
}

.mcmc-live.is-on .mcmc-live-dot {
  animation: mcmc-blink 1.1s ease-in-out infinite;
}

@keyframes mcmc-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* scenario select */
.mcmc-select {
  position: relative;
  flex: none;
  max-width: 100%;
}

.mcmc-select select {
  appearance: none;
  max-width: 100%;
  padding: 6px 26px 6px 11px;
  font-size: 12px;
  font-weight: 500;
  color: var(--mcmc-text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--mcmc-border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.16s;
}

.mcmc-select select:hover {
  border-color: var(--mcmc-border-strong);
}

.mcmc-select::after {
  content: "";
  position: absolute;
  right: 11px;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -4px;
  border-right: 1.5px solid var(--mcmc-faint);
  border-bottom: 1.5px solid var(--mcmc-faint);
  transform: rotate(45deg);
  pointer-events: none;
}

.mcmc-select select option {
  background: #12151c;
  color: var(--mcmc-text);
}

/* speed segmented control */
.mcmc-seg {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  padding: 3px;
  border: 1px solid var(--mcmc-border);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.mcmc-seg-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--mcmc-dim);
  border-radius: 999px;
  transition: color 0.16s, background 0.16s;
}

.mcmc-seg-btn:hover { color: var(--mcmc-text); }

.mcmc-seg-btn.is-active {
  color: #10071f;
  background: var(--mcmc-walker);
}

/* ==========================================================================
   Body layout
   ========================================================================== */

.mcmc-body {
  display: grid;
  grid-template-columns: 1fr;
}

.mcmc-main {
  min-width: 0;
  padding: 14px 16px 16px;
}

.mcmc-side {
  min-width: 0;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--mcmc-border);
}

@media (min-width: 1000px) {
  .mcmc-body {
    grid-template-columns: minmax(0, 1fr) 318px;
  }
  .mcmc-side {
    border-top: 0;
    border-left: 1px solid var(--mcmc-border);
  }
}

/* ==========================================================================
   Toolbar
   ========================================================================== */

.mcmc-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mcmc-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mcmc-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mcmc-faint);
}

.mcmc-bar-sep {
  width: 1px;
  height: 20px;
  background: var(--mcmc-border);
  margin: 0 2px;
}

/* On a narrow panel the toolbar wraps, and a divider on its own row is
   just a stray mark. */
@media (max-width: 560px) {
  .mcmc-bar-sep {
    display: none;
  }
}

.mcmc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--mcmc-dim);
  border: 1px solid var(--mcmc-border);
  border-radius: var(--mcmc-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  transition: color 0.16s, border-color 0.16s, background 0.16s, transform 0.1s;
}

.mcmc-btn:hover:not(:disabled) {
  color: var(--mcmc-text);
  border-color: var(--mcmc-border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.mcmc-btn:active:not(:disabled) { transform: translateY(1px); }

.mcmc-btn.is-primary {
  color: #10071f;
  background: var(--mcmc-walker);
  border-color: transparent;
  font-weight: 600;
  min-width: 96px;
}

.mcmc-btn.is-primary:hover:not(:disabled) {
  background: #b9a3fc;
  color: #10071f;
}

/* the reveal toggle glows amber once the true map is showing */
.mcmc-btn.is-reveal.is-on {
  color: var(--mcmc-truth);
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.09);
}

.mcmc-btn svg {
  flex: none;
}

/* step-size slider */
.mcmc-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.mcmc-slider-label {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mcmc-faint);
}

.mcmc-range {
  flex: 1;
  min-width: 90px;
  height: 20px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.mcmc-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(77, 158, 232, 0.45), rgba(167, 139, 250, 0.75));
}

.mcmc-range::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(77, 158, 232, 0.45), rgba(167, 139, 250, 0.75));
}

.mcmc-range::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: var(--mcmc-text);
  border: 0;
  box-shadow: 0 0 0 3px rgba(232, 228, 217, 0.12);
  transition: box-shadow 0.16s;
}

.mcmc-range::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--mcmc-text);
  border: 0;
  box-shadow: 0 0 0 3px rgba(232, 228, 217, 0.12);
}

.mcmc-range:hover::-webkit-slider-thumb,
.mcmc-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px rgba(232, 228, 217, 0.16);
}

.mcmc-thr {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: none;
  min-width: 62px;
  line-height: 1.1;
}

.mcmc-thr-v {
  font-family: var(--mcmc-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--mcmc-walker);
  font-variant-numeric: tabular-nums;
}

.mcmc-thr-k {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mcmc-faint);
}

.mcmc-slider-scale {
  display: flex;
  justify-content: space-between;
  margin: 4px 74px 0 92px;
  font-size: 10px;
  color: var(--mcmc-faint);
}

/* ==========================================================================
   Stage
   ========================================================================== */

.mcmc-stage {
  position: relative;
  height: 600px;
  border: 1px solid var(--mcmc-border);
  border-radius: var(--mcmc-radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.014), transparent 40%),
    rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

@media (min-width: 700px) { .mcmc-stage { height: 560px; } }
@media (min-width: 1000px) { .mcmc-stage { height: 588px; } }

.mcmc-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Legend
   ========================================================================== */

.mcmc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 10px 2px 0;
  font-size: 11px;
  color: var(--mcmc-faint);
}

.mcmc-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mcmc-sw {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
}

.mcmc-sw.is-walker {
  background: var(--mcmc-walker);
  box-shadow: 0 0 6px rgba(167, 139, 250, 0.8);
}
.mcmc-sw.is-ghost {
  background: transparent;
  border: 1.5px dashed rgba(167, 139, 250, 0.8);
}
.mcmc-sw.is-good { background: var(--mcmc-good); }
.mcmc-sw.is-bad { background: var(--mcmc-bad); }
.mcmc-sw.is-hist {
  width: 14px;
  height: 9px;
  border-radius: 2px;
  background: rgba(167, 139, 250, 0.35);
  border: 1px solid rgba(167, 139, 250, 0.6);
}
.mcmc-sw.is-burn {
  width: 14px;
  height: 9px;
  border-radius: 2px;
  background: rgba(232, 228, 217, 0.12);
  border: 1px solid rgba(232, 228, 217, 0.25);
}
.mcmc-sw.is-truth {
  width: 14px;
  height: 0;
  border-radius: 0;
  border-top: 2px solid var(--mcmc-truth);
}
.mcmc-sw.is-data { background: var(--mcmc-accent); }

/* ==========================================================================
   Side panel: the story
   ========================================================================== */

.mcmc-story {
  padding: 13px 14px 14px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: var(--mcmc-radius-sm);
  background: rgba(167, 139, 250, 0.07);
  transition: border-color 0.24s, background 0.24s;
}

.mcmc-story.is-done {
  border-color: var(--mcmc-border);
  background: rgba(255, 255, 255, 0.015);
}

.mcmc-story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.mcmc-story-head .mcmc-group-label {
  color: var(--mcmc-walker);
}

.mcmc-story.is-done .mcmc-story-head .mcmc-group-label {
  color: var(--mcmc-faint);
}

.mcmc-story-n {
  font-family: var(--mcmc-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--mcmc-faint);
  padding: 1px 7px;
  border: 1px solid var(--mcmc-border);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.mcmc-story-title {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--mcmc-text);
}

.mcmc-story-text {
  margin: 0;
  min-height: 84px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--mcmc-dim);
}

.mcmc-story-text strong {
  color: var(--mcmc-text);
  font-weight: 600;
}

.mcmc-story-text em {
  font-style: normal;
  color: var(--mcmc-walker);
}

.mcmc-story-text code {
  font-family: var(--mcmc-mono);
  font-size: 12px;
  color: var(--mcmc-text);
}

.mcmc-story-text .is-good { color: var(--mcmc-good); }
.mcmc-story-text .is-bad { color: var(--mcmc-bad); }
.mcmc-story-text .is-truth { color: var(--mcmc-truth); }

.mcmc-story-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
}

.mcmc-story-nav .mcmc-spacer { flex: 1; }

.mcmc-story-skip {
  padding: 5px 8px;
  white-space: nowrap;
  font-size: 11px;
  color: var(--mcmc-faint);
  border-radius: 6px;
  transition: color 0.16s;
}

.mcmc-story-skip:hover { color: var(--mcmc-text); }

/* ==========================================================================
   Side panel: the last decision
   ========================================================================== */

.mcmc-last {
  margin-top: 12px;
  padding: 11px 13px 12px;
  border: 1px solid var(--mcmc-border);
  border-radius: var(--mcmc-radius-sm);
  background: rgba(0, 0, 0, 0.22);
  transition: border-color 0.2s, background 0.2s;
}

.mcmc-last.is-good {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.06);
}

.mcmc-last.is-bad {
  border-color: rgba(255, 95, 109, 0.4);
  background: rgba(255, 95, 109, 0.06);
}

.mcmc-last-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.mcmc-last-verdict {
  font-size: 12px;
  font-weight: 600;
  color: var(--mcmc-faint);
}

.mcmc-last.is-good .mcmc-last-verdict { color: var(--mcmc-good); }
.mcmc-last.is-bad .mcmc-last-verdict { color: var(--mcmc-bad); }

.mcmc-last-rows {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  font-size: 11.5px;
  color: var(--mcmc-faint);
}

.mcmc-last-rows b {
  font-family: var(--mcmc-mono);
  font-weight: 500;
  color: var(--mcmc-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mcmc-last-rows .is-hi { color: var(--mcmc-dim); }
.mcmc-last-rows .is-hi b { color: var(--mcmc-text); }

.mcmc-last-formula {
  margin-top: 8px;
  padding-top: 7px;
  font-family: var(--mcmc-mono);
  font-size: 10.5px;
  color: var(--mcmc-faint);
  border-top: 1px solid var(--mcmc-border);
}

.mcmc-last-formula b {
  font-weight: 500;
  color: var(--mcmc-walker);
}

.mcmc-last-formula sup {
  font-size: 8px;
}

/* ==========================================================================
   Side panel: stats and readouts
   ========================================================================== */

.mcmc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 12px;
  background: var(--mcmc-border);
  border: 1px solid var(--mcmc-border);
  border-radius: var(--mcmc-radius-sm);
  overflow: hidden;
}

.mcmc-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 11px 11px;
  background: rgba(14, 17, 21, 0.92);
}

.mcmc-stat-k {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mcmc-faint);
}

.mcmc-stat-v {
  font-family: var(--mcmc-mono);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--mcmc-text);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}

.mcmc-stat-v.is-good { color: var(--mcmc-good); }
.mcmc-stat-v.is-bad { color: var(--mcmc-bad); }
.mcmc-stat-v.is-walker { color: var(--mcmc-walker); }
.mcmc-stat-v.is-quiet { color: var(--mcmc-faint); }

.mcmc-stat-of {
  font-size: 12px;
  font-weight: 500;
  color: var(--mcmc-faint);
}

.mcmc-stat-hint {
  font-size: 10px;
  color: var(--mcmc-faint);
}

.mcmc-read-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
}

.mcmc-read-note {
  font-size: 10px;
  color: var(--mcmc-faint);
}

.mcmc-read {
  display: flex;
  flex-direction: column;
  gap: 5px;
  /* Room for the readouts before they exist, so the frame does not jump
     when they arrive. */
  min-height: 200px;
}

.mcmc-read-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid var(--mcmc-border);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.3s, background 0.3s;
}

.mcmc-read-row.is-lead {
  border-color: rgba(167, 139, 250, 0.4);
  background: rgba(167, 139, 250, 0.08);
}

.mcmc-read-k {
  font-size: 11.5px;
  color: var(--mcmc-dim);
}

.mcmc-read-v {
  font-family: var(--mcmc-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mcmc-text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.mcmc-read-row.is-lead .mcmc-read-v { color: var(--mcmc-walker); }

.mcmc-read-empty {
  padding: 10px 2px;
  font-size: 12px;
  color: var(--mcmc-faint);
}

.mcmc-read-empty[hidden] { display: none; }

/* ==========================================================================
   Foot
   ========================================================================== */

.mcmc-foot {
  padding: 10px 16px 12px;
  font-size: 11px;
  color: var(--mcmc-faint);
  border-top: 1px solid var(--mcmc-border);
}

/* ==========================================================================
   Focus and reduced motion
   ========================================================================== */

.mcmc-root :focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.7);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .mcmc-root *,
  .mcmc-root *::before,
  .mcmc-root *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
