.claw{--u:calc(100cqw / 240);--open:60deg;--shut:asin(calc((var(--grip) - 3) / 29.5));--lift:calc((var(--hang) - 128) * var(--u));aspect-ratio:240/352;color:#2d2a24;-webkit-user-select:none;user-select:none;background:url(/examples/ink/as-claw-machine.svg) 0 0/100% no-repeat;width:100%;max-width:28rem;margin:0 auto;font-family:Shantell Sans,sans-serif;font-weight:700;position:relative;container-type:inline-size}.claw>*,.claw button{box-sizing:border-box;margin:0;position:absolute}.claw button{color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;padding:0}.claw :focus-visible{outline-offset:2px;border-radius:6px;outline:2px dashed}.claw .prize,.claw .slipped{top:calc(220 * var(--u));left:calc(22 * var(--u));width:calc(102 * var(--u));height:calc(32 * var(--u));text-align:center;place-items:center;font-size:.8rem;line-height:1;display:grid}.claw .prize[aria-busy=true]{color:#2d2a2480}.claw .slipped{background:#8fc07a;border-radius:4px}.claw .slipped[aria-busy=true] span{opacity:.5}.claw .drop{top:calc(214 * var(--u));left:calc(126 * var(--u));width:calc(94 * var(--u));height:calc(44 * var(--u));justify-content:space-between;align-items:center;font-size:.7rem;display:flex}.claw .drop:after{content:"";width:calc(60 * var(--u));aspect-ratio:60/44;background:url(/examples/ink/as-claw-drop.svg) 0 0/200% 100% no-repeat}.claw .drop:active:after{background-position-x:100%}.claw .slipped button{top:calc(42 * var(--u));left:calc(113 * var(--u));width:calc(80 * var(--u));height:calc(48 * var(--u));padding-bottom:calc(1 * var(--u));white-space:nowrap;background:url(/examples/ink/as-claw-slot.svg) 0 0/100%;place-items:end center;font-size:.65rem;line-height:1.2;display:grid}.claw .slipped button:after{content:"";top:calc(-6 * var(--u));left:calc(34 * var(--u));width:calc(12 * var(--u));aspect-ratio:1;opacity:0;background:url(/examples/ink/as-claw-coin.svg) 0 0/100%;position:absolute}.claw .prize:before,.claw .prize:after{content:"";top:calc(50 * var(--u));left:calc(22 * var(--u));width:calc(44 * var(--u));height:calc(60 * var(--u));background:url(/examples/ink/as-claw-toys.svg) no-repeat;background-size:calc(264 * var(--u)) calc(44 * var(--u));background-position:calc(var(--k) * -44 * var(--u)) calc(14 * var(--u));position:absolute}.claw .prize:after{--k:var(--was);opacity:0}.claw .prize[aria-busy=true]:before{opacity:.5}.claw .toy{--d:max(var(--k) - var(--toy), var(--toy) - var(--k));--hit:max(0, 1 - var(--d));--near:max(0, 1 - max(var(--d) - 1, 1 - var(--d)));--out:0;--won:0;--seen:calc(1 - var(--out) + var(--won));--fly:calc((-34.6 - var(--k) * 33.2) * var(--u));top:calc(-48 * var(--u));left:calc((28.6 + var(--k) * 33.2) * var(--u));width:calc(44 * var(--u));aspect-ratio:1;background:url(/examples/ink/as-claw-toys.svg) calc(var(--k) * 20%) 0 / 600% 100% no-repeat;opacity:calc(1 - var(--out));position:absolute}.claw .glass{top:calc(46 * var(--u));left:calc(56 * var(--u));width:calc(166 * var(--u));height:calc(166 * var(--u));cursor:grab;touch-action:none;overflow:visible clip}.claw .glass:before{content:"";top:calc(110 * var(--u));left:calc(-36 * var(--u));width:calc(36 * var(--u));height:calc(56 * var(--u));background:url(/examples/ink/as-claw-bin.svg) 0 0/100%;position:absolute}.claw .hook{top:calc(-107 * var(--u));left:calc((var(--aim) * 33.2 + 6.6) * var(--u));width:calc(20 * var(--u));height:calc(130 * var(--u));transform-origin:50% 0;background:url(/examples/ink/as-claw-hook.svg) 0 0/100%;position:absolute}.claw .hook:before,.claw .hook:after{--side:1;content:"";top:calc(124.5 * var(--u));left:calc(1.5 * var(--u));width:calc(12 * var(--u));height:calc(36 * var(--u));transform-origin:calc(3.5 * var(--u)) calc(2.5 * var(--u));rotate:calc(var(--side) * var(--open));background:url(/examples/ink/as-claw-arm.svg) 0 0/200% 100% no-repeat;position:absolute}.claw .hook:after{--side:-1;left:calc(6.5 * var(--u));transform-origin:calc(8.5 * var(--u)) calc(2.5 * var(--u));background-position-x:100%}.claw:has([aria-busy=true]) .glass{pointer-events:none}.claw:has([aria-busy=true]) .hook{left:calc((var(--toy) * 33.2 + 6.6) * var(--u))}.claw:has([aria-busy=true]) .hook:before{rotate:calc(var(--side) * var(--shut))}.claw:has([aria-busy=true]) .hook:after{rotate:calc(var(--side) * var(--shut))}.claw:has([aria-busy=true]) .toy{translate:0 calc(var(--hit) * var(--lift));transform-origin:50% calc((-105 - var(--hang)) * var(--u))}@media (prefers-reduced-motion:no-preference){.claw .hook{transition:left .15s ease-out}.claw .drop:after{transition:background-position 60ms}.claw .slipped:not([aria-busy=true]) button{animation:.9s ease-in-out infinite alternate claw-blink}.claw .slipped[aria-busy=true] button:after{animation:.25s ease-in claw-coin}.claw:has([aria-busy=true]) .hook{animation:.7s ease-in-out claw-grab,.5s ease-in-out .7s infinite alternate claw-sway}.claw:has([aria-busy=true]) .hook:before{animation:.7s claw-close}.claw:has([aria-busy=true]) .hook:after{animation:.7s claw-close}.claw:has([aria-busy=true]) .toy{animation:.7s claw-lift,.5s ease-in-out .7s infinite alternate claw-sway}.claw:has(.slipped:not([aria-busy=true])) .hook:before{animation:80ms ease-out claw-let-go}.claw:has(.slipped:not([aria-busy=true])) .hook:after{animation:80ms ease-out claw-let-go}.claw:has(.slipped:not([aria-busy=true])) .toy{animation:.4s 80ms backwards claw-fall}.claw:has(.fresh):not(:has(.slipped,[aria-busy=true])) .hook{animation:.65s ease-in-out claw-carry}.claw:has(.fresh):not(:has(.slipped,[aria-busy=true])) .hook:before{animation:.65s claw-drop-it}.claw:has(.fresh):not(:has(.slipped,[aria-busy=true])) .hook:after{animation:.65s claw-drop-it}.claw:has(.fresh):not(:has(.slipped,[aria-busy=true])) .toy{animation:.55s claw-away}.claw:not(:has(.slipped,[aria-busy=true])) .fresh:before{animation:.4s .55s backwards claw-tray}.claw:not(:has(.slipped,[aria-busy=true])) .fresh:after{animation:.83s claw-was}}@keyframes claw-blink{0%{opacity:.6}}@keyframes claw-coin{0%{opacity:1;translate:0 calc(-14 * var(--u))}80%{opacity:1;translate:0 calc(10 * var(--u))}to{translate:0 calc(10 * var(--u))}}@keyframes claw-grab{43%,57%{translate:0 calc((128 - var(--hang)) * var(--u))}}@keyframes claw-close{0%,43%{rotate:calc(var(--side) * var(--open));animation-timing-function:ease-in-out}57%{rotate:calc(var(--side) * var(--shut))}}@keyframes claw-lift{0%,57%{animation-timing-function:ease-in-out;translate:0}}@keyframes claw-sway{0%{rotate:calc(var(--hit,1) * -3deg)}to{rotate:calc(var(--hit,1) * 3deg)}}@keyframes claw-let-go{0%{rotate:calc(var(--side) * var(--shut))}}@keyframes claw-fall{0%{translate:0 calc(var(--hit) * var(--lift));animation-timing-function:cubic-bezier(.5,0,1,.6)}70%{translate:0;rotate:calc(var(--hit) * 12deg);scale:calc(1 + var(--hit) * .14) calc(1 - var(--hit) * .18);animation-timing-function:ease-out}84%{translate:0 calc((var(--hit) * -6 + var(--near) * -3) * var(--u));rotate:calc(var(--near) * 4deg);animation-timing-function:ease-in}}@keyframes claw-carry{0%{left:calc((var(--toy) * 33.2 + 6.6) * var(--u))}38%,62%{left:calc(-28 * var(--u))}}@keyframes claw-drop-it{0%,35%{rotate:calc(var(--side) * var(--shut));animation-timing-function:ease-out}42%{rotate:calc(var(--side) * var(--open))}}@keyframes claw-away{0%{translate:0 calc(var(--won) * var(--lift));opacity:var(--seen);animation-timing-function:ease-in-out}45%{translate:calc(var(--won) * var(--fly)) calc(var(--won) * var(--lift));opacity:var(--seen);animation-timing-function:cubic-bezier(.5,0,1,.6)}99.9%{translate:calc(var(--won) * var(--fly)) calc(var(--won) * -6 * var(--u));opacity:var(--seen)}}@keyframes claw-tray{0%{background-position-y:calc(-46 * var(--u));animation-timing-function:cubic-bezier(.5,0,1,.6)}70%{background-position-y:calc(14 * var(--u));animation-timing-function:ease-out}85%{background-position-y:calc(8 * var(--u));animation-timing-function:ease-in}}@keyframes claw-was{0%,99.9%{opacity:1}}
