/* Shared mobile hardening for Board With Games game pages */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font-size: 16px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  touch-action: manipulation;
}

@media (max-width: 900px) {
  .layout,
  .page,
  .app,
  .shell,
  .container,
  .game-shell,
  .board-shell,
  .main-shell {
    width: 100% !important;
    max-width: 100% !important;
  }

  .layout,
  .page,
  .app,
  .shell,
  .container,
  .game-shell,
  .board-shell,
  .main-shell,
  .hero__layout {
    grid-template-columns: 1fr !important;
  }

  .sidebar,
  .aside,
  .panel.sidebar,
  .right-panel,
  .left-panel {
    width: 100% !important;
    max-width: 100% !important;
  }

  .toolbar,
  .controls,
  .actions,
  .hud,
  .topbar,
  .header,
  .statusbar {
    flex-wrap: wrap !important;
  }

  .btn,
  button {
    min-height: 44px;
  }

  .scroll,
  .board,
  .table,
  .playfield,
  .canvas-wrap,
  .game-area {
    width: 100% !important;
    max-width: 100% !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .battlefield,
  .battle-grid,
  .game-grid,
  .board-grid,
  .play-grid,
  .cards-grid,
  .hands-grid,
  .pile-grid,
  .stats-grid,
  .controls-grid {
    grid-template-columns: 1fr !important;
  }

  .card,
  .tile,
  .piece,
  .chip,
  .square,
  .cell {
    min-width: 0;
  }

  .board-shell,
  .board-wrap,
  .table-shell,
  .table-wrap,
  .grid-shell,
  .play-shell,
  .game-shell {
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .board,
  .table,
  .grid,
  .playfield,
  .grid-board {
    transform-origin: top center;
  }

  .top-buttons,
  .action-row,
  .controls-row,
  .btn-row {
    justify-content: center !important;
  }
}

@media (max-width: 720px) {
  .hide-mobile,
  .mobile-hidden,
  .desktop-only {
    display: none !important;
  }

  .show-mobile,
  .mobile-only {
    display: block !important;
  }

  .title,
  .game-title,
  .status-line,
  .topbar__title {
    max-width: 100% !important;
    white-space: normal !important;
  }

  .hud,
  .topbar,
  .header {
    gap: 8px !important;
  }

  .board,
  .playfield,
  .canvas-wrap,
  .table {
    max-height: none !important;
  }

  .title-area,
  .header-left,
  .header-right,
  .status-wrap {
    text-align: center !important;
  }

  .stats-grid,
  .hud-grid,
  .info-grid,
  .panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
