/* 游戏中界面（参考 1in8b 的紧凑布局）：顶栏+控件行 sticky，其余整页滚动；沿用 --px-* 色板、像素字体、方角边框。在 layout.css 之后加载 */
#screen-game, #screen-game button, #screen-game input, #screen-game summary { font-family: var(--px-font, inherit); }
#screen-game { max-width: 100%; }
.play-top { position: sticky; top: 0; z-index: 6; background: var(--bg); padding-top: env(safe-area-inset-top); border-bottom: 2px solid var(--px-wood-dark); }
.game .topbar { position: static; display: block; padding: 4px 0 0; border: 0; }
.tb-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.tb-age b { font-size: 32px; line-height: 1; font-weight: 400; color: var(--px-red-dark); }
.tb-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 5px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; font-size: 13px; }
.tb-info::-webkit-scrollbar { display: none; }
.tb-sep { color: var(--muted); }
.game .year-bar { height: 3px; border-radius: 0; margin-top: 3px; }
.game .life-line { height: 2px; margin: 1px 0 3px; }
.game .controls { display: flex; align-items: center; gap: 4px; padding: 0 0 6px; flex-wrap: nowrap; min-height: 44px; position: relative; }
.game .controls .btn { min-height: 44px; border-radius: 0; border: 2px solid var(--px-wood-dark); background: var(--px-paper); }
.game .controls .btn.tiny { min-height: 44px; min-width: 32px; padding: 0 4px; font-size: 12px; border: 0; background: transparent; }
.game .controls .btn.tiny.on, .game .controls .pause.on { background: var(--px-gold); color: var(--px-wood-dark); }
.game .controls .pause { border: 2px solid var(--px-wood-dark); flex: none; width: 40px; }
.game .speed { display: flex; flex: 1 1 auto; min-width: 0; gap: 0; border: 2px solid var(--px-wood-dark); border-radius: 0; padding: 0; background: var(--px-paper); }
.game .speed .btn { flex: 1 1 0; min-width: 0; }
.game .controls .step { flex: none; padding: 0 8px; font-size: 13px; background: var(--px-wood-light); color: #fff; white-space: nowrap; }
.game .controls .step.urgent { background: var(--px-red); border-color: var(--px-red-dark); }
.game .controls .more { flex: none; width: 40px; padding: 0; }
.menu-wrap { position: relative; flex: none; }
.play-menu { position: absolute; right: 0; top: 100%; margin-top: 4px; z-index: 9; min-width: 180px; display: grid; gap: 2px; padding: 4px; background: var(--px-paper); border: 3px solid var(--px-wood-dark); box-shadow: 4px 4px 0 rgba(60, 35, 15, .35); }
.play-menu .menu-item { min-height: 44px; text-align: left; border-width: 0; background: transparent; display: flex; align-items: center; gap: 6px; padding: 0 10px; }
.game .controls .play-menu .btn { min-height: 44px; border: 0; }
.play-body { padding: 8px 0 72px; display: grid; gap: 8px; }
.play-main { display: grid; gap: 8px; min-width: 0; }
.scene-panel { border: 3px solid var(--px-wood-dark); background: var(--px-paper); }
#scene { width: 100%; height: 140px; aspect-ratio: auto; object-fit: cover; object-position: center bottom; border-radius: 0; display: block; }
.scene-desc { display: block; width: 100%; min-height: 32px; padding: 4px 8px; border: 0; background: transparent; font-size: 13px; color: var(--muted); text-align: left; cursor: pointer; }
.scene-more { padding: 0 8px 6px; font-size: 12px; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.stat-row .stat { display: grid; grid-template-columns: 1fr; gap: 1px; justify-items: center; font-size: 12px; background: var(--px-paper); border: 2px solid var(--px-wood); padding: 3px 2px 0; min-width: 0; }
.stat-row .stat-label { max-width: 100%; font-size: 11px; color: var(--muted); }
.stat-row .stat-val { font-size: 18px; line-height: 1.1; }
.stat-row .bar { display: block; width: calc(100% + 4px); height: 3px; margin: 2px -2px 0; background: #e9e1d2; }
.stat-row .bar i { display: block; height: 100%; }
.finance-strip { display: flex; flex-wrap: wrap; gap: 2px 12px; padding: 5px 8px; background: var(--px-paper); border: 2px solid var(--px-wood); font-size: 12px; cursor: pointer; }
.fin-cell { display: flex; gap: 4px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.fin-k { color: var(--muted); } .fin-n { color: var(--muted); font-size: 11px; }
.fin-hint { flex-basis: 100%; font-size: 10px; }
.game .log-head { display: flex; align-items: center; gap: 8px; }
.game .log-head > span:first-child { flex: 1; }
.btn.tiny.newlog { min-height: 30px; background: var(--px-gold); border: 2px solid var(--px-wood-dark); color: var(--px-wood-dark); }
.btn.tiny.log-collapse { min-height: 30px; padding: 2px 8px; font-size: 12px; border: 2px solid var(--px-wood); background: var(--px-paper); color: var(--px-wood-dark); }
.game .log-head .log-fav { font-size: 11px; opacity: 0.72; margin-left: auto; }
.game .log { max-height: none; overflow: visible; border-top: 2px solid var(--px-wood-dark); }
.game .log .entry { display: flex; gap: 8px; padding: 8px 2px; }
.lm-col { flex: none; width: 36px; text-align: right; font-size: 11px; color: var(--muted); } .lm-col b { display: block; font-size: 20px; line-height: 1.1; color: var(--px-wood-dark); font-weight: 400; }
.lm-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.lm-when { font-size: 11px; color: var(--muted); }
.fold { border: 2px solid var(--px-wood); background: var(--px-paper); }
.fold > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 10px; cursor: pointer; font-size: 14px; }
.fold > summary .muted { font-size: 12px; }
.fold > div, .profile-grid { padding: 0 10px 10px; }
.profile-grid { display: grid; gap: 8px; }
.play-body .panel { border-radius: 0; }
@media (max-width: 340px) { .game .controls { gap: 2px; } .game .controls .step { padding: 0 5px; font-size: 12px; } .game .controls .btn.tiny { min-width: 26px; padding: 0 2px; } .game .controls .pause, .game .controls .more { width: 34px; } }
@media (min-width: 720px) { #app.wide, body.wide #app { max-width: 720px; } .profile-grid { grid-template-columns: 1fr 1fr; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ===== 桌面三栏恢复（>=980）：由 src/ui/layout.js 把面板搬进 #play-cols；手机仍是单列 ===== */
.play-cols { display: none; }
.play-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.play-col > * { min-width: 0; overflow-wrap: anywhere; }
@media (min-width: 980px) {
  #app.wide, body.wide #app { max-width: 1240px; }
  body.cols3 .play-cols { display: grid; grid-template-columns: minmax(190px, 220px) minmax(0, 1fr) minmax(190px, 220px); gap: 12px; align-items: start; }
  body.cols3 .play-cols[hidden] { display: none; }
  body.cols3 .play-main, body.cols3 .profile-fold { display: none; }
  body.cols3 .play-col #scene { max-width: 100%; }
  body.cols3 .play-col .stat-row { grid-template-columns: 1fr; }
  body.cols3 .play-col .focus-fold > div { overflow-wrap: anywhere; }
}
@media (min-width: 1200px) {
  body.cols3 .play-cols { grid-template-columns: minmax(230px, 270px) minmax(0, 1fr) minmax(230px, 270px); }
}

/* ===== 桌面首页改版（>=980 三栏；>=1100 顶栏一行）：日系像素风，方角、硬阴影、米底；不加任何 transition/animation（年条归零 R40） ===== */
.pz-t { display: none; }
.ctl-extra { display: contents; }
.pending-bar .pb-sub, .pending-bar .pb-go { display: none; }
.pending-bar .pb-main { display: inline; }
@media (min-width: 980px) {
  .game .year-bar { height: 6px; margin-top: 4px; border: 1px solid var(--px-wood-dark); background: #e9e1d2; box-sizing: content-box; }
  .game .life-line { height: 3px; margin: 2px 0 4px; }
  body.cols3 .play-col .panel, body.cols3 .play-col .finance-strip, body.cols3 .play-col .scene-panel { box-shadow: 4px 4px 0 rgba(60, 35, 15, .3); }
  body.cols3 .play-col .panel { background: var(--px-paper); border: 3px solid var(--px-wood-dark); padding: 10px 12px; }
  body.cols3 .play-col .panel h4 { font-size: 15px; font-weight: 400; color: var(--px-wood-dark); margin: 0 0 8px; }
  body.cols3 .play-cols { gap: 16px; }
  body.cols3 .play-body { padding-top: 12px; }

  /* 左：身份卡 + 状态 + 财务 */
  body.cols3 #avatar { width: 72px; height: 72px; border: 3px solid var(--px-wood-dark); border-radius: 0; flex: none; }
  body.cols3 .id-top { gap: 12px; margin-bottom: 4px; }
  body.cols3 .id-name { font-size: 22px; font-weight: 400; color: var(--px-wood-dark); }
  body.cols3 .id-rows { grid-template-columns: max-content minmax(0, 1fr); gap: 7px 12px; margin: 10px 0; font-size: 13px; }
  body.cols3 .id-rows dt { white-space: nowrap; }
  body.cols3 .chip { border-radius: 0; border: 2px solid var(--px-wood-light); background: var(--px-cream); }
  body.cols3 .mrz { font-size: 8.5px; letter-spacing: 0; border-radius: 0; border: 2px dashed var(--px-wood-light); background: var(--px-cream); padding: 6px 4px; white-space: nowrap; overflow: hidden; line-height: 1.5; }
  body.cols3 .stat-row { gap: 8px; }
  body.cols3 .stat-row .stat { grid-template-columns: 1fr auto; align-items: baseline; justify-items: stretch; padding: 7px 10px 0; border: 3px solid var(--px-wood-dark); box-shadow: 3px 3px 0 rgba(60, 35, 15, .3); }
  body.cols3 .stat-row .stat-label { font-size: 13px; text-align: left; }
  body.cols3 .stat-row .stat-val { font-size: 22px; text-align: right; }
  body.cols3 .stat-row .bar { grid-column: 1 / -1; width: calc(100% + 20px); height: 5px; margin: 5px -10px 0; }
  body.cols3 .finance-strip { padding: 8px 10px; border: 3px solid var(--px-wood-dark); font-size: 13px; gap: 4px 14px; }

  /* 中：场景 + 重心 + 纪录 + 待选条 */
  body.cols3 .scene-panel { border-width: 4px; background: var(--px-paper); }
  body.cols3 #scene { height: auto; aspect-ratio: 2 / 1; }
  body.cols3 .scene-desc { padding: 8px 12px; font-size: 14px; }
  body.cols3 .scene-more { padding: 0 12px 8px; }
  body.cols3 .focus-fold { border: 3px solid var(--px-wood-dark); box-shadow: 4px 4px 0 rgba(60, 35, 15, .3); }
  body.cols3 .focus-fold > summary { min-height: 40px; font-size: 16px; color: var(--px-wood-dark); list-style: none; pointer-events: none; cursor: default; border-bottom: 2px dashed var(--px-wood-light); }
  body.cols3 .focus-fold > summary::-webkit-details-marker { display: none; }
  body.cols3 .focus-fold > summary .muted { font-size: 12px; }
  body.cols3 .focus-fold > div { padding: 10px 12px 12px; }
  body.cols3 .focus-head { display: none; }
  body.cols3 .focus-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  body.cols3 .btn.small.focus-btn { display: grid; gap: 2px; text-align: left; min-height: 52px; padding: 6px 10px; font-size: 14px; border-radius: 0; border: 2px solid var(--px-wood); background: var(--px-cream); color: var(--px-wood-dark); box-shadow: 2px 2px 0 rgba(60, 35, 15, .25); }
  body.cols3 .focus-btn .f-d { font-size: 11px; color: var(--muted); }
  body.cols3 .focus-btn.on { background: var(--px-gold); border-color: var(--px-wood-dark); color: var(--px-wood-dark); }
  body.cols3 .focus-btn.on .f-d { color: var(--px-wood-dark); }
  body.cols3 .game .log-head, body.cols3 .log-head { font-size: 15px; padding-top: 4px; }
  body.cols3 .pending-bar { position: relative; left: auto; right: auto; bottom: auto; transform: none; z-index: 4; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 3px solid var(--px-red-dark); border-radius: 0; background: var(--px-red); box-shadow: 4px 4px 0 rgba(60, 35, 15, .35); padding: 10px 14px; font-size: 15px; font-family: var(--px-font, inherit); margin-top: 8px; }
  body.cols3 .toast { top: 100px; bottom: auto; }
  body.cols3 .pending-bar[hidden] { display: none; }
  body.cols3 .pending-bar .pb-main { display: block; flex: none; }
  body.cols3 .pending-bar .pb-sub { display: block; flex: 1; min-width: 0; font-size: 12px; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.cols3 .pending-bar .pb-go { display: block; flex: none; margin-left: auto; padding: 4px 10px; background: var(--px-paper); color: var(--px-red-dark); border: 2px solid var(--px-red-dark); font-size: 13px; }

  /* 右：家人（称谓 | 说明 两列；不足 12 行不拉伸）+ 同批 + 人生地图 */
  body.cols3 .fam { gap: 8px; }
  body.cols3 .fam li { display: grid; grid-template-columns: 3.6em minmax(0, 1fr); gap: 0 8px; line-height: 1.55; }
  body.cols3 .fam li > b { color: var(--px-wood); font-weight: 400; white-space: nowrap; }
  body.cols3 .fam li.muted { display: block; }
  body.cols3 .mates { gap: 6px; }
}
@media (min-width: 1100px) {
  /* 顶栏一行：年龄/年份/身份/姓名/节奏 | 暂停/速度/下一个/快转/自动抉择/⋯；年条与寿命线横跨下一行 */
  .game .play-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; padding-top: 4px; }
  .game .play-top > #hud { display: contents; }
  .game .play-top .tb-row { grid-column: 1; grid-row: 1; min-width: 0; }
  .game .play-top .controls { grid-column: 2; grid-row: 1; padding: 0; min-height: 44px; gap: 4px; }
  .game .play-top .year-bar { grid-column: 1 / -1; grid-row: 2; }
  .game .play-top .life-line { grid-column: 1 / -1; grid-row: 3; }
  .game .tb-info { font-size: 12px; gap: 4px; overflow: hidden; }
  .game .tb-age b { font-size: 30px; }
  .game .controls .pause { width: auto; padding: 0 10px; display: flex; align-items: center; gap: 4px; font-size: 13px; }
  .game .controls .pause .pz-t { display: inline; }
  .game .speed { flex: none; }
  .game .speed .btn { flex: none; min-width: 38px; padding: 0 4px; }
  .game .controls .step { padding: 0 10px; }
  .ctl-extra { display: flex; align-items: center; gap: 4px; flex: none; }
  .game .controls .ctl-extra .menu-item { min-height: 44px; display: flex; align-items: center; gap: 4px; padding: 0 8px; font-size: 13px; white-space: nowrap; border: 2px solid var(--px-wood-dark); background: var(--px-paper); text-align: center; cursor: pointer; }
  .game .controls .ctl-extra .menu-item input { margin: 0; }
}
