/* Shopify iframe 适配样式 */
/* 确保游戏在 iframe 中正确显示和居中 */

/* 确保 HTML 和 Body 占满整个容器 */
html, body {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

* { 
  box-sizing: border-box; 
}

/* 确保 Canvas 容器正确适配 */
#Cocos2dGameContainer {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important; /* Ensure flexbox for centering */
  justify-content: center !important;
  align-items: center !important;
}

/* Canvas 自适应 */
#GameCanvas {
  display: block !important;
  margin: auto !important; /* Center the canvas */
  object-fit: contain; /* Keep aspect ratio, fit within container */
  width: auto !important; /* Let engine control width */
  height: auto !important; /* Let engine control height */
  max-width: 100% !important;
  max-height: 100% !important;
}

/* 确保在 iframe 中正常显示 */
body {
  position: relative !important;
  min-width: 100% !important;
  min-height: 100% !important;
}
