/* The card of a lock being picked (ui/lockpick.js; data/picking.js says how it is worked; #337, piece 22 of #313: design-313 30-sheets.html `sheet-small`). The HUD's own dark, edge and type
   (src/data/hud.js tokens on <html>): the dark at the sheet's strength with the one thin edge of the notice's and the plates' make, in ink; the lock's name a faint label; the strain the breath's own bar
   (ui/style/glass.css `.vital`, with the breath's rows set on it as --bar-<name>, and --kept the share it is filled to); the three lines in the prompt's shape (a key drawn by keys.css, then the words at the prompt's size).
   Nothing here is a length of its own: the tokens, and the rows of PICKING.text.look, which lockpick.js sets on the plate as --pick-<name> (tests/lockpick.test.mjs holds it so). The card stands at the right of the frame, the lock
   itself left in sight in the middle of it. Everything of the picture is drawn from five custom properties on the plate, written every frame
   from the game's own numbers: --clip (the clip's place on the arc, 0 to 1), --turn (how far the plug has turned, 0 to 1),
   --strain (how strained the clip is, 0 to 1), --shake (the clip's tremble, a share of the arc), and, once, --sweep (the arc, in
   radians), --quarter (the plug's whole turn) and --half (half a turn).
   All of it is under .pick, so that no short name here is styled bare. */

.pick {
  --plug: calc(var(--pick-dial) * .4);
  position: absolute; right: max(var(--edge), var(--gutter)); top: 50%; transform: translateY(-50%);
  display: grid; gap: var(--pick-gap); justify-items: center;
  width: var(--pick-width); padding: var(--pick-pad-top) var(--pick-pad-x) var(--pick-pad-bottom);
  background: var(--dark-sheet); border-left: var(--plate-rule) solid var(--ink);
  color: var(--ink);
  pointer-events: none;
}
.pick[hidden] { display: none; }
/* the lock's name: a faint label */
.pick-name { justify-self: start; font: var(--weight-label) var(--size-label) / var(--pick-lead) var(--font-text); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-faint); }

/* the dial: the fan of marks stands over the pivot, where the clip turns and the plug turns (--cy, down the box) */
.pick-dial { --cy: 69%; position: relative; width: var(--pick-dial); height: calc(var(--pick-dial) * .72); flex: none; }
.pick-scale { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.pick-scale li { position: absolute; left: 50%; top: var(--cy); width: 0; height: 0; transform: rotate(calc((var(--at) - .5) * var(--sweep))); }
.pick-scale li::before { content: ''; position: absolute; left: calc(var(--plate-rule) / -2); top: calc(var(--pick-dial) * -.46); width: var(--plate-rule); height: calc(var(--pick-dial) * .07); background: var(--ink-dim); }
.pick-scale li[data-major]::before { height: calc(var(--pick-dial) * .11); background: var(--ink); }
.pick-clip {
  position: absolute; left: calc(50% - var(--pick-needle) / 2); top: var(--cy); width: var(--pick-needle); height: calc(var(--pick-dial) * .42);
  transform-origin: 50% 0; transform: rotate(calc(var(--half) + (var(--clip) + var(--shake) - .5) * var(--sweep)));
  background: var(--wire);   /* (the wire's colour for its strain, which ui/lockpick.js works out: the ink, going to the lamp's colour) */
}
.pick-clip::after { content: ''; position: absolute; left: var(--pick-eye-left); bottom: var(--pick-eye-bottom); width: var(--pick-eye); height: var(--pick-eye); border: var(--pick-needle) solid var(--wire); border-radius: 50%; }
.pick-plug {
  position: absolute; left: calc(50% - var(--plug) / 2); top: calc(var(--cy) - var(--plug) / 2); width: var(--plug); height: var(--plug);
  border: var(--plate-rule) solid var(--ink); border-radius: 50%; background: var(--black);
  transform: rotate(calc(var(--turn) * var(--quarter)));
}
.pick-notch { position: absolute; left: calc(50% - var(--plate-rule-heavy) / 2); top: var(--pick-notch-top); width: var(--plate-rule-heavy); height: 32%; background: var(--lamp); }
/* the mark the notch comes to when the lock has turned the whole way */
.pick-full { position: absolute; left: calc(50% + var(--plug) / 2 + var(--pick-full-gap)); top: calc(var(--cy) - var(--pick-full-half)); width: 0; height: 0; border-top: var(--pick-full-half) solid transparent; border-bottom: var(--pick-full-half) solid transparent; border-right: var(--pick-full-long) solid var(--lamp); }

/* the strain: the breath's bar as its own rules draw it (glass.css .vital: the thin bar, the fill the ink, --kept of it), the width of the card */
.pick .pick-strain { width: 100%; }

/* what the hands do: three prompts in the prompt's shape (glass.css .act), standing on the card with no plate of their own */
.pick-acts { display: grid; gap: var(--prompt-gap); justify-items: start; width: 100%; }
.pick-act { display: flex; align-items: center; gap: var(--plate-x); color: var(--ink); }
.pick-say { font-size: var(--size-say); font-weight: var(--weight-say); }
