/* ======== 新界面（2026-11）：出发卡、三栏主界面、抉择卡。在 style.css 之后加载 ======== */
body.wide #app { max-width: 720px; }
.setup { margin-bottom: 10px; }
.setup-title { font-weight: 700; margin-bottom: 4px; }
.small { font-size: 12px; }
.warn { color: var(--down); }
.neg { color: var(--down); }

/* 出发登记卡：米白纸张、深褐描边、像素字体、硬阴影；字段始终两列，长内容自然换行 */
#screen-identity { padding: 0 0 calc(92px + env(safe-area-inset-bottom)); }
.depart-card { background: #fffaf0; color: #302c25; font-family: var(--px-font, inherit); padding: 14px 16px; border: 2px solid var(--px-wood-dark, #5c3a1e);
  box-shadow: 4px 4px 0 rgba(60, 35, 15, .35); border-radius: 0; margin-top: 12px; }
.dc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid #d9cdb4; padding-bottom: 6px; }
.dc-title { font-size: 18px; letter-spacing: 3px; color: var(--px-wood-dark, #5c3a1e); }
.dc-no { font-size: 12px; color: #746b5d; font-variant-numeric: tabular-nums; }
.dc-name { font-size: 32px; line-height: 1.25; margin: 10px 0 4px; overflow-wrap: anywhere; }
.dc-lead { font-size: 14px; line-height: 1.8; margin: 0 0 10px; }
.dc-map { background: #f4efe4; border: 1px solid #d9cdb4; padding: 4px; }
.worldmap { width: 100%; height: auto; display: block; }
.worldmap .wd { fill: #cfc4b1; }
.worldmap .warc { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 4 3; }
.worldmap .wfrom { fill: #d6453d; }
.worldmap .wto { fill: #2f6fdb; }
.dc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid #b9ad97; margin-top: 10px; }
.dc-cell { padding: 7px 9px; font-size: 14px; border: 0 solid #d9cdb4; border-width: 0 1px 1px 0; min-width: 0; overflow-wrap: anywhere; }
.dc-cell:nth-child(2n) { border-right: 0; }
.dc-cell.wide { grid-column: 1 / -1; border-right: 0; }
.dc-cell.warn .dc-v { color: var(--down); }
.dc-cell.ok .dc-v { color: var(--up); }
.dc-k { font-size: 11px; color: #746b5d; letter-spacing: 1px; }
.dc-v { font-size: 14px; line-height: 1.5; }
.dc-sub { font-size: 11px; line-height: 1.5; margin-top: 2px; }
.dc-sect { font-size: 13px; color: #496550; margin-top: 12px; letter-spacing: 2px; }
.dc-sect + .dc-grid { margin-top: 4px; }
.dc-policy { margin-top: 10px; padding: 8px 10px; border: 1px dashed #b9ad97; font-size: 13px; line-height: 1.6; }
.dc-note { font-size: 11px; line-height: 1.7; margin: 10px 0 0; }
.dc-reroll { text-align: center; margin: 8px 0 0; }
.depart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: flex; gap: 10px; max-width: 560px; margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #f6f1e7; border-top: 2px solid var(--px-wood-dark, #5c3a1e); }
.depart-bar .btn { flex: 1 1 0; min-width: 0; border-radius: 0; border: 3px solid var(--px-wood-dark, #5c3a1e); font-family: var(--px-font, inherit); font-size: 16px;
  box-shadow: 0 4px 0 rgba(60, 35, 15, .35); }
.depart-bar .btn.primary { flex: 1.3 1 0; background: #496550; border-color: #2f4636; color: #fff; }
.depart-bar .btn:active { transform: translateY(4px); box-shadow: none; }
@media (min-width: 720px) { .dc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .dc-cell:nth-child(2n) { border-right: 1px solid #d9cdb4; } .dc-cell:nth-child(4n) { border-right: 0; } .dc-cell.wide { grid-column: span 2; border-right: 1px solid #d9cdb4; } }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tb-age b { font-size: 34px; line-height: 1; font-weight: 800; }
.tb-age span { font-size: 13px; color: var(--muted); margin-left: 2px; }
.tb-mid { flex: 1; min-width: 0; }
.tb-line { display: flex; align-items: baseline; gap: 4px; font-size: 14px; white-space: nowrap; }
.tb-line b, .tb-pace { flex: none; }
#tb-year { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 年度进度条的宽度由游戏时钟逐帧写入（R40），这里不能加 transition：归零要立刻归零，走动也不能滞后 */
.year-bar { height: 8px; background: #e9e1d2; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.year-bar i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #14936b, #c98a0b, #b8432f); }
.life-line { height: 2px; background: #e9e1d2; overflow: hidden; margin-top: 2px; }
.life-line i { display: block; width: 0; height: 100%; background: #8a7f6c; }

/* 三栏（手机上：中间栏在最上面，左右栏依次在下） */
.game-grid { display: grid; gap: 10px; padding: 10px 0 60px; }
.col-left, .col-right, .col-center { display: grid; gap: 10px; align-content: start; min-width: 0; }
.col-center { order: -1; }
@media (min-width: 980px) {
  .game-grid { grid-template-columns: 270px 1fr 280px; }
  .col-center { order: 0; }
}
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.panel h4 { margin: 0 0 6px; }
.stat-panel { display: grid; gap: 6px; }
.stat-panel .stat { grid-template-columns: 4.6em 1fr 2em; }
.money { display: grid; gap: 2px; font-size: 14px; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 2px; }

/* 身份卡 */
.id-top { display: flex; gap: 10px; align-items: center; }
#avatar { width: 56px; height: 56px; image-rendering: pixelated; border-radius: 8px; border: 1px solid var(--line); }
.id-name { font-size: 18px; font-weight: 800; }
.id-rows { display: grid; grid-template-columns: 2.6em 1fr; gap: 3px 8px; font-size: 13px; margin: 8px 0; }
.id-rows dt { color: var(--muted); }
.id-rows dd { margin: 0; }
.chip { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 99px; background: #efe6d4; margin: 0 4px 2px 0; }
.mrz { font-family: "OCR B", Consolas, "Courier New", monospace; font-size: 9.5px; letter-spacing: .5px; background: #f1ece2; border-radius: 6px; padding: 5px 6px; overflow: hidden; white-space: nowrap; color: #4b4339; }

/* 场景 */
.scene-panel { padding: 8px; }
#scene { width: 100%; height: auto; aspect-ratio: 32 / 9; object-fit: cover; object-position: 50% 72%; image-rendering: pixelated; border-radius: 10px; display: block; background: #e3ecf0; }
.scene-desc { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: center; }

/* 今年的重心 */
.focus-head { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.focus-head .muted { font-weight: 400; font-size: 12px; }
.focus-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.small.focus-btn { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.focus-btn.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* 控制 */
.game .controls { position: static; background: none; border: 0; padding: 0; backdrop-filter: none; justify-content: flex-start; }
.game .controls #btn-step { flex: 0 0 auto; }
.speed { display: flex; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 2px; }
.btn.tiny { min-height: 30px; padding: 2px 8px; font-size: 12px; border: 0; background: transparent; }
.btn.tiny.on { background: var(--accent); color: #fff; }
.note-box textarea, .reflect-q textarea { width: 100%; font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.log-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }

/* 人生纪录流（一行一条，最新在前） */
.game .log { padding: 0; max-height: 70vh; overflow: auto; }
.game .log .entry { margin: 0; border-radius: 0; border-width: 0 0 1px; padding: 7px 4px; font-size: 14px; line-height: 1.55; animation: none; background: transparent; }
.game .log .entry.real { background: #fffaf0; }
.game .log .entry.has-choice { background: #fbf7ef; }
.game .log .entry.kind-crisis { background: #fff6f4; }
.game .log .entry.kind-death { background: #2a2622; color: #f6f1e7; }
.game .log .entry.kind-note .note { color: #5b4a8a; font-style: italic; }
.lm-y { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; margin-right: 4px; }
.lm-a { color: var(--muted); font-size: 12px; margin-right: 4px; }
.game .log .entry-text { font-size: 14px; }
.game .log .entry-choice, .game .log .entry-result { font-size: 13px; }
.game .log .deltas { display: inline-flex; margin: 0 0 0 4px; }
.fav { float: right; border: 0; background: none; color: #c9b98f; cursor: pointer; font-size: 15px; padding: 0 2px; }
.fav.on { color: #c98a0b; }
.info { font-size: 12px; color: #6b6156; margin-top: 2px; }
.info-k { display: inline-block; font-size: 10px; border: 1px solid #d9cdb4; border-radius: 4px; padding: 0 4px; margin-right: 4px; color: #8a7a5c; }
.game .log .phase-div { margin: 10px 0 4px; }

/* 家人 / 同批 / 人生地图 */
.fam, .mates { list-style: none; padding: 0; margin: 0; font-size: 13px; display: grid; gap: 3px; }
.fam li.gone { text-decoration: line-through; color: var(--muted); }
.mates li { border-bottom: 1px dashed var(--line); padding-bottom: 3px; }
.lifemap { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; margin-top: 4px; }
.lifemap i { aspect-ratio: 1; background: #f1ece2; border-radius: 2px; border: 1px solid transparent; }
.lifemap i.child { background: #ebe5d9; }
.lifemap i.over { border: 1px dashed #b9ad97; }
.lifemap i.now { outline: 2px solid var(--ink); }
.lm-key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 0; }
.lm-key b { flex: 1; height: 8px; border-radius: 4px; }
.lm-key2 { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.lm-key2 span { display: inline-flex; align-items: center; gap: 3px; }
.lm-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lm-sw.blank { background: #f1ece2; border: 1px solid #ddd3c2; }

/* 抉择卡 */
.fact-box { background: #f4efe4; border: 1px solid #e6dcc6; border-radius: 10px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.btn.choice { display: grid; gap: 2px; }
.c-label { font-weight: 600; }
.c-sub { font-size: 12px; color: var(--muted); }
.c-note, .c-miss { font-size: 12px; color: var(--down); }
.btn.choice.risk { border-color: #e5b5ab; background: #fff7f5; }
.btn.choice:disabled { opacity: .6; }
.modal-foot { display: flex; justify-content: space-between; margin-top: 10px; }
.pending-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 15; border: 0; border-radius: 99px;
  background: var(--accent); color: #fff; padding: 10px 18px; font-size: 15px; box-shadow: var(--shadow); cursor: pointer; font-family: inherit; }
.reflect-q { margin-top: 10px; font-size: 14px; }
/* 时间流：顶栏“1 年 ≈ N 秒”、纪录里的月份 */
.tb-pace { font-size: 12px; color: var(--muted, #888); border: 1px solid var(--line, #ccc); border-radius: 99px; padding: 0 6px; margin-left: 4px; }
.lm-m { margin-left: 2px; font-size: .85em; opacity: .75; }
