/* amittechguy.in, world view: the visitor: touch joystick, the bike's button, hints. */

/* how to move: a few words low on the screen, gone after the visitor's first own move (player.js adds .gone) */
.life-hint, .life-joy, .life-ride { display: none; }
.gl .life-hint {
  display: block; position: fixed; z-index: 15; left: 50%; bottom: clamp(12px, 2.4vw, 28px); translate: -50% 0;
  width: max-content; max-width: min(27rem, calc(100vw - 24px)); margin: 0; padding: 8px 16px;
  font-size: .9rem; font-stretch: 94%; line-height: 1.35; text-align: center; color: var(--ink);
  background: rgba(255, 255, 255, .92); border: 1.5px solid color-mix(in srgb, var(--ink) 16%, #fff); border-radius: 14px;
  pointer-events: none; transition: opacity .4s ease, visibility .4s;
}
.gl .life-hint.gone { opacity: 0; visibility: hidden; }
.life-hint b { font-weight: 720; }
.life-hint .touch { display: none; }

/* where the main pointer is a finger: the stick sits bottom left, above the Back button and above the card (exhibits.js sets
   --sheet to the card's height), and the hint beside it. Stick and button stay under the card: a tap on a card is the card's */
@media (pointer: coarse) {
  .gl .life-joy {
    display: block; position: fixed; z-index: 9; left: calc(14px + env(safe-area-inset-left, 0px)); bottom: calc(var(--pin) + var(--sheet, 0px) + 8px);
    width: 116px; height: 116px; border-radius: 50%;
    background: rgba(255, 255, 255, .62); border: 2px solid color-mix(in srgb, var(--ink) 28%, transparent);
    touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  }
  .gl .life-joy[hidden], .gl:has(.beat.open) .life-joy { display: none; } /* an open card leaves no room for it */
  .life-joy i { /* the knob; player.js moves it with --x and --y */
    position: absolute; inset: 0; margin: auto; width: 50px; height: 50px; border-radius: 50%;
    background: #fff; border: 2px solid var(--ink); box-shadow: 0 6px 14px -8px rgba(16, 17, 20, .6);
    translate: var(--x, 0px) var(--y, 0px);
  }
  .gl .life-hint {
    left: calc(144px + env(safe-area-inset-left, 0px)); right: 12px; bottom: calc(var(--pin) + var(--sheet, 0px) + 124px); translate: 0 100%; /* level with the stick's top: the rider and the bike stand just above the card */
    width: auto; max-width: 15rem; text-align: left;
  }
  /* the bike's button (bike.js): Ride / Get off, top right under the bar, clear of the cards and the stepper */
  .gl .life-ride {
    display: block; position: fixed; z-index: 9; right: calc(10px + env(safe-area-inset-right, 0px)); top: calc(var(--bar, 64px) + 10px);
    height: 44px; padding: 0 20px; border-radius: 22px; border: 0;
    font: inherit; font-weight: 720; font-size: .95rem; color: #fff; background: var(--ink);
    box-shadow: 0 8px 20px -12px rgba(16, 17, 20, .6); touch-action: manipulation; user-select: none; -webkit-user-select: none;
  }
  .life-hint .keys { display: none; }
  .life-hint .touch { display: inline; }
}
