#safe-area-probe{position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
.two-buttons .art-button{padding-inline:12px;letter-spacing:.5px;white-space:nowrap}
.two-buttons .art-button span{white-space:nowrap}
.result-details>.two-buttons{padding-top:max(0px,calc(45px / var(--scale) - 61px))}
button{position:relative}
#game button::after{content:'';position:absolute;left:50%;top:50%;width:max(100%,calc(45px / var(--scale)));height:max(100%,calc(45px / var(--scale)));transform:translate(-50%,-50%);pointer-events:auto}
#game .loading .art-button::after{min-width:44px;min-height:44px}

/* Candidate V7: supplementary care text at short portrait sizes. */
@media (max-width:360px) and (max-height:650px) and (orientation:portrait) {
  #game[data-route="care"] .needs { top:488px; height:95px; }
  #game[data-route="care"] .need-head { font-size:max(12px,calc(10px / var(--scale))); }
  #game[data-route="care"] .need-number { font-size:max(13px,calc(11.5px / var(--scale))); }
  #game[data-route="care"] .need-number small { font-size:max(9px,calc(9.5px / var(--scale))); }
  #game[data-route="care"] .actions { top:595px; gap:7px 8px; grid-auto-rows:114px; }
  #game[data-route="care"] .action { min-height:0; height:114px; padding:4px 5px; }
  #game[data-route="care"] .action .action-icon { height:22px; }
  #game[data-route="care"] .action strong { font-size:max(17px,calc(12.5px / var(--scale))); line-height:1.2; }
  #game[data-route="care"] .action .effects { font-size:max(10px,calc(10.5px / var(--scale))); line-height:1.15; white-space:normal; word-break:keep-all; overflow-wrap:normal; }
}

/* Keep each CJK attribute label together with its nonbreaking value at every size. */
#game .action .effects { word-break:keep-all; overflow-wrap:normal; }

/* Candidate2: disabled reason participates in the heading row, never the effect footer. */
#game .action-heading { display:flex; align-items:center; justify-content:center; gap:2px; max-width:100%; }
#game .action-heading strong { white-space:nowrap; flex-shrink:0; }
#game .action-heading .disabled-reason { position:static; inset:auto; display:inline-block; flex-shrink:0; white-space:nowrap; font-size:10px; line-height:1.15; padding:0 2px; border-radius:4px; background:#fff3dc; font-weight:700; }
@media (max-width:360px) and (max-height:650px) and (orientation:portrait) {
 #game .action-heading .disabled-reason { font-size:max(10px,calc(8.75px / var(--scale))); }
}

/* V9: keep the small viewport HUD readable; preserve art and gameplay geometry. */
#game[data-route="care"] .calendar { height:60px; }
#game[data-route="care"] .day-cell { font-size:max(12px,calc(10px / var(--scale))); line-height:1.1; }
#game[data-route="care"] .day-cell > span:first-child { line-height:1.1; }
#game[data-route="care"] .day-cell[aria-label*="检查目标"] .event-symbol { position:absolute; top:20px; left:0; right:0; line-height:12px; transform:none; }
#game[data-route="care"] .tiny-target { bottom:0; font-size:max(10px,calc(9.5px / var(--scale))); line-height:1; }
#game[data-route="care"] .vitals { top:116px; }
#game[data-route="care"] .growth-label { font-size:max(12px,calc(11.5px / var(--scale))); line-height:1; display:flex; align-items:center; justify-content:center; }
#game[data-route="care"] .check-label { top:25px; left:-88px; right:-54px; padding:1px 4px; font-size:max(9px,calc(10.5px / var(--scale))); line-height:1.15; white-space:nowrap; background:#fff0d4ed; }
#game[data-route="care"] .date-line { font-size:max(15px,calc(10.5px / var(--scale))); }
#game[data-route="care"] .date-line small { font-size:max(12px,calc(9.5px / var(--scale))); }
#game[data-route="care"] .wish-caption { font-size:max(11px,calc(10.5px / var(--scale))); line-height:1.2; white-space:nowrap; }
#game[data-route="care"] .hint { font-size:max(11px,calc(10.5px / var(--scale))); }
#game[data-route="care"] .form-ribbon { font-size:max(15px,calc(10.5px / var(--scale))); }
#game[data-route="care"] .need-track { margin-top:20px; }
#game[data-route="care"] .forecast:before { font-size:max(8px,calc(9.5px / var(--scale))); line-height:1; }
#game[data-route="care"] .forecast[style="left:0%"]:before,
#game[data-route="care"] .forecast[style="left:10%"]:before { left:0; transform:none; }
#game[data-route="care"] .forecast[style="left:90%"]:before,
#game[data-route="care"] .forecast[style="left:100%"]:before { left:0; transform:translateX(-100%); }

/* V14: maintain readable training instructions and clock after root scaling. */
#game[data-route="training"] .training-help {
  font-size:max(18px,calc(13px / var(--scale)));
  line-height:1.35;
}
#game[data-route="training"] .training-help small {
  font-size:max(11px,calc(11px / var(--scale)));
  line-height:1.45;
}
#game[data-route="training"] .train-status .time {
  font-size:max(14px,calc(14px / var(--scale)));
  line-height:1.3;
}

#game[data-route="training"] .train-status .time {
  color:#5b3a28;
  background:#fff3d8;
  padding:3px 7px;
  border-radius:9px;
  box-shadow:inset 0 0 0 1px #8f633e33;
}

/* V15: preserve readable detail text after the390x844 stage is scaled. */
#game[data-route="event"] .event-day { font-size:max(14px,calc(11px / var(--scale))); }
#game[data-route="event"] .event-panel p { font-size:max(16px,calc(13px / var(--scale))); line-height:1.5; }
#game[data-route="night"] .night-card { bottom:24px; display:flex; flex-direction:column; padding-bottom:18px; }
#game[data-route="night"] .night-card > * { flex-shrink:0; }
#game[data-route="night"] .night-rows { flex:1 1 auto; min-height:0; max-height:none; overflow:auto; overscroll-behavior:contain; }
#game[data-route="night"] .night-row { font-size:max(12px,calc(11px / var(--scale))); line-height:1.35; }
#game[data-route="night"] .night-row strong { font-size:max(14px,calc(12px / var(--scale))); }
#game[data-route="night"] .night-row.loss { display:block; }
#game[data-route="night"] .night-row small { font-size:max(10px,calc(11px / var(--scale))); }
#game[data-route="night"] .night-needs { font-size:max(11px,calc(11px / var(--scale))); font-weight:600; line-height:1.3; gap:5px; }
#game[data-route="night"] .night-needs > span { color:#60412c!important; white-space:nowrap; }
#game[data-route="night"] .night-card .art-button { margin-top:14px; }
#game:is([data-route="fail"],[data-route="win"]) .result-details p,
#game:is([data-route="fail"],[data-route="win"]) .result-details .stats,
#game:is([data-route="fail"],[data-route="win"]) .result-details .loss-list,
#game:is([data-route="fail"],[data-route="win"]) .result-details > div[style*="font-size:13px"] { font-size:max(13px,calc(11px / var(--scale)))!important; line-height:1.4; }
#game:is([data-route="fail"],[data-route="win"]) .result-details .mini-day { font-size:max(10px,calc(10px / var(--scale))); }
#game:is([data-route="fail"],[data-route="win"]) .result-details { overscroll-behavior:contain; }

/* V15r2: artwork overhang is visual only; separate result touch areas. */
#game:is([data-route="win"],[data-route="fail"]) .result-details .art-button:before { pointer-events:none; }
#game:is([data-route="win"],[data-route="fail"]) .result-details > .art-button { margin-block:max(5px,calc(7px / var(--scale))); }

/* V15r3: leave room below the lowest expanded result touch area. */
#game:is([data-route="win"],[data-route="fail"]) .result-details { max-height:calc(100% - 485px); padding-bottom:max(22px,calc(22px / var(--scale))); }

/* V16: readable growth explanation and continuation hint after root scaling. */
#game[data-route="grow"] .grow-copy {
  font-size:max(17px,calc(13px / var(--scale)));
  line-height:1.5;
}
#game[data-route="grow"] .grow-copy strong { font-size:max(24px,calc(16px / var(--scale))); }
#game[data-route="grow"] .grow-copy small { font-size:max(13px,calc(11px / var(--scale))); line-height:1.5; }
#game[data-route="grow"] .status-note {
  font-size:max(11px,calc(11px / var(--scale)));
  line-height:1.4;
  color:#60412c;
  background:#fff2d8;
  border-radius:10px;
  padding:5px 8px;
}
