/* One drawing of a key (ui/keys.js keyOf): a plate for a keyboard key, a pad's button or a finger's control, the drawn mouse for a mouse button, its wheel and a drag. The look is the design's `.key`,
   `.key.hold`, `.no .key` and `.mouse` (design-313 00-head.html). Every length and colour is the HUD's token or a share of one: the sizes are --key-size and --key-line, the plate's ground is --dark-key, its ink
   --ink, --ink-faint and --ink-dim. #316 adds --key-size, --key-line and --dark-key to HUD.tokens; until it is in, each is read with a fallback of the very value #316 gives it, so this part draws
   the same before and after, and #341 takes the fallbacks out. Percentages and plain ratios are shares of the thing drawn, not lengths. The names are this part's own (.keydraw, .keyplate, .keymouse): the
   prompt's .key, the how-to page's and the sheet's .keys list are older and are not touched until each of their parts takes the drawing up (#321, #322, #318, #330). */

.keydraw { display: inline-flex; align-items: center; flex: none; gap: calc(var(--key-size, 1.75em) * .25); font: var(--weight-label, 600) var(--size-label, .875rem) / 1 var(--font-text); color: var(--ink); vertical-align: middle; }

.keyplate { display: inline-grid; place-items: center; flex: none; min-width: var(--key-size, 1.75em); height: var(--key-size, 1.75em); padding: 0 calc(var(--key-size, 1.75em) * .26); border: var(--key-line, 1.5px) solid var(--ink); background: var(--dark-key, rgb(4 6 7 / .9)); color: var(--ink); white-space: nowrap; }
.keyplate.round { width: var(--key-size, 1.75em); padding: 0; border-radius: 50%; }

.keymouse { display: inline-block; flex: none; position: relative; overflow: hidden; height: var(--key-size, 1.75em); aspect-ratio: 23 / 35; border: var(--key-line, 1.5px) solid var(--ink); border-radius: 50% / 33%; background: var(--dark-key, rgb(4 6 7 / .9)); }
.keymouse::before { content: ''; position: absolute; top: 0; height: 45%; width: 50%; background: var(--ink); display: none; }
.keymouse.l::before, .keymouse.r::before, .keymouse.m::before { display: block; }
.keymouse.l::before { left: 0; }
.keymouse.r::before { right: 0; }
.keymouse.m::before { left: 35%; width: 30%; top: 12%; height: 30%; }

/* The wheel's mark: where the middle button is, drawn as a slot with the way a notch turns it as a triangle in it; a wheel that turns either way is the slot alone, hollow. */
.keymouse .wheel { position: absolute; left: 35%; width: 30%; top: 12%; height: 30%; background: var(--ink); }
.keymouse .wheel[data-way='up'] { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.keymouse .wheel[data-way='down'] { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.keymouse .wheel[data-way='none'] { background: transparent; border: var(--key-line, 1.5px) solid var(--ink); }

/* The hold: the weighted foot. */
.keyplate.hold, .keymouse.hold { box-shadow: inset 0 calc(var(--key-size, 1.75em) * -.17) 0 var(--ink-faint); }

/* The refusal: dashed and dimmed. */
.keydraw.no { color: var(--ink-dim); }
.keydraw.no .keyplate { border-style: dashed; border-color: var(--ink-faint); color: var(--ink-faint); background: transparent; }
.keydraw.no .keymouse { border-style: dashed; border-color: var(--ink-faint); background: transparent; }
.keydraw.no .keymouse::before, .keydraw.no .keymouse .wheel { background: var(--ink-faint); }
.keydraw.no .keymouse .wheel[data-way='none'] { background: transparent; border-color: var(--ink-faint); }
