/* the typing test's words, as keycaps: shared by the typing test and the live screen on /record, so the two look
   exactly alike. Needs juketype.css (.key, the rarity skins) and nametags.css */
.ttw{position:relative;display:inline-flex;gap:2px}
.ttw .key{min-width:1.2em;height:1.5em;padding:0 .2em;border-radius:.15em;font-weight:700}
/* a cleared word: it hops, and its letters hold still (no shimmer left running across the page) */
.ttw.ok{animation:ttok .32s cubic-bezier(.2,1.6,.4,1)}
@keyframes ttok{40%{transform:translateY(-.22em) scale(1.06)}}
.ttw.ok.tskin.tskin.tskin .key.hit{animation:none}
.ttw.ok.tskin.tskin.tskin .key.hit::before{display:none}
/* mistakes: a wrong letter goes red, letters past the end are red keys, a word left wrong is underlined red */
/* ---- the word packs, in every test: each pack is a keycap colourway, like a custom keyboard set, and every word
   wears it alike; a key you hit fills with the set's highlight. Mistakes keep the usual red (the orange test's
   words too) */
.ttw.pw .key{transition:background .15s,color .15s,box-shadow .15s}
.ttw.pw .key.err{background:var(--bad);color:#fff;border-color:var(--bad);border-bottom-color:color-mix(in srgb,var(--bad) 65%,#000);box-shadow:none;text-shadow:none;animation:tterr .18s}
.ttw.pw .key.xtra{background:color-mix(in srgb,var(--bad) 78%,#000);color:#fff;border-color:transparent;border-bottom-color:#000;box-shadow:none;text-shadow:none;opacity:.9;animation:tterr .18s}
.ttw.pw .key.hit{animation:keyhit .26s cubic-bezier(.2,1.6,.4,1)}
.ttw.pk .key:not(.err):not(.xtra){background:linear-gradient(180deg,color-mix(in srgb,var(--c) 86%,#fff) 0%,var(--c) 70%);color:var(--l);border:1px solid color-mix(in srgb,var(--c) 78%,#000);border-bottom:.2em solid color-mix(in srgb,var(--c) 60%,#000);box-shadow:inset 0 1px 0 color-mix(in srgb,var(--c) 55%,#fff),0 .1em .25em rgba(0,0,0,.14);text-shadow:none;transition:background .12s,color .12s,border-color .12s,transform .12s}
.ttw.pk .key.hit:not(.err){background:linear-gradient(180deg,color-mix(in srgb,var(--h) 82%,#fff) 0%,var(--h) 70%);color:var(--hl);border-color:color-mix(in srgb,var(--h) 75%,#000);border-bottom-color:color-mix(in srgb,var(--h) 55%,#000);border-bottom-width:.12em;transform:translateY(.08em);box-shadow:inset 0 1px 0 color-mix(in srgb,var(--h) 55%,#fff),0 0 .6em color-mix(in srgb,var(--h) 35%,transparent)}
/* the orange test's words: orange letters on the usual cap, and solid orange once hit */
.ttw.orw .key:not(.err):not(.xtra){color:var(--c);border-color:color-mix(in srgb,var(--c) 40%,var(--cap-line));border-bottom-color:color-mix(in srgb,var(--c) 65%,var(--cap-edge))}
.ttw.orw .key.hit:not(.err){background:var(--c);color:#fff;border-color:var(--c);border-bottom-color:color-mix(in srgb,var(--c) 65%,#000);box-shadow:0 0 12px color-mix(in srgb,var(--c) 40%,transparent)}
@media (prefers-reduced-motion:reduce){.ttw.pw .key.hit{animation:none!important}}
.ttw.tskin.tskin.tskin .key.err{background:var(--bad);color:#fff;border-color:var(--bad);border-bottom-color:color-mix(in srgb,var(--bad) 65%,#000);box-shadow:none;animation:tterr .18s}
.ttw.tskin.tskin.tskin .key.xtra{background:color-mix(in srgb,var(--bad) 78%,#000);color:#fff;border-color:transparent;border-bottom-color:#000;box-shadow:none;opacity:.9;animation:tterr .18s}
@keyframes tterr{30%{transform:translateX(-2px)}65%{transform:translateX(2px)}}
/* the orange test: a space on a wrong orange shakes it, and it stays put until it's fixed */
.ttw.nope{animation:ttnope .3s}
@keyframes ttnope{20%{transform:translateX(-5px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}
.ttw.bad::after{content:'';position:absolute;left:0;right:0;bottom:-7px;height:3px;border-radius:2px;background:var(--bad)}
.ttw.bad .key.miss{opacity:.45}
/* the caret: a flashing underscore under the next letter, gliding as you type */
.ttcaret{position:absolute;left:0;top:0;height:4px;border-radius:2px;background:var(--ink);pointer-events:none;transition:transform .09s ease-out,width .09s ease-out;animation:ttblink 1s step-end infinite}
.ttcaret.typing{animation:none}
@keyframes ttblink{50%{opacity:0}}
