/* 最后加载，统一覆盖历史版本相互冲突的手机断点。 */
.narrative-wrap { overflow-anchor: none; scroll-behavior: auto; }
.latest-narrative { float: right; min-height: 32px; }
.latest-narrative.has-new { color: #e8d3a5; border-color: #9b8965; }
@media (max-width: 760px) {
  #screenGame .game { height: 100vh; height: 100dvh; width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  #screenGame .game.rail-off { grid-template-columns: minmax(0, 1fr); }
  #screenGame .game-main { min-width: 0; min-height: 0; }
  #screenGame .game-hud { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); min-width: 0; gap: 6px; padding: 6px 8px; overflow: hidden; }
  #screenGame .game-hud .hudbar { min-width: 0; width: 100%; margin: 0; }
  #screenGame .game-hud .hb-top { gap: 2px; margin-bottom: 3px; }
  #screenGame .game-hud .hb-lb { font-size: 10px; letter-spacing: 0; color: #bdc7d2; }
  #screenGame .game-hud .hb-v { font-size: 11px; color: #e2e7ee; }
  #screenGame .game-hud .hb-track { height: 5px; }
  #screenGame .game-hud .hud-id, #screenGame .game-hud .hud-summary { display: none; }
  #screenGame .statusbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 5px 8px; overflow: visible; }
  #screenGame .statusbar .sb-time { flex: 1 0 100%; min-width: 0; padding: 2px 0; font-size: 12px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; border: 0; background: none; }
  #screenGame .statusbar .btn { flex: 1 1 0; min-width: 0; min-height: 34px; padding: 4px; font-size: 15px; }
  #screenGame .statusbar #btnExpertCfg { display: block; }
  #screenGame .statusbar .sb-btn-label { display: none; }
  #screenGame .narrative-wrap { flex: 1 1 0; min-height: 0; padding: 14px 14px 8px; -webkit-overflow-scrolling: touch; }
  #screenGame .narrative { min-width: 0; }
  #screenGame .narrative p { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
  #screenGame .narr-turn { content-visibility: visible; contain-intrinsic-size: none; }
  #screenGame .hud-goal { flex: 0 0 auto; gap: 6px; margin: 0 8px 4px; padding: 5px 8px; font-size: 11px; line-height: 1.5; }
  #screenGame .hud-goal .hg-lb, #screenGame .hud-goal .hg-risk { font-size: 10px; letter-spacing: 0; }
  #screenGame .suggest-bar { flex: 0 0 auto; display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; max-height: 42px; gap: 6px; padding: 4px 8px; margin: 0; }
  #screenGame .suggest-bar button { flex: 0 0 auto; min-height: 32px; padding: 5px 10px; white-space: nowrap; font-size: 12px; }
  #screenGame .tempbar { flex: 0 0 auto; width: 100%; min-width: 0; max-width: none; margin: 0; padding: 2px 8px 4px; }
  #screenGame .temp-toggle { min-height: 32px; font-size: 12px; }
  #screenGame .latest-narrative { font-size: 11px; }
  #screenGame .temp-body { clear: both; margin-top: 2px; max-height: 124px; overflow-y: auto; overscroll-behavior: contain; }
  #screenGame .temp-body textarea { height: 70px; min-height: 70px; max-height: 90px; resize: none; padding: 6px 8px; font-size: 16px; line-height: 1.4; }
  #screenGame .temp-foot { margin-top: 2px; gap: 6px; }
  #screenGame .temp-hint { font-size: 10px; line-height: 1.35; }
  #screenGame .dicebar { flex: 0 0 auto; max-height: 22dvh; overflow-y: auto; margin: 0 8px; }
  #screenGame .composer { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 5px; padding: 6px 8px max(8px, env(safe-area-inset-bottom)); }
  #screenGame .composer #btnDirector008 { grid-column: 1; grid-row: 1; justify-self: start; min-height: 32px; font-size: 11px; padding: 4px 8px; }
  #screenGame .composer #btnDice { grid-column: 2 / 4; grid-row: 1; justify-self: end; min-height: 32px; padding: 4px 10px; font-size: 12px; }
  #screenGame .composer #actionInput { grid-column: 1 / 3; grid-row: 2; width: 100%; min-width: 0; min-height: 42px; padding: 8px; font-size: 16px; }
  #screenGame .composer #btnSend { grid-column: 3; grid-row: 2; min-width: 66px; min-height: 42px; padding: 0 9px; font-size: 13px; }
  #screenGame .director008-status { flex: 0 0 auto; max-height: 52px; overflow-y: auto; padding: 3px 8px; margin: 0 8px 4px; font-size: 11px; }
}
@media (max-width: 760px) and (max-height: 520px) {
  #screenGame .game-hud, #screenGame .hud-goal, #screenGame .suggest-bar { display: none; }
  #screenGame .game { grid-template-rows: minmax(0, 1fr); }
  #screenGame .statusbar .sb-time { flex: 1 1 140px; font-size: 11px; }
  #screenGame .statusbar .btn { flex: 0 0 30px; min-height: 30px; }
  #screenGame .temp-body { max-height: 85px; }
  #screenGame .temp-foot { display: none; }
}

/* 顶栏快捷入口：手机不依赖被隐藏的左侧信息柱。 */
.sb-portrait {width:38px;height:38px;flex:0 0 38px;padding:0;overflow:hidden;border:1px solid var(--line,#52606d);border-radius:50%;background:var(--panel-2,#151e28);cursor:pointer;}
.sb-portrait img {display:block;width:100%;height:100%;object-fit:cover;}
.sb-portrait:focus-visible {outline:2px solid var(--gold,#c5b18f);outline-offset:3px;}
@media (max-width:760px) {
  #screenGame .statusbar #btnArchive {display:block;}
  #screenGame .statusbar .sb-portrait {width:34px;height:34px;flex:0 0 34px;min-width:34px;}
  #screenGame .statusbar #btnArchive .sb-btn-label {display:inline;font-size:11px;}
  #screenGame .statusbar #btnArchive {flex:0 0 61px;}
}
