/* ---------- World model sim (nerdy bamboozling tech) ---------- */
.tech-topic .myself-copy + .myself-copy { margin-top: 1em; }
.tech-topic + .tech-topic { margin-top: 56px; }

.wm { margin: 28px 0 0; }

.wm-stage {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #78a7ff;
  line-height: 0;
  user-select: none;
  -webkit-user-select: none;
}
.wm-stage.is-playing { touch-action: none; }
.wm-stage:fullscreen {
  border-radius: 0;
  background: #000;
}
body.wm-playing #cursor { display: none; }

.wm-canvas {
  display: block;
  width: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.wm-canvas:focus { outline: none; }
.wm-stage:has(.wm-canvas:focus-visible) {
  outline: 1px solid #111111;
  outline-offset: 4px;
}

.wm-hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* minecraft draws the crosshair inverted against whatever is behind it */
.wm-crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  background:
    linear-gradient(#fff, #fff) center / 2px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 2px no-repeat;
}
.wm-stage.is-playing .wm-crosshair { opacity: 1; }

/* start and pause menu, styled like the in-game menus */
.wm-menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(16, 16, 16, 0.5);
  font-family: 'Pixelify Sans', monospace;
  line-height: 1.2;
  color: #fff;
  cursor: pointer;
}
.wm-menu[hidden] { display: none; }
.wm-menu-title {
  margin: 0 0 6px;
  font-size: 22px;
  text-shadow: 2px 2px 0 #3f3f3f;
}
.wm-mc-btn {
  width: min(260px, 80%);
  padding: 9px 16px;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #aaa, inset -2px -4px 0 #555;
  background: #6f6f6f;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f;
  transition: background 120ms ease;
}
.wm-mc-btn[hidden] { display: none; }
.wm-mc-btn:disabled { color: #a0a0a0; cursor: default; }
.wm-mc-btn:not(:disabled):hover,
.wm-mc-btn:focus-visible {
  background: #7d86c4;
  border-color: #fff;
  outline: none;
}
.wm-menu-keys {
  max-width: 34ch;
  margin: 6px 0 0;
  font-size: 14px;
  text-align: center;
  text-shadow: 2px 2px 0 #3f3f3f;
  color: #e0e0e0;
}

.wm-touch[hidden] { display: none; }
.wm-stick {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.18);
}
.wm-stick span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}
.wm-jump,
.wm-touch-exit {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.25);
  font-family: 'Pixelify Sans', monospace;
  line-height: 1;
  color: #fff;
}
.wm-jump {
  right: 18px;
  bottom: 30px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 15px;
}
.wm-touch-exit {
  top: 12px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}

/* snoop's lines and objectives, for screen readers */
.wm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wm-note {
  margin: 24px 0 0;
  max-width: 42ch;
  font-size: 16px;
  line-height: 1.5;
  color: #4a4a4a;
}

@media (max-width: 480px) {
  .wm-menu { gap: 8px; }
  .wm-menu-title { font-size: 18px; }
  .wm-mc-btn { padding: 7px 12px; font-size: 15px; }
  .wm-menu-keys { font-size: 12px; }
  /* keep the stick and jump clear of the hotbar */
  .wm-stick { left: 10px; bottom: 26%; width: 76px; height: 76px; }
  .wm-stick span { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
  .wm-jump { right: 10px; bottom: 28%; width: 52px; height: 52px; font-size: 13px; }
}
