/* Backup controls sit outside the original 640x480 game surface. */
body{padding-top:40px}main{width:min(100vw,calc((100dvh - 40px)*4/3))}#project-intro{max-height:calc(100dvh - 72px)}
#save-backup-toolbar{position:fixed;inset:0 0 auto;height:40px;z-index:20;display:flex;align-items:center;justify-content:center;gap:12px;padding:4px 10px;background:#111821;color:#dce4ee;font:12px/1.4 system-ui,"Malgun Gothic",sans-serif}
#save-backup-toolbar button{padding:4px 12px;min-height:30px;border:1px solid #879bb2;border-radius:4px;background:#243448;color:#fff;font:inherit;cursor:pointer}#save-bank-mode{max-width:60vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#save-backup-dialog{width:min(900px,calc(100vw - 24px));max-height:calc(100dvh - 48px);padding:24px;overflow:auto;border:1px solid #8096ad;border-radius:10px;background:#151d28;color:#e8edf5;font:15px/1.7 system-ui,"Malgun Gothic",sans-serif}
#save-backup-dialog::backdrop{background:rgb(0 0 0/.75)}#save-backup-dialog [hidden]{display:none!important}#save-backup-dialog h2{margin:0;font-size:22px}#save-backup-dialog p{margin:14px 0;word-break:keep-all;overflow-wrap:anywhere}.backup-heading{position:sticky;top:-24px;z-index:1;margin:-24px -24px 0;padding:16px 24px;background:#151d28;border-bottom:1px solid #405168;display:flex;align-items:center;justify-content:space-between;gap:16px}.backup-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}
#save-backup-dialog button{min-height:42px;padding:8px 14px;border:1px solid #8aa4c2;border-radius:5px;background:#2a405a;color:#fff;font:inherit;cursor:pointer}#save-backup-dialog button:hover,#save-backup-toolbar button:hover{background:#3b587a}#save-backup-dialog button:focus-visible,#save-backup-toolbar button:focus-visible{outline:3px solid #8ec5ff;outline-offset:3px}#save-backup-dialog button:disabled{opacity:.45;cursor:default}
.backup-table-wrap{overflow:auto}#save-backup-dialog table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:14px}#save-backup-dialog th,#save-backup-dialog td{padding:8px 10px;border:1px solid #405168;text-align:left;word-break:keep-all;overflow-wrap:anywhere}#save-backup-dialog th:first-child{width:56px}#save-backup-dialog th{background:#253449}#save-backup-preview{margin-top:18px;padding:4px 16px;border:1px solid #89afd6;border-radius:6px}#save-backup-status{min-height:26px;color:#b9d7fc}.backup-error{color:#ffb3a9!important}
@media(max-width:480px){#save-backup-dialog{padding:16px;font-size:14px}.backup-heading{top:-16px;margin:-16px -16px 0;padding:12px 16px}#save-backup-dialog th:first-child{width:44px}#save-backup-dialog th,#save-backup-dialog td{padding:6px}#save-backup-dialog h2{font-size:19px}#save-backup-toolbar{justify-content:space-between;gap:6px}#save-bank-mode{font-size:11px}}

/* Direct toolbar actions; only imports open a single summary confirmation. */
.backup-direct-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}#save-backup-toolbar [hidden]{display:none!important}
#save-backup-toolbar #save-backup-status{min-height:0;margin:0;max-width:24vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px}#save-bank-mode{min-width:0}#backup-import-summary{white-space:pre-wrap;overflow-wrap:anywhere}

@media(max-width:560px){body{padding-top:76px}main{width:min(100vw,calc((100dvh - 76px)*4/3))}#project-intro{max-height:calc(100dvh - 108px)}#save-backup-toolbar{height:76px;flex-wrap:wrap;align-content:center;row-gap:5px}.backup-direct-actions{width:100%}#save-backup-toolbar button{padding-inline:8px}#save-backup-toolbar #save-bank-mode{display:block;flex:1;max-width:100%;font-size:10px}}

@media(max-width:560px){#save-backup-toolbar #save-backup-status{flex:1;max-width:none;font-size:10px}}
#save-backup-dialog table th:first-child{width:64px}#save-backup-dialog table{min-width:440px}

#save-backup-dialog table{font-size:13px;line-height:1.4}#save-backup-dialog th,#save-backup-dialog td{padding:5px 8px}#save-backup-dialog p{margin:10px 0}#save-backup-dialog .backup-actions{position:sticky;bottom:-24px;margin-bottom:0;padding:10px 0;background:#151d28}@media(max-width:480px){#save-backup-dialog .backup-actions{bottom:-16px}}
#backup-import-note{padding:10px 12px;border:1px solid #a98b55;border-radius:4px;background:#2b2418;color:#fff0cc;line-height:1.6}

/* The public notice is the only UI until its start button is confirmed. */
body:has(> #project-intro:not([hidden])){padding-top:0}
body:has(> #project-intro:not([hidden])) #save-backup-toolbar{display:none}
body:has(> #project-intro:not([hidden])) #project-intro{max-height:calc(100dvh - 32px)}
