/* =====================================================
   love with 一高 —— iOS PWA 追加样式 v1
   仅处理 iOS 环境差异：安全区域 / 回弹 / 长按 / 竖屏提示
   不改动原引擎的任何布局数值（逻辑分辨率仍为 1600x720）
   ===================================================== */

/* 1. 禁止整页橡皮筋回弹与下拉刷新；关闭双击缩放延迟 */
html, body {
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

/* 舞台内允许连点，不做双击缩放 */
#stage, #stage * {
  touch-action: manipulation;
}

/* 需要滚动的子页面恢复原生滚动 */
.flow-canvas, .aff-grid, .bag-grid, .phone-screen {
  touch-action: pan-y pan-x;
  -webkit-overflow-scrolling: touch;
}

/* 舞台充满整个视口，避免安全区域留出黑边 */
html, body { position: fixed; left: 0; right: 0; }

/* 2. 长按不弹出系统菜单（iOS 上长按会选中/放大） */
#stage, #stage * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 3. 输入框仍要允许输入与选中（额外模式邀请码） */
#stage input, #stage textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* 4. 点击反馈：iOS 上 :active 需要 touch 事件兜底 */
.menu-item:active, .modal-btn:active, .choice-btn:active,
.topbar-btn:active, .extra-card:active, .fc-chip:active {
  opacity: .82;
}

/* 5. 安全区域：把舞台可用高度告诉 JS，UI 本身不做位移，
      只在竖屏提示层使用安全区域内边距 */
#ios-rotate {
  position: fixed; left: 0; top: 0; z-index: 99999;
  width: 100%; height: 100%;
  display: none;
  align-items: center; justify-content: center;
  background: #0b0810;
  padding: calc(env(safe-area-inset-top) + 20px) 24px
           calc(env(safe-area-inset-bottom) + 20px) 24px;
  box-sizing: border-box;
  text-align: center;
}
#ios-rotate .rot-icon { font-size: 64px; line-height: 1; }
#ios-rotate .rot-title {
  margin-top: 26px; font-size: 26px; letter-spacing: 6px; color: #fff;
  font-family: "PingFang SC","Noto Sans SC",sans-serif;
}
#ios-rotate .rot-sub {
  margin-top: 14px; font-size: 15px; line-height: 1.9; letter-spacing: 2px;
  color: rgba(255,255,255,.6);
  font-family: "PingFang SC","Noto Sans SC",sans-serif;
}
#ios-rotate .rot-tip {
  margin-top: 22px; font-size: 13px; letter-spacing: 1px;
  color: rgba(255,255,255,.35);
  font-family: "PingFang SC","Noto Sans SC",sans-serif;
}

/* 6. 独立模式（已添加到主屏幕）下隐藏任何残留的网页痕迹 */
@media (display-mode: standalone) {
  html, body { background: #0b0810; }
}
