/* 移动端适配优化（共享） */
html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@media (max-width: 640px) {
  /* 魔方：面板抬到导航条上方，避免右下角重叠 */
  #panel { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); gap: 7px; padding: 10px 10px; }
  #panel button { font-size: 14px; padding: 12px 12px; }
  #title { font-size: 16px; }
  #title small { font-size: 11px; }
  #timer { font-size: 26px; }
  #timer .label { font-size: 10px; }
  #move-count, #layer-ind { font-size: 12px; }
  #help { font-size: 12px; line-height: 1.7; }

  /* 鼓机：底部留出导航空间 + 更大控件 */
  body { padding-bottom: 84px; }
  #transport { gap: 8px; padding: 10px 12px; }
  #transport .btn { font-size: 14px; padding: 11px 13px; }
  #btnPlay { width: 56px; height: 56px; }
  input[type=range] { width: 88px; }
  .pad { min-height: 62px; }

  /* 象棋：顶部栏换行 + 底部留白 */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .app { padding-bottom: 60px; }
}
