/* The "rotate your phone" card (rotate-prompt.js): phones held sideways only. It covers the page,
   the ball and the CRT frame; the phone in the drawing turns upright to show what to do. */
#lifeform-rotate {
  display: none;
}

@media (orientation: landscape) and (max-height: 500px) and (hover: none) and (pointer: coarse) {
  #lifeform-rotate {
    align-items: center;
    background: #140f0f;
    color: #fdfdf8;
    display: flex;
    flex-direction: column;
    font-family: Inter, system-ui, sans-serif;
    gap: 2px;
    inset: 0;
    justify-content: center;
    position: fixed;
    text-align: center;
    touch-action: none;
    z-index: 2147483100;
  }

  #lifeform-rotate svg {
    fill: none;
    height: min(58vh, 200px);
    overflow: visible;
    stroke: #fdfdf8;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 4;
    width: auto;
  }

  #lifeform-rotate .lifeform-rotate-arrows {
    stroke: #f4ff8e;
  }

  #lifeform-rotate .lifeform-rotate-phone {
    animation: lifeform-rotate-turn 3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    transform-box: view-box;
    transform-origin: 50% 50%;
  }

  #lifeform-rotate p {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
  }

  #lifeform-rotate small {
    color: #f4ff8e;
    font-size: 14px;
    line-height: 1.3;
  }
}

/* Starts sideways (as the phone is held), turns upright, holds, repeats. */
@keyframes lifeform-rotate-turn {
  0%, 15% { transform: rotate(-90deg); }
  55%, 100% { transform: rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  #lifeform-rotate .lifeform-rotate-phone {
    animation: none;
  }
}
