@font-face {
  font-family: 'Roboto';
  src: url('../assets/fonts/Roboto-VariableFont_wdth,wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
}

/* No flex, no centring, no fixed sizing anywhere: #stage fills whatever
   contains it (a full window or an iframe, both work the same way),
   and everything inside is positioned against #stage, not the viewport. */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Roboto', Arial, sans-serif;
  background: #fff;
}

#stage {
  position: relative;   /* the positioning root for the canvas and the UI */
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* main.js appends the renderer's canvas here; it fills #stage exactly,
   so there is nothing left to centre or leave a gap around */
/* No width/height here on purpose: renderer.setSize() writes them
   itself on every fit, matched to the drawing buffer. Forcing 100%
   from CSS would override that and stretch the picture — the same
   deformation, arriving by another route. Position and inset are
   enough to place it. */
#stage canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
}

/* ---------- overlays, anchored to #stage instead of the viewport ----------
   position: fixed anchors to the OUTERMOST viewport, which inside an
   iframe is the iframe's own box — usually fine, but position: absolute
   against #stage is simpler to reason about and never depends on how
   this page happens to be hosted. */
#info {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px 22px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  white-space: nowrap;
  pointer-events: auto;
}
#info a { font-weight: 400; text-decoration: none; color: #1a1a1a; }
#info a:hover { font-weight: 700; }

#model-selector {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 14px;
  max-width: calc(100% - 40px);
}
#model-selector label { white-space: nowrap; opacity: 0.7; }
#model-selector select {
  font: inherit;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: #fff;
  max-width: 60vw;
}

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  background: #fff;
  padding: 14px 28px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  font-size: 15px;
  display: none;
}
#loading.is-visible { display: block; }

@media (max-width: 560px) {
  #info { font-size: 12px; padding: 10px 16px; top: 12px; }
  #model-selector { font-size: 12px; bottom: 12px; }
  #model-selector select { max-width: 50vw; }
}
