.oeaf-gyro-test,
.oeaf-gyro-test * {
  box-sizing: border-box;
}

.oeaf-gyro-test {
  position: absolute;
  bottom: max(0.875rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 40;
  display: none;
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  transform: translateX(-50%);
}

.oeaf-gyro-test[hidden] {
  display: none !important;
}

.oeaf-gyro-test-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  min-height: 44px;
  padding: 0;
  border: 1.35px solid #fff;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.2;
  touch-action: manipulation;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.oeaf-gyro-test-button[aria-pressed="true"] {
  background: #fff;
  color: #000;
}

.oeaf-gyro-test-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.oeaf-gyro-phone {
  position: relative;
  display: block;
  width: 14px;
  height: 23px;
  border: 1.6px solid currentColor;
  border-radius: 3px;
  transform: rotate(-12deg);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.oeaf-gyro-phone::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
}

.oeaf-gyro-test-button[aria-pressed="true"] .oeaf-gyro-phone {
  animation: oeaf-gyro-phone-balance 2.6s ease-in-out infinite;
}

.oeaf-gyro-label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  width: max-content;
  padding: 0.42rem 0.62rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms linear, transform 140ms ease;
}

.oeaf-gyro-test-button:hover .oeaf-gyro-label,
.oeaf-gyro-test-button:focus-visible .oeaf-gyro-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.oeaf-gyro-test-status {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  width: max-content;
  max-width: min(17rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.42rem 0.62rem;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.3;
  text-align: center;
  transform: translateX(-50%);
}

.oeaf-gyro-test-status:empty {
  display: none;
}

@keyframes oeaf-gyro-phone-balance {
  0%, 100% { transform: rotate(-13deg); }
  50% { transform: rotate(13deg); }
}

@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .oeaf-gyro-test {
    display: block;
  }

  .oeaf-has-gyro-control .oeaf-scroll-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oeaf-gyro-test-button[aria-pressed="true"] .oeaf-gyro-phone {
    animation: none;
  }
}
