/**
 * Mobile Button Positioning - Ensures buttons don't obstruct game controls
 */

@media (max-width: 900px) {
  /* Chat button - bottom right corner, above action bar */
  .bj-chat-toggle {
    position: fixed !important;
    bottom: 90px !important;
    right: 12px !important;
    top: auto !important;
    left: auto !important;
    width: 52px !important;
    height: 52px !important;
    z-index: 10002 !important;
  }
  
  /* Fullscreen button - bottom left corner, above action bar */
  .fullscreen-toggle {
    position: fixed !important;
    bottom: 90px !important;
    left: 12px !important;
    top: auto !important;
    right: auto !important;
    width: 52px !important;
    height: 52px !important;
    z-index: 10001 !important;
  }
  
  /* Ensure buttons are above game table but below modals */
  body:not(.modal) .bj-chat-toggle,
  body:not(.modal) .fullscreen-toggle {
    pointer-events: all !important;
    touch-action: manipulation !important;
  }
  
  /* When action bar is visible, move buttons up slightly */
  body:has(.action-bar:not(.hidden)) .bj-chat-toggle,
  body:has(.action-bar:not(.hidden)) .fullscreen-toggle {
    bottom: 95px !important;
  }
  
  /* When betting controls are visible, move buttons up more */
  body:has(.betting-controls:not(.hidden)) .bj-chat-toggle,
  body:has(.betting-controls:not(.hidden)) .fullscreen-toggle {
    bottom: 95px !important;
  }
  
  /* Small screen adjustments */
  @media (max-width: 568px) and (orientation: landscape) {
    .bj-chat-toggle {
      width: 48px !important;
      height: 48px !important;
      bottom: 75px !important;
      right: 10px !important;
      font-size: 1.3rem !important;
    }
    
    .fullscreen-toggle {
      width: 48px !important;
      height: 48px !important;
      bottom: 75px !important;
      left: 10px !important;
      font-size: 1.2rem !important;
    }
  }
  
  /* Very small screens - make buttons even smaller */
  @media (max-height: 400px) {
    .bj-chat-toggle,
    .fullscreen-toggle {
      width: 44px !important;
      height: 44px !important;
      bottom: 70px !important;
    }
    
    .bj-chat-toggle {
      font-size: 1.2rem !important;
    }
    
    .fullscreen-toggle {
      font-size: 1.1rem !important;
    }
  }
}

/* Desktop - keep buttons out of the way or hide them */
@media (min-width: 901px) {
  .fullscreen-toggle {
    display: none !important;
  }
  
  /* Chat toggle not needed on desktop - chat is always visible sidebar */
  .bj-chat-toggle {
    display: none !important;
  }
}

