/**
 * Viewport-based game scaling - ensures game fits display without scrolling
 * JS in app.js computes and applies scale; this file provides base styles
 */

/* Scale origin so game shrinks from top-center */
#game-container {
  transform-origin: top center;
}

/* Tablet/small desktop: prevent body scroll when game is scaled */
@media (min-width: 601px) and (max-width: 1024px) {
  body:has(#game-container:not(.hidden)) {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
  }
}

/* HD and short viewports: prevent scroll when scaling is applied via bj-hd-scaled class */
body.bj-hd-scaled:has(#game-container:not(.hidden)) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* Game container fills remaining space below header - prevents bottom clipping */
body.bj-hd-scaled:has(#game-container:not(.hidden)) #game-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Ensure scaled container doesn't cause overflow */
@media (max-width: 1024px) {
  #game-container {
    overflow: hidden;
  }
  
  .game-layout {
    min-height: 0;
  }
}
