#mobile-game-controls {
  display: none;
}

@media (max-width: 1024px), (pointer: coarse) {
  #mobile-game-controls {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    font-family: Arial, sans-serif;
  }

  #mobile-fullscreen-button {
    position: absolute;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    min-width: 58px;
    min-height: 58px;
    padding: 10px 14px;
    border: 2px solid rgba(255,255,255,.85);
    border-radius: 18px;
    background: rgba(13, 22, 34, .86);
    color: white;
    font-size: 24px;
    box-shadow: 0 5px 20px rgba(0,0,0,.4);
    pointer-events: auto;
    touch-action: manipulation;
  }

  #rotate-device-message {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 18px;
    padding: 30px;
    box-sizing: border-box;
    background: rgba(8, 13, 21, .96);
    color: white;
    text-align: center;
    pointer-events: auto;
  }

  #rotate-device-message .rotate-icon {
    font-size: 68px;
    animation: rotate-phone 1.8s ease-in-out infinite;
  }

  #rotate-device-message strong {
    font-size: 24px;
  }

  #rotate-device-message span {
    max-width: 360px;
    color: #cbd8e8;
    font-size: 16px;
  }

  #rotate-device-message button {
    padding: 14px 22px;
    border: 0;
    border-radius: 12px;
    background: #2b7cff;
    color: white;
    font-size: 17px;
    font-weight: bold;
  }

  @media (orientation: portrait) {
    #rotate-device-message {
      display: flex;
    }

    #mobile-fullscreen-button {
      display: none;
    }
  }
}

@keyframes rotate-phone {
  0%, 25% { transform: rotate(0deg); }
  65%, 100% { transform: rotate(90deg); }
}
