html, body { margin: 0; height: 100%; overflow: hidden; background: #000; }
body { cursor: pointer; }

#hello {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  /* Monospace, scaled to the smaller window dimension (ticket #5) so the 16
     characters fill about 58% of the width at most and always leave room to bounce. */
  font: bold max(1rem, min(6vw, 12vh)) ui-monospace, monospace;
  white-space: nowrap;
  /* Solid colour, not gradient text: background-clip:text stops painting in some
     browsers once the script moves the element onto its own layer (ticket #1). */
  color: red;
  animation: rainbow 3s linear infinite;
  cursor: grab;
  touch-action: none; /* lets touch screens drag it instead of scrolling or zooming (ticket #6) */
}
#hello.dragging { cursor: grabbing; user-select: none; }

@keyframes rainbow {
  0%, 100% { color: red; }
  17% { color: orange; }
  33% { color: yellow; }
  50% { color: lime; }
  67% { color: cyan; }
  83% { color: violet; }
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  padding: .5rem 1rem;
  border-radius: .4rem;
  background: #fff;
  color: #000;
  font: 1rem system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
}
#toast.show { opacity: 1; }

/* Temporary textarea used by the clipboard fallback. */
.offscreen { position: fixed; top: 0; left: -9999px; }
