/* Shared on-screen keyboard tuning for every game with a #kb keyboard (.kr rows of .k keys).
   Loaded after each game's own styles; selectors start with "html body" so they win without !important. */

/* Taps never zoom the page: no double-tap zoom on fast typing, no text-size bumps on rotate. */
html{touch-action:manipulation;-webkit-text-size-adjust:100%;text-size-adjust:100%}
html body #kb .k{touch-action:manipulation;-webkit-appearance:none;appearance:none;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}

/* Phones: the keyboard spans the full screen width, keys share each row evenly and are thumb-sized. */
@media (max-width:600px){
  html body #kb{width:100%;max-width:none;margin-left:0;margin-right:0;border-radius:0;align-items:stretch;
    padding:8px 3px calc(8px + env(safe-area-inset-bottom,0px));gap:8px}
  html body #kb .kr{width:100%;gap:5px;justify-content:center}
  html body #kb .k{flex:1 1 0;min-width:0;max-width:none;height:clamp(46px,7.4vh,58px);margin:0;
    font-size:clamp(15px,4.6vw,20px);display:flex;align-items:center;justify-content:center}
  html body #kb .k.w,html body #kb .k.wide{flex:1.5 1 0;max-width:none;font-size:clamp(11px,3.2vw,14px)}
  /* The middle row of nine letters sits half a key in from each edge, like a phone keyboard. */
  html body #kb .kr:nth-child(2):has(> :nth-child(9):last-child)::before,
  html body #kb .kr:nth-child(2):has(> :nth-child(9):last-child)::after{content:"";flex:.5 1 0}
}

/* Visible viewport height: on phones 100vh runs under the browser toolbar, 100dvh does not. */
:root{--vh:100vh}
@supports (height:100dvh){:root{--vh:100dvh}}
