/* The knockout: a glove lands a punch on the screen and a starburst names the winner. See knockout.js. */

html.ko-running, html.ko-running body { overflow: hidden; }

.ko { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; overflow: hidden; pointer-events: none; }

/* The glove comes straight at you from the top right, growing as it nears, then drops away. */
.ko-glove { position: absolute; width: min(72vw, 62vh, 480px); color: var(--k); transform: translate(85vw, -45vh) rotate(38deg) scale(0.3); }
body[data-ground="ink"] .ko-glove { color: var(--y); }
.ko.swing .ko-glove { transform: translate(0, 0) rotate(-6deg) scale(1.25); transition: transform 0.42s cubic-bezier(0.6, 0, 0.9, 0.35); }
.ko.hit .ko-glove { transform: rotate(-2deg) scale(1.05); transition: transform 0.2s ease-out; }
.ko.announce .ko-glove { transform: translate(-25vw, 130vh) rotate(-55deg) scale(0.9); transition: transform 0.55s cubic-bezier(0.5, 0, 0.9, 0.5); }

/* The starburst pops out of the impact. */
.ko-star { position: relative; width: min(96vw, 80vh, 620px); aspect-ratio: 1; container-type: inline-size; transform: scale(0) rotate(-45deg); }
.ko.announce .ko-star { transform: scale(1) rotate(-7deg); transition: transform 0.45s cubic-bezier(0.2, 1.7, 0.4, 1) 0.1s; }
.ko.out .ko-star { transform: scale(0) rotate(25deg); transition: transform 0.26s ease-in; }
.ko-shadow, .ko-burst { position: absolute; inset: 0; }
.ko-shadow { background: var(--k); transform: translate(2.4cqw, 2.4cqw); }
body[data-ground="ink"] .ko-shadow { background: var(--y); }
.ko-burst { display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--r); color: #fff; text-align: center; }
.ko-top { font-size: 9cqw; line-height: 1; letter-spacing: 0.08em; }
.ko-name { max-width: 62cqw; font-size: min(30cqw, calc(140cqw / var(--len))); line-height: 0.9; font-weight: 400; color: var(--y); overflow-wrap: anywhere; }
.ko-sub { font-size: 7.5cqw; line-height: 1.15; letter-spacing: 0.06em; }

/* The jolt when the punch lands. */
.ko-shake { animation: ko-shake 0.42s linear; }
@keyframes ko-shake {
  0% { transform: none; }
  14% { transform: translate(-12px, 7px) rotate(-0.7deg); }
  30% { transform: translate(10px, -6px) rotate(0.6deg); }
  46% { transform: translate(-7px, 4px) rotate(-0.3deg); }
  64% { transform: translate(5px, -2px); }
  82% { transform: translate(-2px, 1px); }
  100% { transform: none; }
}
