  html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
  canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
  body.idle { cursor: none; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #fallback { display: none; }
  body.nogl canvas { display: none; }
  body.nogl #fallback {
    display: block; position: fixed; inset: 0;
    background: linear-gradient(120deg, #ff3cac, #784ba0, #2b86c5, #00f5a0, #ffe066, #ff3cac);
    background-size: 600% 600%; animation: drift 90s ease-in-out infinite alternate;
  }
  #fallback span {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg);
    font: italic 300 12vw Didot, "Bodoni 72", Georgia, serif; color: #fff;
    opacity: 0; filter: blur(3px); animation: ghost 47s ease-in-out infinite;
  }
  #ear {
    position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
    width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #fff; cursor: pointer;
    opacity: .35; transform: scale(var(--p, 1)); transition: opacity 1.2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  #ear svg { width: 100%; height: 100%; display: block; }
  #ear.on { opacity: .6; }
  #ear.denied { opacity: .12; }
  body.idle #ear { opacity: 0; pointer-events: none; }
  body.beckon #ear { opacity: .75; pointer-events: auto; } /* the first-visit hint points at the ring */
  body.nogl #ear, body.nogl #hint { display: none; }
  /* share: the ring's mirror in the other corner (the hint line clears both), shown and faded with it */
  #share {
    position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom));
    width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #fff; cursor: pointer;
    opacity: .35; transition: opacity 1.2s ease; -webkit-tap-highlight-color: transparent;
  }
  #share svg { width: 100%; height: 100%; display: block; }
  body.idle #share { opacity: 0; pointer-events: none; }
  body.nogl #share, #share[hidden] { display: none; }
  #hint {
    position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    width: max-content; max-width: calc(100vw - 152px); text-align: center; text-wrap: balance; /* clears the ring on both sides */
    font: italic 300 15px/1.4 Didot, "Bodoni 72", Georgia, serif; letter-spacing: .04em; color: #fff;
    text-shadow: 0 0 12px rgba(0, 0, 0, .6); opacity: 0; transition: opacity 1.5s ease; pointer-events: none;
  }
  #hint.show { opacity: .7; }
  #hint.show.offer { pointer-events: auto; cursor: pointer; } /* the fullscreen hint can be tapped */
  #keys {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: max-content; max-width: calc(100vw - 32px); padding: 18px 22px; border-radius: 10px;
    background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; pointer-events: none; transition: opacity .4s ease;
    font: 14px/1.7 ui-monospace, Menlo, monospace;
  }
  #keys.show { opacity: .85; }
  #keys b { display: inline-block; min-width: 4.5em; font-weight: 600; }
  body:not(.dj) #keys .dj-only, body.dj #keys .plain-only { display: none; }
  #keys p { margin: 0 0 6px; font: italic 300 15px Didot, "Bodoni 72", Georgia, serif; letter-spacing: .04em; }
  /* touch menu: hold anywhere on a touch screen */
  body { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  #menu {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; gap: 4px; min-width: 220px; max-width: calc(100vw - 32px); padding: 14px;
    border-radius: 14px; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .3s ease;
  }
  #menu.show { opacity: .92; pointer-events: auto; }
  #menu button {
    padding: 12px 16px; border: 0; border-radius: 9px; background: none; color: #fff; text-align: center;
    font: italic 300 19px Didot, "Bodoni 72", Georgia, serif; letter-spacing: .04em; -webkit-tap-highlight-color: transparent;
  }
  #menu button:active { background: rgba(255, 255, 255, .12); }
  #menu button[hidden] { display: none; }
  body.nogl #menu { display: none; }
  @keyframes drift { 0% { background-position: 0% 50%; } 100% { background-position: 100% 50%; } }
  @keyframes ghost { 0%, 70%, 100% { opacity: 0; } 82% { opacity: .07; } }
