html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #c9ab7c;
}
#game {
  position: fixed;
  inset: 0;
  /* The game surface: no selection, no browser gestures (pan, zoom, long-press menus). */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}
#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: opacity 0.3s;
}
#loading img {
  width: 96px;
  height: 96px;
}
#loading.done {
  opacity: 0;
  pointer-events: none;
}

/* The standalone student picker (gamelab.js, with ?token= or ?section=). */
#players {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 2;
} /* the one free corner */
#players select {
  font: 16px sans-serif;
  padding: 6px 10px;
  border-radius: 8px;
}
/* The version badge (Game Lab's nb-version.js fills it; a tap shows the commit): small, at the bottom
   centre, the one edge no control uses in either orientation (info and Restart have the top corners,
   the arrows the top centre, the inventory and the picker the bottom corners). */
.nb-version-badge {
  position: fixed;
  left: 50%;
  bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  font: 11px sans-serif;
  color: rgba(0, 0, 0, 0.55);
  z-index: 2;
}
/* The package's Back hint (back-button.js sets its size). */
#exit-pill {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  background: rgba(32, 32, 32, 0.85);
  color: #fff;
  font-family: sans-serif;
  white-space: nowrap;
}
#load-error {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #fff;
  color: #333;
  font: 18px sans-serif;
  text-align: center;
}
#load-error button {
  margin-top: 12px;
  font: 16px sans-serif;
  padding: 8px 16px;
}
#players[hidden],
#exit-pill[hidden],
#load-error[hidden] {
  display: none;
}

/* ---- uGUI canvases as DOM (game/src/view/ui.js) ---- */
/* Every box is in canvas units; ui.js sets size and transform inline. Raycast targets get
   pointer-events:auto inline; nothing else in #ui takes the pointer. */
#ui .ui-layer {
  position: absolute;
  left: 0;
  top: 0;
}
#ui .ui-node {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}
#ui .ui-gfx {
  position: absolute;
  left: 0;
  top: 0;
  -webkit-tap-highlight-color: transparent;
}
#ui .ui-clip,
#ui .ui-clip-inner {
  position: absolute;
  left: 0;
  top: 0;
}
#ui .ui-img {
  position: absolute;
  background-repeat: no-repeat;
  pointer-events: none;
}
#ui .ui-text {
  position: absolute;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-kerning: normal;
  font-synthesis: style;
  text-rendering: geometricPrecision; /* TMP bold: a stroke, see ui.js */
}
#ui .ui-measure {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
}
#ui .ui-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
/* ---- end uGUI ---- */
