.renderer-page { max-width: 1120px; }

.render-view {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: #d8d6db;
}

#world {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#world:active { cursor: grabbing; }
#world:focus-visible { outline: 2px solid #0000ee; outline-offset: -3px; }

.render-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  max-width: none;
  margin: 0;
  padding: 24px;
  text-align: center;
  color: #42404a;
  pointer-events: none;
}

.render-message[hidden] { display: none; }

.render-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 10px;
  font-size: 13px;
}

.render-hint { margin: 0; color: #666; }
.render-controls { display: flex; flex-wrap: wrap; gap: 18px; }
.render-controls button, .leave-fullscreen {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0000ee;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.render-controls button:disabled { color: #777; cursor: default; }
.render-controls button:focus-visible, .leave-fullscreen:focus-visible {
  outline: 2px solid #0000ee;
  outline-offset: 4px;
}

.render-view:fullscreen { width: 100vw; height: 100vh; aspect-ratio: auto; }
.render-view:fullscreen #world { touch-action: none; }
.leave-fullscreen {
  position: absolute;
  bottom: 20px;
  right: 24px;
  color: white;
  font-size: 13px;
  text-shadow: 0 1px 4px #222;
}

@media (max-width: 600px) {
  .render-view { aspect-ratio: 4 / 5; }
}

#world.looking { cursor: none; }
.render-hint { max-width: none; }
.touch-hint, .touch-controls, .touch-height { display: none; }
.touch-controls {
  position: absolute;
  bottom: 28px;
  left: 22px;
}
.touch-height { position: absolute; bottom: 24px; right: 18px; gap: 6px; }
.touch-controls button, .touch-height button {
  padding: 0;
  border: 1px solid #ffffff55;
  background: #111a;
  color: #eee;
  font: 13px Helvetica, Arial, sans-serif;
  touch-action: none;
  user-select: none;
}
.touch-height button { width: 46px; height: 46px; }
.touch-height button.held { background: #666b; }
.touch-controls button:disabled, .touch-height button:disabled { opacity: .35; }
.move-stick { position: relative; width: 88px; height: 88px; border-radius: 50%; }
.stick-thumb { position: absolute; left: 29px; top: 29px; width: 28px; height: 28px; border-radius: 50%; background: #eee9; pointer-events: none; }
.stick-label { position: absolute; top: 94px; left: 0; width: 100%; color: #eee; text-shadow: 0 1px 3px #111; pointer-events: none; }
.enter-world {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  padding: 9px 14px; border: 1px solid #ffffff55; background: #151719c9;
  color: #eee; font: 14px Helvetica, Arial, sans-serif; cursor: pointer;
}
.enter-world[hidden] { display: none; }
.enter-world:disabled { visibility: hidden; }
.control-help { margin-top: 12px; font-size: 13px; }
.control-help summary { width: fit-content; color: #0000ee; text-decoration: underline; cursor: pointer; }
.control-help dl { display: grid; grid-template-columns: 80px 1fr; gap: 6px 14px; max-width: 500px; margin: 14px 0; }
.control-help dd { margin: 0; }
.control-help dt { color: #666; }
.control-settings { display: grid; grid-template-columns: 130px minmax(100px, 220px); gap: 10px 14px; align-items: center; max-width: 500px; margin-bottom: 20px; }
.control-settings output { color: #666; }
.control-settings input[type="range"] { width: 100%; margin: 0; accent-color: #555; }
.steady-setting { grid-column: 1 / -1; }
.steady-setting span { display: block; margin: 4px 0 0 22px; color: #666; }

@media (pointer: coarse) {
  .touch-controls, .touch-height { display: grid; }
  .touch-hint { display: inline; }
  .desktop-hint, .enter-world { display: none; }
  .leave-fullscreen { top: 15px; bottom: auto; right: 16px; }
}
