/* Readability pass; preserve the game canvas, library and existing controls. */
.eyebrow,.section-kicker{font-size:12px;letter-spacing:.08em}
.game-count,.library-empty,.local-rom-button small,.notes-panel span{font-size:13px;line-height:1.6}
.library-search{height:42px}
.library-search input{font-size:15px}
.category-tabs button{height:34px;padding:0 12px;font-size:13px}
.game-card .game-copy strong{font-size:15px;line-height:23px}
.game-card{min-height:45px}
.local-rom-button strong,.notes-panel strong,.player-topbar strong{font-size:15px}
.player-topbar span:not(.power-light),.player-status{font-size:13px}
.toolbar{grid-template-columns:repeat(4,minmax(0,1fr))}
.toolbar button{min-height:42px;height:auto;padding:9px 6px;font-size:14px;line-height:1.4;gap:6px}
.toolbar button.primary-tool:hover:not(:disabled){background:#306ccc;border-color:#306ccc;color:#fff}
.keyboard-help{gap:9px;font-size:14px}
.keyboard-help>strong{font-size:16px;margin-bottom:3px}
.keyboard-help>div{display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:10px 12px}
.keyboard-help>div span{white-space:normal;line-height:1.5}
.keyboard-help kbd{max-width:100%;padding:5px 8px;font:600 15px/1.6 "Microsoft YaHei",system-ui,sans-serif;white-space:normal;overflow-wrap:anywhere;overflow:visible;text-overflow:clip;color:var(--text)}
.settings-help,.binding-prompt,.gamepad-devices{font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.mapping-table th,.mapping-table td{font-size:14px}
.mapping-button{min-height:38px;font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.settings-dialog{display:flex;flex-direction:column}
.mapping-scroll{min-height:0;flex:1 1 auto}
.settings-dialog>header,.settings-dialog>footer,.settings-help,.binding-prompt,.gamepad-devices{flex-shrink:0}
.settings-dialog>footer button{min-height:40px;height:auto;font-size:14px;padding:8px 13px}
.settings-dialog>footer{flex-direction:row;flex-wrap:wrap}
button:focus-visible,.local-rom-button:focus-within{outline:2px solid #689bdb;outline-offset:3px}
html[data-theme="dark"]{--muted:#b1bdcd}
html[data-theme="dark"] :is(.toolbar button,.mapping-button,.category-tabs button,.icon-button,.home-link,.settings-dialog>footer button,.settings-dialog>header button):hover:not(:disabled){background:#34445b;color:#edf4ff;border-color:#607c9f}
html[data-theme="dark"] :is(.toolbar .primary-tool,.settings-dialog>footer .settings-done,.category-tabs button.is-active):hover:not(:disabled){background:#3569aa;color:#fff;border-color:#779bd0}
html[data-theme="dark"] .mapping-button.is-listening{background:#2c4563;color:#d7eaff;border-color:#7198c8}
html[data-theme="dark"] .game-card:hover{background:#303e52;color:#edf4ff;border-color:#617b9e}
html[data-theme="dark"] .game-card.is-selected:hover{background:#344b6a;border-color:#7897c4}
html[data-theme="dark"] :is(.local-rom-button,.local-rom-button small){color:#b5c6da}
html[data-theme="dark"] .toolbar button:disabled{background:var(--panel-soft);color:#8591a2;border-color:var(--line);opacity:.6}
@media(min-width:1300px){.toolbar{grid-template-columns:repeat(8,minmax(0,1fr))}}
@media(max-width:900px){
 .player-panel{display:flex;flex-direction:column}
 .touch-controller{order:1}
 .keyboard-help{order:2}
}
@media(max-width:520px){
 .keyboard-help{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .keyboard-help>div{padding:9px 8px;font-size:13px}
 .keyboard-help kbd{font-size:14px}
 .toolbar button{font-size:13px;gap:4px}
 .mapping-button{font-size:14px}
 .library-search input{font-size:16px}
}
@media(max-width:360px){.toolbar{grid-template-columns:repeat(3,minmax(0,1fr))}}
