/* 手机端适配：iPhone 竖屏优先 */
@media (max-width: 860px) {
  html, body { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
  .app { padding-left: 12px; padding-right: 12px; }
  .page-head h1 { font-size: 20px; }
  .gshell { max-width: none; }
  .gshell-top { gap: 10px; margin-bottom: 12px; }
  .gshell-back { width: 36px; height: 36px; flex: 0 0 auto; }
  .gshell-title { font-size: 17px; }

  /* 舞台：给游戏一个确定高度，别再靠 min-height 撑破裁剪 */
  .gshell-stage {
    height: 58vh;
    min-height: 330px !important;
    max-height: 560px !important;
    aspect-ratio: auto !important;
    border-radius: 14px;
  }
  .fps-host, .drama-host, .rpg-host { min-height: 0 !important; height: 100%; }
  .fps, .drama { position: absolute; inset: 0; }

  .gshell-controls { flex-wrap: wrap; gap: 8px; }
  .gshell-controls .btn { flex: 1 1 auto; min-width: 104px; min-height: 44px; }

  /* 触控：禁掉滚动与选中，避免拖准星时页面跟着动 */
  .fps, .drama { touch-action: none; -webkit-user-select: none; user-select: none; }
  .fps { cursor: default; }
  .fps-scene, .drama-scene { touch-action: none; }

  /* 右侧任务栏改成可收起的底部抽屉 */
  .fps .fps-side, .drama .dr-side {
    left: 10px; right: 10px; top: auto; bottom: 68px;
    width: auto !important;
    max-height: 54%;
    overflow-y: auto;
    padding-bottom: 2px;
    transform: translateY(calc(100% + 96px));
    transition: transform .26s cubic-bezier(.2,.8,.2,1);
    z-index: 9;
    border-radius: 14px;
    background: rgba(7,8,10,.94);
    box-shadow: 0 -10px 30px rgba(0,0,0,.5);
    padding: 8px;
  }
  .fps.is-sheet .fps-side, .drama.is-sheet .dr-side { transform: translateY(0); }

  .fp-sheet, .dr-sheet {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 10px; z-index: 10;
    height: 34px; padding: 0 12px; z-index: 12;
    border-radius: 999px;
    font-size: 12px; letter-spacing: .04em;
    color: #F2E9D8;
    background: rgba(10,11,13,.78);
    border: 1px solid rgba(220,205,175,.24);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .fp-sheet { left: 10px; right: auto; }
  .dr-sheet { right: 10px; left: auto; }
  .fp-sheet.is-on, .dr-sheet.is-on { background: rgba(230,192,122,.9); color: #17130C; border-color: transparent; }

  /* 射击：屏息 / 换弹 触控按钮 */
  .fp-touch {
    position: absolute; left: 12px; bottom: 12px; z-index: 8;
    display: flex; gap: 10px; pointer-events: auto;
  }
  .fp-touch button {
    width: 56px; height: 56px; border-radius: 50%;
    font-size: 13px; color: #F2E9D8;
    background: rgba(10,11,13,.72);
    border: 1px solid rgba(220,205,175,.26);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .fp-touch button:active { background: rgba(230,192,122,.85); color: #17130C; }

  /* 剧情：字幕与选项别顶到任务按钮 */
  .dr-text { font-size: 15px; line-height: 1.8; }
  .dr-choices { max-height: 46%; overflow-y: auto; }
  .dr-choice b { font-size: 14px; }

  /* 过场：logo / 忠告 / 开始界面 */
  .cn-card { width: min(92vw, 520px); padding: 22px 20px; }
  .cn-card h2 { font-size: 22px; }
  .cn-btn { min-height: 46px; }
  .cn-logo { transform: scale(.82); }
}

@media (max-width: 420px) {
  .gshell-stage { height: 62vh; min-height: 300px !important; max-height: 520px !important; }
  .fp-touch button { width: 50px; height: 50px; font-size: 12px; }
  .cn-card h2 { font-size: 19px; }
}

/* ?????? */
@media (max-width: 860px) {
  .dr-top { left: 12px; top: 10px; gap: 6px; font-size: 10px; max-width: 56%; }
  .dr-memo { display: none !important; }
  .dr-subs, .dr-choices {
    left: 12px !important; right: 12px !important; bottom: 12px !important;
    padding: 12px 14px 14px !important;
    min-height: 0 !important; max-height: 66% !important;
    overflow-y: auto;
  }
  .dr-text { font-size: 14.5px; line-height: 1.8; }
  .dr-who { font-size: 11px; margin-bottom: 5px; }
  .dr-chapter { width: min(88%, 420px) !important; padding: 18px 16px; }
}
