/* 休闲游戏 / 页面加载器：小屏下取消一切外框与留白，把空间全部交给内容 */
@media (max-width: 700px) {
  /* 全站移动导航组件会撑宽布局视口，游戏页直接禁用 */
  body.casual-game-page .tom-r-fab,
  body.casual-game-page #tomRFab,
  body.casual-game-page .tom-r-scrim,
  body.casual-game-page .tom-r-panel,
  body.casual-game-page #tomRPanel {
    display: none !important;
  }

  body.casual-game-page,
  body.casual-game-page #game-wrapper,
  body.casual-game-page .game-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  body.casual-game-page #game-wrapper,
  body.casual-game-page .game-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
  }

  /* 游戏画布区铺满，去掉画布容器自身的边框/阴影 */
  body.casual-game-page #canvasContainer,
  body.casual-game-page .canvas-container,
  body.casual-game-page #game-area {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
  }

  body.casual-game-page canvas {
    max-width: 100% !important;
    max-height: 100% !important;
  }

  /* 原右侧说明/设置改为底部条，限高可滚动，不抢画面 */
  body.casual-game-page .sidebar,
  body.casual-game-page #controls-panel {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 36vh !important;
    max-height: 36dvh !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  /* 贪吃蛇底部抽屉：保留开关，抽屉本身不再有边框 */
  body.casual-game-page #sidebar {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* 页面加载器：加载进来的页面同样铺满，控件栏压到最薄 */
  body.casual-game-page #container {
    height: 100vh !important;
    height: 100dvh !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  body.casual-game-page #iframe-container {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  body.casual-game-page #contentFrame {
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  body.casual-game-page #controls {
    padding: 6px 8px !important;
    border: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  /* 工作台游戏弹窗的小屏外框与留白一起去掉 */
  #modal-game-runner.game-modal-custom {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  #modal-game-runner .tool-modal-body,
  #modal-game-runner.fullscreen .tool-modal-body {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}
