/* The Works (js/works/): the funds, the press and the crew list (laid out round the yard by works-layout.css), and the stamp dock on a phone.
   The yard and press are baked pictures stacked and stepped with CSS (no canvas); the counters change a few times a second. */
#works h2 small { font: 700 13px var(--f-ui); letter-spacing: 0.08em; color: var(--ink-dim); margin-left: 8px; }
.wklbl { display: block; font: 700 10.5px/1 var(--f-ui); letter-spacing: 2.4px; text-transform: uppercase; color: #a8987a; }
.wkaway { margin: 6px 0 0; padding: 8px 12px; border: 2px solid var(--wk-ink, #0a0612); border-radius: 8px; background: rgba(122, 255, 42, 0.1); color: var(--wk-potion, #7aff2a); font: 700 14px var(--f-ui); }

/* the funds: the big number, then what it makes a second */
.wkfundsbox { padding: 14px 16px; border: 3px solid var(--wk-ink, #0a0612); border-radius: 12px; background: linear-gradient(180deg, #2b2e37, #1f2128); box-shadow: 0 4px 0 var(--wk-ink, #0a0612); }
#wkfunds { display: block; margin: 8px 0 6px; font: 400 34px/1 Rye, Georgia, serif; color: #ffd27a; text-shadow: 0 2px 0 #0a0612, 0 0 18px rgba(255, 154, 42, 0.35); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wkrate { font: 700 13px var(--f-ui); color: var(--wk-magenta, #ff3ac0); }
.wklist { display: block; margin-top: 6px; font: 700 12px var(--f-ui); color: #a8a090; }

/* the press: its own stage, glowing amber over magenta */
.wkpressbox { position: relative; padding: 12px 10px 10px; border: 3px solid var(--wk-ink, #0a0612); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 0 var(--wk-ink, #0a0612);
  background: radial-gradient(60% 45% at 50% 30%, rgba(255, 154, 42, 0.16), transparent 70%), radial-gradient(70% 30% at 50% 100%, rgba(255, 58, 192, 0.12), transparent 70%), linear-gradient(180deg, #22252d, #16181d); }
.wkpress { min-height: 120px; outline: none; border-radius: 8px; }
.wkpress:focus-visible, .wkpress.pad-focus { box-shadow: 0 0 0 3px #2ae0ff; }
.pstage { position: relative; width: 100%; aspect-ratio: var(--pa); touch-action: manipulation; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; }
.pstage > * { position: absolute; display: block; pointer-events: none; }
.pstage img { max-width: none; }
.pstage .pa { overflow: hidden; }
.pstage .pa img { position: absolute; left: 0; top: 0; height: 100%; animation: wkrun 1s infinite; will-change: transform; }
.pstage .pa.once img { animation: none; }
.pstage.hit .pa.once img { animation: wkrun var(--d) steps(var(--n)) 1; }
.pstage .needle { transform-origin: 50% 50%; }
.pstage .needle g { transition: transform 0.25s steps(8); transform: rotate(var(--g)); }
.pstage .pa.steam { transition: opacity 0.4s, transform 0.3s; transform-origin: 50% 100%; }
.pstage .pa.steam.gush { transform: scale(1.12); }
.wkpops { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.wkpop { position: absolute; top: 18%; transform: translateX(-50%); white-space: nowrap; font: 800 18px/1 var(--f-ui); color: #ffd27a; text-shadow: 0 2px 0 #0a0612; animation: wkrise 1.1s ease-out forwards; }
.wkpop.big { color: var(--wk-magenta, #ff3ac0); font-size: 21px; text-shadow: 0 0 12px rgba(255, 58, 192, 0.7), 0 2px 0 #0a0612; }
.wkpop.blown { color: #8d877b; }
@keyframes wkrise { to { transform: translate(-50%, -60px); opacity: 0; } }
.wkmeta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.wkmult { font: 800 13px/1 var(--f-ui); letter-spacing: 1px; text-transform: uppercase; color: #cfc6b4; white-space: nowrap; }
.wkmult[data-state="green"] { color: var(--wk-potion, #7aff2a); text-shadow: 0 0 14px rgba(122, 255, 42, 0.5); }
.wkmult[data-state="blown"] { color: #ff5a3a; }
.wkkeys { display: flex; gap: 4px; }
.wkkeys kbd, .wkkey { font: 800 10.5px/1 var(--f-ui); color: #cfc6b4; padding: 5px 6px; border-radius: 6px; border: 1.5px solid var(--wk-ink, #0a0612); background: linear-gradient(#3a3e48, #25282f); box-shadow: 0 2px 0 var(--wk-ink, #0a0612); }

/* the yard: the baked 3D yard, layer on layer */
.wkyardhd, .wkcrewhd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wkyardhd b, .wkcrewhd b { font: 400 22px/1 Rye, Georgia, serif; color: var(--wk-paper, #f0ece0); }
.wktape { font: 700 13px var(--f-ui); color: #cfc6b4; }
.wktape b { color: #2ae0ff; }
/* the crew list */
.wkbuy { display: flex; padding: 3px; border-radius: 10px; border: 2px solid var(--wk-ink, #0a0612); background: #0f1014; }
.wkbuy button { min-width: 44px; min-height: 40px; padding: 0 8px; border: 0; border-radius: 7px; background: none; font: 800 12px/1 var(--f-ui); color: #8d877b; cursor: pointer; }
.wkbuy button.on { color: #2a1604; background: linear-gradient(#ffe4a0, #d9971f); box-shadow: 0 2px 0 var(--wk-ink, #0a0612); }
.wkcrews { display: flex; flex-direction: column; gap: 8px; max-height: 64vh; overflow-y: auto; padding: 2px 4px 6px 2px; }
.wkcrew { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 13px; border: 2px solid var(--wk-ink, #0a0612); background: linear-gradient(180deg, #2b2e37, #1f2128); box-shadow: 0 3px 0 var(--wk-ink, #0a0612); }
.wkcrew.locked { opacity: 0.55; background: repeating-linear-gradient(135deg, #1a1c21 0 8px, #16171c 8px 16px); }
.wkface { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--wk-ink, #0a0612); background: radial-gradient(circle at 50% 40%, #3a3e48, #121318); }
.wkface > i { position: absolute; inset: 0; overflow: hidden; border-radius: 50%; }
.wkface > i::before { content: ""; position: absolute; left: 0; top: 0; width: 800%; height: 100%; background: var(--f) 0 0 / 100% 100%; animation: wkrun 0.8s steps(8) infinite; }
.wkn { position: absolute; right: -8px; bottom: -5px; font: 800 11px/1 var(--f-ui); color: #0a0612; padding: 3px 5px; border-radius: 7px; border: 2px solid #0a0612; background: linear-gradient(#a6f6ff, #2ae0ff); }
.wkinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wkinfo > b { font: 800 14px var(--f-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wkline { font: 600 12px var(--f-ui); color: #a8a090; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wkline .g { font-style: normal; color: var(--wk-potion, #7aff2a); }
.wkkey { position: absolute; left: 4px; top: 4px; padding: 2px 4px; font-size: 9px; }
.wkhire, .wkmethod { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 96px; min-height: 48px; padding: 0 8px; cursor: pointer;
  border: 2px solid var(--wk-ink, #0a0612); border-radius: 10px; background: linear-gradient(#3a3e48, #25282f); color: #8d877b; box-shadow: 0 3px 0 var(--wk-ink, #0a0612); font-family: var(--f-ui); }
.wkhire i, .wkmethod i { font: 700 9.5px/1 var(--f-ui); letter-spacing: 1.5px; text-transform: uppercase; font-style: normal; }
.wkhire b, .wkmethod b { font: 800 13.5px/1 var(--f-ui); }
.wkhire.can { color: #2a1604; background: linear-gradient(#ffe4a0, #d9971f); }
.wkmethod { min-height: 40px; flex: 1 0 100%; flex-direction: row; justify-content: space-between; gap: 8px; }
.wkmethod i { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0.3px; font-size: 11.5px; }
.wkmethod.can { color: #0a0612; background: linear-gradient(#b5ff7a, #4fc21a); }
.wkdock { display: none; }

/* a phone: the stamp button in a dock along the bottom (the press's picture stays off) */
@media (max-width: 719px) {
  #wkfunds { font-size: 28px; }
  .wkhire { min-width: 84px; }
  .wkdock { display: flex; position: sticky; bottom: 0; z-index: 5; margin: 12px -6px 0; align-items: center; gap: 12px; padding: 10px 14px 14px; border: 3px solid var(--wk-ink, #0a0612); border-bottom: 0; border-radius: 18px 18px 0 0; background: linear-gradient(180deg, #2d313a, #1c1e24); }
  .wkstampbtn { flex: none; width: 76px; height: 76px; border-radius: 50%; border: 3px solid var(--wk-ink, #0a0612); font: 400 14px/1 Rye, Georgia, serif; color: #3a2206; touch-action: manipulation; cursor: pointer;
    background: radial-gradient(circle at 40% 30%, #ffe9b0, #f2b632 45%, #9a6414); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.6), 0 5px 0 var(--wk-ink, #0a0612), 0 0 24px rgba(242, 182, 50, 0.45); }
  .wkstampbtn:active { transform: translateY(3px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.6), 0 2px 0 var(--wk-ink, #0a0612); }
  .wkdockinfo { font: 700 13px var(--f-ui); color: #cfc6b4; }
  .wkkey { display: none; }
}
#works .ypause *, #works.ypause * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .pstage .pa img, .wkface > i::before { animation: none !important; } .wkpop { animation-duration: 0.01s; } }
