.history-dialog{width:min(620px,94vw);max-height:85dvh;border:0;border-radius:20px;padding:20px;background:#eef1df;color:#293626}
.history-heading,.history-search{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-bottom:14px}
.history-heading h2{margin:0}.history-dialog button,.replay-panel button{border:0;border-radius:10px;padding:10px 14px;background:#cad9b7;color:#233420;cursor:pointer}.history-dialog button:disabled,.replay-panel button:disabled{opacity:.45;cursor:default}
.history-search input{min-width:0;flex:1;border:1px solid #adbba2;border-radius:10px;padding:10px;font-size:16px}
.history-list{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}.history-entry{text-align:left;font-size:16px}.history-entry small{display:block;font-size:12px;opacity:.8;margin-top:6px}
.replay-panel{position:fixed;z-index:12;bottom:0;left:50%;transform:translateX(-50%);width:min(760px,100%);box-sizing:border-box;padding:12px 14px max(12px,env(safe-area-inset-bottom));border-radius:18px 18px 0 0;background:#eef1dff5;color:#253321;box-shadow:0 -3px 20px #0003;display:flex;gap:8px;flex-direction:column;font-size:13px}
.replay-panel[hidden]{display:none}.replay-controls{display:flex;align-items:center;gap:6px}.replay-controls input{min-width:40px;flex:1;accent-color:#4f7a36}.replay-panel label{display:flex;align-items:center;gap:6px}.replay-panel pre{font-size:11px;max-height:25dvh;overflow:auto;white-space:pre-wrap;margin:6px 0}.replay-panel summary{cursor:pointer}.replaying-game .bottom-panel,.replaying-game #tutorial-panel,.replaying-game #mission-goal,.replaying-game #editor-game-status{display:none}
.ai-setting{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0}.ai-setting select{font:inherit;border:1px solid #a8b69b;border-radius:8px;padding:8px;background:#edf1e4;color:#253321}
.replay-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.replay-heading strong{font-size:18px;overflow-wrap:anywhere}.replay-panel .replay-results-button{flex:0 0 auto;min-height:44px;padding:8px 14px;font-size:20px}
