/* Golems on the Board (src/ui/golems.js): the step vein, card layout, ghost cards, flights and the Orchestrator card's Merged today; the golem art is src/shared/golem-art/. */

/* The step vein: a crystal facet per step; the current one fills (golems.js stepVein) and a finished one flashes as it sets. */
.step { position: relative; display: block; height: 8px; overflow: hidden; background: var(--border); clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%); }
.step[data-state="done"] { background: linear-gradient(180deg, color-mix(in srgb, var(--done) 55%, white) 0 38%, var(--done) 38% 100%); }
.step[data-state="current"]::before { content: ""; position: absolute; inset: 0; transform-origin: left; background: linear-gradient(180deg, color-mix(in srgb, var(--working) 55%, white) 0 38%, var(--working) 38% 100%); }
.step.filling::before { animation: vein-fill 5s linear var(--vein) both; }
.step.filling::after { content: ""; position: absolute; top: 0; bottom: 0; left: -20px; width: 14px; background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.75), transparent); transform: skewX(-20deg); animation: vein-glint 1.4s ease-in-out var(--vein) 3 both; }
.step.setting { animation: vein-set 0.7s ease-out var(--set) both; }
@keyframes vein-fill { from { transform: scaleX(0); } }
@keyframes vein-glint { to { left: 110%; } }
@keyframes vein-set { from { filter: brightness(2.4); } }
.card[data-state="blocked"] .step[data-state="current"] { background: var(--blocked); }
.card[data-state="blocked"] .step[data-state="current"]::before, .card[data-state="blocked"] .step[data-state="current"]::after { display: none; }
.card.flow-paused .step[data-state="current"] { background: var(--accent); }
.card.flow-paused .step[data-state="current"]::before, .card.flow-paused .step[data-state="current"]::after { display: none; }
.card.has-golem, .standby-row.has-golem { flex-direction: row; align-items: center; gap: 12px; }
.standby-row.has-golem { display: flex; }
.standby-row .golem-avatar { width: 46px; height: 40px; }
.card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.golem-avatar { flex: none; width: 72px; height: 62px; }
.card.orchestrator .golem-avatar { width: 88px; height: 76px; }
@media (max-width: 720px) {
  .card.has-golem { gap: 8px; padding-left: 8px; }
  .golem-avatar { width: 44px; height: 38px; }
  .card.orchestrator .golem-avatar { width: 54px; height: 47px; }
}
@media (max-width: 480px) {
  .card.has-golem { gap: 4px; padding-left: 6px; }
  .card.has-golem .card-top, .card.has-golem .card-actions { flex-wrap: wrap; }
  .card.has-golem .card-actions { flex: 0 1 auto; min-width: 0; }
  .golem-avatar { width: 30px; height: 26px; }
  .card.orchestrator .golem-avatar { width: 38px; height: 33px; }
}
.has-golem .dot { animation: none; }
.card.ghost:not(.fx-crumble) .golem .figure { opacity: 0; }
.card.ghost:not(.fx-crumble) .golem .pebbles { opacity: 1; }
.has-golem.fleet-paused .step, .has-golem.fleet-paused .step::before, .has-golem.fleet-paused .step::after { animation: none !important; }
.has-golem.fx-launch { overflow: hidden; animation: golem-card-in 0.5s ease var(--fx-launch) both; }
@keyframes golem-card-in { from { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; } to { max-height: 260px; opacity: 1; } }
.card.ghost { overflow: hidden; pointer-events: none; animation: golem-fold 0.5s ease-in calc(var(--fx-ghost) + 1.8s) forwards; }
@keyframes golem-fold { from { height: var(--ghost-height); } to { height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; margin-bottom: -10px; opacity: 0; } }
.has-golem.fx-ping { animation: golem-ping 0.8s ease-out var(--fx-ping); }
@keyframes golem-ping { from { outline: 2px solid var(--ping); outline-offset: 0; } to { outline: 2px solid transparent; outline-offset: 10px; } }
#golem-sky { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
#golem-sky .spark { position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 8px 3px var(--tone); }
#golem-sky .trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#golem-sky .trail path { fill: none; stroke: var(--tone); stroke-width: 2; stroke-linecap: round; opacity: 0.55; }
#golem-sky .shard { position: absolute; left: 0; top: 0; width: 12px; height: 18px; filter: drop-shadow(0 0 6px var(--accent)); }
#golem-sky .shard i { display: block; width: 100%; height: 100%; clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%); background: linear-gradient(135deg, var(--crystal-hi), var(--accent)); }
/* Merged today on the Orchestrator's card: quiet and still, so a Needs-you card stays louder; it moves only as a crystal lands. */
.golem-merged { flex: none; display: flex; align-items: flex-end; gap: 8px; align-self: center; padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--panel) 70%, transparent); border: 1px solid var(--border); }
.merged-cluster { flex: none; width: 72px; height: 41px; }
.merged-cluster .cluster { display: block; width: 100%; height: 100%; overflow: visible; }
.merged-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.merged-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.merged-count { font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.has-golem.fx-grow .merged-count { color: var(--accent); animation: golem-bump 0.5s ease-out var(--fx-grow) both; }
.card[data-state="blocked"] .golem-merged { opacity: 0.7; }
@media (max-width: 720px) { .golem-merged { gap: 4px; padding: 3px 6px; } .merged-cluster { width: 44px; height: 25px; } .merged-label { display: none; } .merged-count { font-size: 16px; } }
@media (max-width: 480px) { .golem-merged { flex-direction: column; align-items: center; gap: 1px; padding: 2px 4px; } .merged-cluster { width: 32px; height: 18px; } .merged-count { font-size: 13px; } }
@keyframes golem-bump { 40% { transform: scale(1.3); } }
/* Nothing moves while the window is hidden or minimized, or for a card scrolled out of view. */
body.motion-hold .has-golem, body.motion-hold .has-golem *, body.motion-hold .has-golem *::before, body.motion-hold .has-golem *::after, body.motion-hold .step::before, body.motion-hold .step::after,
.card.offscreen, .card.offscreen *, .card.offscreen *::before, .card.offscreen *::after { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) {
  .card.has-golem, .step, .step::before, .step::after, .merged-count { animation: none !important; transition: none !important; }
}
