/* Consistent action sizing and spacing across ready, pause and result dialogs. */
.overlay{overflow-y:auto;overscroll-behavior:contain}
.overlay>button{display:block;flex:0 0 auto;width:min(100%,260px);min-height:48px;box-sizing:border-box;margin:0 auto 16px;padding:11px 18px;font-family:var(--story-font);font-size:16px;font-weight:400;line-height:1.4;letter-spacing:0;text-align:center;white-space:normal;overflow-wrap:anywhere}
.overlay>button:last-of-type{margin-bottom:0}
.overlay>button[hidden]{display:none}
.overlay>.hint{flex-shrink:0;margin:16px 0 0;line-height:1.6}
.overlay h2{flex-shrink:0;line-height:1.45;overflow-wrap:anywhere}
.overlay>p:not(.hint){flex-shrink:0;line-height:1.7}
.story-bottom button,.ending-actions button,.picker-head button{font-family:var(--story-font);font-weight:400;font-synthesis:none;min-height:44px;box-sizing:border-box}
.story-bottom button,.ending-actions button{line-height:1.4}
.picker-head button{min-width:44px}
button:focus-visible{outline:2px solid #f4c6d2;outline-offset:3px}
@media(max-height:730px){.overlay{top:9%;bottom:9%;padding:16px}.overlay>button{min-height:46px;margin-bottom:14px}.overlay h2{font-size:20px}.overlay>.hint{font-size:11px}}
/* Leave room for the action keys' raised bases before the status line. */
@media(orientation:portrait),(max-width:649px){
 .controls{height:264px}
 .controls footer{padding-top:12px;font-size:10px;line-height:14px;gap:8px}
 .controls footer #status{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .controls footer>span:last-child{flex-shrink:0}
 .songline b{font-size:12px;line-height:14px}
 .songline div>span{font-size:9px;line-height:11px}
 .songline>div:not(.album){height:28px}
 .songline{height:30px}
}
.cd-detail #cd-begin{min-height:48px;line-height:1.4;font-family:var(--story-font);font-weight:400;font-synthesis:none}
/* Both opening and resume countdowns sit at the visible screen centre. */
#countdown{position:fixed;inset:0;top:0;width:100%;height:100dvh;display:grid;place-items:center;z-index:40;font:700 clamp(64px,15vw,100px)/1 monospace;color:#fff3b5;text-shadow:0 3px 0 #71374c,0 0 18px #ffd18aaa;pointer-events:none}
#countdown:empty{display:none}
/* Align all three header buttons, regardless of text or music symbols. */
.top-actions{display:flex;align-items:center}
.top-actions button{box-sizing:border-box;height:28px;min-height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0 7px;font-family:var(--story-font);font-size:10px;line-height:1;white-space:nowrap}
@media(max-width:360px){.top-actions button{padding:0 5px;font-size:9px}}

/* Keep supporting labels quiet and leave the board the available space. */
#combo-label,#piece-count{display:none}
.controls footer #status{font-size:10px}
.songline #clock{white-space:nowrap;font-size:10px}

/* Score and song title share the screen's left content edge. */
.screen>.hud{padding-left:0;padding-right:0}.screen>.songline{padding-left:0;padding-right:0}

/* Keep song actions at the trailing edge rather than beside the title. */
.screen>.songline{display:flex;align-items:center;gap:8px}.screen>.songline>div:not(.album){flex:1;min-width:0}.screen>.songline #song-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.screen>.songline #clock{order:2;flex-shrink:0}.screen>.songline #song-select{order:3;flex-shrink:0;margin-left:0}
