/* Shared opening-screen controls. Each game keeps its own colours and story. */
#title{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
#title .card{flex-shrink:0;width:100%;max-width:34rem;min-width:0}
#title .title-actions{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;margin-top:.4rem}
#title .title-actions .btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;max-width:100%;padding:.7em 1.3em;border:2px solid transparent;border-radius:6px;background:var(--brass);color:var(--brass-ink);font:700 1rem/1.3 var(--body,var(--text,system-ui));text-align:center;text-decoration:none;cursor:pointer}
#title .title-actions .btn.ghost{border-color:var(--brass);background:transparent;color:var(--paper)}
#title .title-actions .btn:hover:not(:disabled){background:var(--paper);border-color:var(--paper);color:var(--brass-ink);filter:none}
#title .title-actions .btn:focus-visible{outline:3px solid var(--paper);outline-offset:3px}
#title .title-actions .btn:disabled{opacity:.6;cursor:default}
#title .title-actions .track{flex:1 1 100%;min-width:6rem;max-width:none;order:5;transition:opacity .4s ease;height:6px;border-radius:3px;background:rgba(255,255,255,.15);overflow:hidden}
#title:has(#start:not(:disabled)) .track{opacity:0;visibility:hidden}
#title #bar{height:100%;width:0;background:var(--brass);transition:width .2s}
#title .title-actions #loadnote{flex-basis:100%;order:6}
#title #loadnote{min-height:1.5em;line-height:1.5;font-size:.85rem;opacity:.8}
#title #savenote{font-size:.9rem;opacity:.8}
@media(max-width:520px){#title .title-actions{gap:.6rem}#title .title-actions .btn{padding:.65em 1em}}
@media(max-height:600px){#title{align-items:flex-start;justify-content:flex-start}#title .card{margin-top:0}}
@media(prefers-reduced-motion:reduce){#title #bar{transition:none}}

/* the "saved on this device" line is gone: the Exit question in the game says it instead (owner, 19 November 2026) */
#savenote{display:none!important}

/* nothing jumps when loading ends (owner, 19 November 2026: the Chapters button came in last and jerked the row): Chapters is there from the
   start, Start is wide enough for "Loading" and "Continue", and the loading bar sits on its own line under the buttons and fades out */
#title #tchap[hidden]{display:inline-flex!important}
#title #tchap{transition:opacity .3s ease}
#title #start{min-width:8.4em}
#title #loadnote[hidden]{display:block!important;visibility:hidden}   /* a game that hides the note keeps its line, so the card does not shrink */
@media(prefers-reduced-motion:reduce){#title #tchap,#title .title-actions .track{transition:none}}
/* all three buttons show from the first moment (owner, 19 November 2026: no gap, no hiding): Chapters is drawn at once, dimmed and not yet
   tappable while the game loads, like Start, and both wake together when Start is ready; Exit works throughout */
#title:has(#start:disabled) #tchap{opacity:.6;pointer-events:none;cursor:default}
/* card buttons sit on one line wherever the screen has room (owner, 19 November 2026: "we need one line where possible"): a button's words never
   break inside it, the card grows to hold the row on a wide screen, and on a narrow phone whole buttons drop to the next line instead */
#cbtns,#chcardb{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center}
html body #cbtns>:is(.btn,button,a),html body #chcardb>:is(.btn,button,a){flex:0 0 auto;white-space:nowrap;max-width:100%}
html body :has(>#cbtns){width:fit-content;min-width:min(34rem,100%);max-width:min(60rem,100%)}
html body #cbody{width:0;min-width:100%}   /* the words wrap to the card; only the buttons and the title set how wide it grows */
@media(max-width:600px){html body #cbtns>:is(.btn,button,a),html body #chcardb>:is(.btn,button,a){white-space:normal}}
