/* Shared live-view trackpad + local pointer + overlay keyboard.
   Fullscreen + coarse pointer only. PiP and desktop mouse stay untouched. */

.live-trackpad-cursor,
.live-trackpad-pad,
.live-trackpad-surface {
  display: none;
}

.is-live-trackpad.is-trackpad-cursor-placed .live-trackpad-cursor,
.is-live-trackpad .live-trackpad-surface {
  display: block;
}

/* Above .gl-live-frame-shield (z-index 4) so a leftover shield cannot eat the tap. */
.is-live-trackpad .live-trackpad-surface {
  z-index: 6;
}

.is-live-trackpad {
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.is-live-trackpad iframe {
  z-index: 0;
  pointer-events: none !important;
}

.live-trackpad-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  z-index: 7;
  pointer-events: none;
  will-change: transform;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
  overflow: visible;
}

/* The picture itself is the trackpad. No side strip. */
.live-trackpad-surface {
  position: absolute;
  inset: 0;
  z-index: 3;
  touch-action: none;
  overscroll-behavior: none;
  background: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.live-trackpad-surface.is-pressed {
  background: rgba(255, 255, 255, 0.04);
}

.live-trackpad-surface__hint,
.live-trackpad-surface__status {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(22, 22, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
}

.live-trackpad-surface.is-moved .live-trackpad-surface__hint {
  display: none;
}

.live-trackpad-surface__status {
  bottom: auto;
  top: 12px;
}

.live-trackpad-cursor svg {
  display: block;
}

.live-trackpad-pad {
  position: absolute;
  top: 10px;
  right: 8px;
  bottom: 10px;
  width: min(42vw, 220px);
  z-index: 3;
  pointer-events: auto;
  touch-action: none;
  overscroll-behavior: none;
  border-radius: 18px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 28%,
    rgba(255, 255, 255, 0.09) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.live-trackpad-pad__hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.is-live-trackpad.is-live-trackpad--moved .live-trackpad-pad__hint,
.live-trackpad-pad.is-moved .live-trackpad-pad__hint {
  opacity: 0;
}

.is-live-trackpad:has(.live-vkeyboard:not([hidden])) .live-trackpad-pad {
  bottom: 168px;
}

@media (orientation: landscape) {
  .live-trackpad-pad {
    width: min(32vw, 240px);
  }
}

.live-vkeyboard {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--gl-demo-footer-h, 0px) + env(safe-area-inset-bottom, 0px));
  z-index: 93;
  padding: 0.4rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: #1c1c1e;
  touch-action: manipulation;
}

.is-live-trackpad .live-vkeyboard:not([hidden]) {
  display: block;
}

.live-vkeyboard__row {
  display: flex;
  justify-content: center;
  gap: 0.28rem;
  margin: 0.22rem 0;
}

.live-vkeyboard__key {
  flex: 1 1 0;
  min-width: 0;
  height: 42px;
  border: 0;
  border-radius: 6px;
  background: #3a3a3c;
  color: #f4f4f5;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}

.live-vkeyboard__key:active {
  background: #636366;
}

.live-vkeyboard__key--space {
  flex: 3.2 1 0;
}

.live-vkeyboard__key--mod {
  flex: 1.35 1 0;
  font-size: 0.72rem;
}

.browser-pip-bar-actions,
.gl-pip-dock__bar-actions {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
}

.is-live-trackpad-chrome .browser-pip-bar-actions,
.gl-pip-dock.is-live-trackpad-chrome .gl-pip-dock__bar-actions {
  display: inline-flex;
}

.browser-pip-kb-toggle,
.gl-pip-dock__kb {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}

.browser-pip-kb-toggle--open,
.gl-pip-dock__kb.is-open {
  border-color: rgba(110, 168, 254, 0.55);
  background: rgba(110, 168, 254, 0.16);
}
