/* The mech (assets/mech/portrait.js), as the Lab's Edition № X draws it.
   The canvas is transparent and sits in a layer behind the stage's text: the machine walks in
   from the right and comes to stand on the empty mark (.mech-mark .card-img). The layer reaches
   above and below the section so smoke and missiles are not cut off at its edges, and the
   canvas fades at its own edges for the same reason. */
.mech-layer{position:absolute;left:0;right:0;top:-50vh;bottom:-30vh;z-index:0;overflow:hidden;pointer-events:none}
.mech-canvas{position:absolute;left:0;top:0;display:block;opacity:0;transition:opacity .45s ease;will-change:transform;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent),linear-gradient(180deg,transparent,#000 7%,#000 97%,transparent);-webkit-mask-composite:source-in;
  mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent),linear-gradient(180deg,transparent,#000 7%,#000 97%,transparent);mask-composite:intersect}
.mech-layer.on .mech-canvas{opacity:1}
/* the crack in the glass where a bolt lands: pops in scaled small, grows as it flashes,
   fades and is gone — the pane resets itself */
.mech-crack{position:absolute;z-index:4;pointer-events:none;transform:translate(-50%,-50%) scale(.55);opacity:0;
  filter:drop-shadow(0 0 7px rgba(170,205,255,.95));transition:opacity .05s linear,transform .09s cubic-bezier(.2,.8,.3,1)}
.mech-crack.on{opacity:1;transform:translate(-50%,-50%) scale(1)}
.mech-crack.off{opacity:0;transition:opacity .5s ease,transform .5s ease;transform:translate(-50%,-50%) scale(1.04)}
.mech-crack::before{content:"";position:absolute;left:50%;top:50%;width:360px;height:360px;transform:translate(-50%,-50%);
  background:radial-gradient(circle,rgba(225,240,255,.6),rgba(170,205,255,.18) 38%,transparent 68%)}
@media(pointer:coarse){.mech-canvas{-webkit-mask-image:none;mask-image:none}}
.mech-mark .mech-fire{position:absolute;inset:0;z-index:8;width:100%;height:100%;background:none;border:0;padding:0;cursor:crosshair;font:inherit}
.mech-mark .mech-sound{position:absolute;left:0;bottom:-72px;z-index:9;font:inherit;font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;color:var(--fg-muted);
  background:none;border:1px solid var(--rule);padding:6px 11px;border-radius:2px;cursor:pointer;transition:color .2s,border-color .2s}
.mech-mark .mech-sound:hover,.mech-mark .mech-sound:focus-visible{color:var(--fg);border-color:var(--fg-muted)}
.mech-mark .mech-sound[aria-pressed="false"]{color:var(--fg-faint)}
.mech-mark .mech-fire:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.mech-mark .mech-cue{position:absolute;right:10px;bottom:10px;font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;color:var(--fg);
  background:var(--shade);backdrop-filter:blur(8px);border:1px solid var(--rule);padding:7px 12px;border-radius:2px;
  opacity:0;transform:translateY(4px);transition:opacity .3s ease,transform .3s cubic-bezier(.22,1,.36,1)}
.mech-mark .mech-fire:hover .mech-cue,.mech-mark .mech-fire:focus-visible .mech-cue{opacity:1;transform:none}
.mech-mark .mech-fire.fired .mech-cue{opacity:0}
/* no hover on a touch screen: once the machine is ready, the cue simply shows */
@media(hover:none){.mech-mark .card-img.mech-ready .mech-fire:not(.fired) .mech-cue{opacity:.85;transform:none}}
/* shown on the empty mark while the entrance waits for the click that lets it make sound */
.mech-mark .mech-wait{position:absolute;left:50%;top:58%;transform:translate(-50%,-50%);z-index:9;pointer-events:none;white-space:nowrap;
  font-size:.78rem;letter-spacing:.22em;text-transform:uppercase;color:var(--gold);border:1px solid var(--gold);padding:11px 20px;border-radius:2px;
  opacity:0;transition:opacity .4s ease}
.mech-mark .card-img.mech-waiting .mech-wait{opacity:1;animation:mech-wait 1.8s ease-in-out infinite}
.mech-mark .card-img.mech-waiting .mech-cue{display:none}
@keyframes mech-wait{50%{opacity:.45}}
