/* ---------- the Workshop: a red steel toolbox seen from above (src/scenes/workshop.js; art/areas/workshop/layout.json) ----------
   Layers, back to front: the box, its lid flipped back, the trays at rest (the backmost highest, so each edge's baked
   shadow falls on the edge in front of it), the front tray, then the shut lid, which the opener squashes away. A tray
   at rest is the whole tray clipped to its front edge (--clip art px down); the front tray is not clipped. Everything
   here is the toolbox at rest, open: the opener plays the way there. */
#panel.area .wk { position: absolute; inset: 0; pointer-events: none; }
/* the art: each piece is its picture stretched over its box, pixels kept square */
#panel.area .wk-art { display: block; margin: 0; padding: 0; border: 0; background: no-repeat 0 0 / 100% 100%; image-rendering: pixelated; }
#panel.area .wk-box { z-index: 1; pointer-events: auto; background-image: url(../../art/areas/workshop/box.png); } /* the toolbox catches clicks: only the bare felt closes the place */
#panel.area .wk-lido { z-index: 2; pointer-events: auto; background-image: url(../../art/areas/workshop/lid_open.png); transform-origin: 50% calc(var(--a) * var(--hinge)); }
#panel.area .wk-lid { z-index: 9; opacity: 0; background-image: url(../../art/areas/workshop/lid.png); transform-origin: 50% 0; }
#panel.area .wk-trayart { position: absolute; inset: 0; background-image: url(../../art/areas/workshop/tray.png); transition: filter 0.12s ease; }
#panel.area .wk-comps { position: absolute; inset: 0; }
/* a locked board's tags and icons lose some of their colour: nothing on it can be bought yet */
#panel.area .wk-tray.wk-locked .wk-comps { filter: saturate(0.45) brightness(0.9); }

/* the label holder's card names the branch; a locked board hangs its padlock beside it */
#panel.area .wk-label { z-index: 2; display: block; overflow: clip visible; white-space: nowrap; /* clipped at the sides only, as .wk-name */ text-align: center; color: #23201c; text-shadow: none;
  font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--fu) * 7.5 * var(--fit, 1)); line-height: calc(var(--a) * 5.5); }
#panel.area .wk-lock { z-index: 3; background-image: url(../../art/areas/workshop/padlock.png); }
/* the brass tabs over the tray (the Grading and Trophy Room tabs, .gr-tab): four even tabs, the one on show pressed in;
   a locked branch is dulled and hangs a small padlock before its name */
#panel.area .wk-tabs { gap: calc(var(--a) * 3); }
#panel.area .wk-tab { flex: 1 1 0; justify-content: center; min-width: 0; font-family: var(--font-ui); font-size: calc(var(--fu) * 7.5); }
#panel.area .wk-tab.wk-tlock:not(.on) { filter: saturate(0.4) brightness(0.85); }
#panel.area .wk-tpad { flex: none; width: calc(var(--a) * 3.5); height: calc(var(--a) * 4.5); background: url(../../art/areas/workshop/padlock.png) 0 0 / 100% 100%; image-rendering: pixelated; }

/* ---------- a compartment: the icon over the tag's twine, the tag's name, pips and effect, the sticker, the tack ---------- */
#panel.area .wk-comp { z-index: 1; }
#panel.area .wk-tag { z-index: 1; background-image: url(../../art/areas/workshop/tag.png); }
#panel.area .wk-ico { z-index: 2; margin: 0; }
#panel.area .wk-comp:hover .wk-ico { animation: icoHop 0.45s steps(4, end); }
#panel.area .wk-name { z-index: 3; display: block; overflow: clip visible; white-space: nowrap; /* clipped at the sides only: descenders hang below the line */ color: #23201c; text-shadow: none;
  font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--fu) * 7.5 * var(--fit, 1)); line-height: calc(var(--a) * 5); }
#panel.area .wk-pips { z-index: 3; display: flex; gap: var(--a); }
#panel.area .wk-pips i { flex: none; width: calc(var(--a) * 3); height: calc(var(--a) * 3); background: url(../../art/areas/workshop/pip_off.png) 0 0 / 100% 100%; image-rendering: pixelated; }
#panel.area .wk-pips i.wk-on { background-image: url(../../art/areas/workshop/pip_on.png); }
#panel.area .wk-pips.wk-small i { width: calc(var(--a) * 2); background-image: url(../../art/areas/workshop/pip_s_off.png); }
#panel.area .wk-pips.wk-small i.wk-on { background-image: url(../../art/areas/workshop/pip_s_on.png); }
#panel.area .wk-lvl { z-index: 3; display: block; white-space: nowrap; color: #7a2a26; text-shadow: none;
  font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--fu) * 6.5); line-height: calc(var(--a) * 5); }
/* the effect: up to three lines under the printed rule; where it runs long its font steps down (--fit, set by the scene) */
#panel.area .wk-eff { z-index: 3; display: block; overflow: hidden; color: #3a2e22; text-shadow: none;
  font-family: var(--font-ui); font-size: calc(var(--fu) * 7 * var(--fit, 1)); line-height: 1.38; }

/* the price sticker (a 9-slice: its printed border keeps its width, the white grows) buys the next level; pressed, it
   lies flat a pixel lower and to the right, and its price with it */
#panel.area .wk-price { z-index: 3; padding: 0; margin: 0; background: none; box-shadow: none; border-radius: 0; cursor: pointer; image-rendering: pixelated;
  border-style: solid; border-width: calc(var(--a) * 3) calc(var(--a) * 4) calc(var(--a) * 4) calc(var(--a) * 3);
  border-image: url(../../art/areas/workshop/price.png) 3 4 4 3 fill stretch; }
#panel.area .wk-price span { position: absolute; inset: calc(var(--a) * -1); display: grid; place-items: center; overflow: clip visible; white-space: nowrap; color: #23201c; text-shadow: none;
  font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--fu) * 7 * var(--fit, 1)); line-height: 1; font-variant-numeric: tabular-nums; }
#panel.area .wk-price:hover { filter: brightness(1.05); }
#panel.area .wk-price:hover span { color: #7a2a26; }
#panel.area .wk-price.poor span { color: #8f8578; }
#panel.area .wk-price:is(:active, .wk-down) { filter: none; border-image-source: url(../../art/areas/workshop/price_dn.png); }
#panel.area .wk-price:is(:active, .wk-down) span { translate: var(--a) var(--a); }
#panel.area .wk-price:focus-visible { outline: var(--g) solid #f3ead2; outline-offset: 0; }
/* while the board is locked the price is only written on the floor */
#panel.area .wk-floor { z-index: 3; display: grid; place-items: center; white-space: nowrap; color: #f1e7cd; text-shadow: none;
  font-family: var(--font-ui); font-weight: 700; font-size: calc(var(--fu) * 7); line-height: 1; font-variant-numeric: tabular-nums; }
#panel.area .wk-max { z-index: 3; background-image: url(../../art/areas/workshop/max.png); }
/* the thumbtack: lying on its side, or pushed into the floor when pinned */
#panel.area .wk-pin { z-index: 3; border-radius: 0; box-shadow: none; background-image: url(../../art/areas/workshop/pin_off.png); cursor: pointer; transition: translate 0.08s ease; }
#panel.area .wk-pin.wk-on { background-image: url(../../art/areas/workshop/pin_on.png); }
#panel.area .wk-pin:hover { translate: 0 calc(var(--a) * -1); }
#panel.area .wk-pin:active { translate: 0 0; }
#panel.area .wk-pin:focus-visible { outline: var(--g) solid #f3ead2; outline-offset: 0; }
body.calm #panel.area :is(.wk-pin, .wk-trayart) { transition: none; }
body.calm #panel.area .wk-comp:hover .wk-ico { animation: none; }

/* the branch note, written on the masking tape across the box's front */
#panel.area .wk-note { z-index: 7; display: block; overflow: hidden; white-space: nowrap; text-align: center; color: #23201c; text-shadow: none;
  font-family: var(--font-ui); font-size: calc(var(--fu) * 7.5 * var(--fit, 1)); line-height: calc(var(--a) * 6); }
#panel.area .wk-note.wk-locked { color: #5a1530; font-weight: 700; }
