badgeright,bottom color=inlinebadgeright!60!black}}}

\NewDocumentCommand\iconscaled{O{0.85}m}{\scalebox{#1}[#1]{#2}}

\NewDocumentCommand\intdropshadowtextleft{m}{%
	\begin{tikzpicture}[baseline=(TESTL.base),outer sep=0pt, inner sep=0pt]
		\node[inlinebadge-left-text!40!black] at (0,-0.05ex) {#1};
		\node[inlinebadge-left-text] (TESTL) at (0,0) {#1};
	\end{tikzpicture}%
}

\NewDocumentCommand\intdropshadowtextright{m}{%
	\begin{tikzpicture}[baseline=(TESTR.base),outer sep=0pt, inner sep=0pt]
		\node[inlinebadge-right-text!40!black] at (0,-0.05ex) {#1};
		\node[inlinebadge-right-text] (TESTR) at (0,0) {#1};
	\end{tikzpicture}%
}

\newtcbox\intleftpart{tcbinlinebadgeleft}
\newtcbox\intrightpart{tcbinlinebadgeright}

\defKV[inlinetikzbadge]{%
	leftcolor=\colorlet{inlinebadgeleft}{#1},%
	rightcolor=\colorlet{inlinebadgeright}{#1},%
	lefttextcolor=\colorlet{inlinebadgelefttext}{#1},%
	righttextcolor=\colorlet{inlinebadgerighttext}{#1},%
	font=\def\inlinebadgefont{#1},%
	link=\def\inlinebadgelink{#1},%
}

\setKVdefault[inlinetikzbadge]{%
	leftcolor=inlinebadge-left,
	rightcolor=inlinebadge-right,
	lefttextcolor=inlinebadge-left-text,
	righttextcolor=inlinebadge-left-text,
	font=\small\sffamily,%
	link={}
}

\NewDocumentCommand\tikzinlinebadge{O{}mm}{%
	\restoreKV[inlinetikzbadge]%
	\setKV[inlinetikzbadge]{#1}%
	\IfEq{\inlinebadgelink}{}%
		{%
			\mbox{\intleftpart{\intdropshadowtextleft{\vphantom{#3}#2}}\intrightpart{\intdropshadowtextright{\vphantom{#2}#3}}}%
		}%
		{%
			{\mbox{\intleftpart{\href{\inlinebadgelink}{\intdropshadowtextleft{\vphantom{#3}#2}}}\intrightpart{\href{\inlinebadgelink}{\intdropshadowtextright{\vphantom{#2}#3}}}}}%
		}%
}

%====SMALLSTAMP
\usetikzlibrary{decorations,decorations.text}
\newlength\mylensmallstamp
\setlength\mylensmallstamp{2cm}
\newlength\mylensmallstampxinnerseptop
\newlength\mylensmallstampxinnersepbottom
\newlength\mylensmallstamptxtheight
\newlength\mylensmallstamplogoheight
\newlength\mylensmallstampbottomtxtheight
\newlength\mylensmallstamptoptxtheight
\newlength\mylensmallstamptxtlogoheight

\defKV[tkzsmallstamp]{%
	height=\setlength\mylensmallstamp{#1},%
	maincolor=\def\mycolorsmallstamp{#1},%
	toptxtcolor=\def\mytoptxtcolorsmallstamp{#1},%
	bottomtxtcolor=\def\mybottomtxtcolorsmallstamp{#1},%
	logocolor=\def\mylogotcolorsmallstamp{#1},%
	rotate=\def\myrotatesmallstamp{#1},%
	toptxtfont=\def\myfontsmallstamptop{#1},%
	bottomtxtfont=\def\myfontsmallstampbottom{#1},%
	logoscale=\def\mylogoscalesmallstamp{#1},%
	color=\def\myglobalcolorsmallstamp{#1}
}

\setKVdefault[tkzsmallstamp]{%
	height=2cm,%
	maincolor={black},%
	toptxtcolor={black},%
	bottomtxtcolor={black},%
	logocolor={black},
	inner circle=false,%
	rotate=35,%
	toptxtfont={\bfseries},%
	bottomtxtfont={\bfseries},
	reverse bottom=true,%
	image=false,%
	logoscale=1,%
	fill inner=false,%
	color={}
}

\tikzset{smallstamp/.style={line width=0.0125\mylensmallstamp}}
\tikzset{smallstampinner/.style={line width=0.005\mylensmallstamp}}

\NewDocumentCommand\pictosmallstamp{sO{}D<>{}mmm}{%
	\restoreKV[tkzsmallstamp]%
	\setKV[tkzsmallstamp]{#2}%
	\setlength\mylensmallstamptxtheight{0.125\mylensmallstamp}%
	\setlength\mylensmallstamplogoheight{\fpeval{\mylogoscalesmallstamp*0.4}\mylensmallstamp}%
	\settoheight\mylensmallstamptoptxtheight{\hbox{\myfontsmallstamptop#4}}%TOP
	\settoheight\mylensmallstampbottomtxtheight{\hbox{\myfontsmallstampbottom#5}}%BOTTOM
	%----logo
	\ifboolKV[tkzsmallstamp]{image}%
		{}%
		{%
			\settototalheight\mylensmallstamptxtlogoheight{\hbox{#6}}%LOGO
			\xdef\mytmpscalesmallstamplogo{\fpeval{\mylensmallstamplogoheight/\mylensmallstamptxtlogoheight}}%LOGO
		}%
	%----end logo
	\xdef\mytmpscalesmallstamptoptext{\fpeval{\mylensmallstamptxtheight/\mylensmallstamptoptxtheight}}%TOP
	\xdef\mytmpinvscalesmallstamptoptext{\fpeval{1/\mytmpscalesmallstamptoptext}}%
	\xdef\mytmpscalesmallstampbottomtext{\fpeval{\mylensmallstamptxtheight/\mylensmallstampbottomtxtheight}}%BOTTOM
	%----global color
	\ifthenelse{\equal{\myglobalcolorsmallstamp}{}}%
		{}%
		{%
			\def\mycolorsmallstamp{\myglobalcolorsmallstamp}%
			\def\mytoptxtcolorsmallstamp{\myglobalcolorsmallstamp}%
			\def\mybottomtxtcolorsmallstamp{\myglobalcolorsmallstamp}%
			\def\mylogotcolorsmallstamp{\myglobalcolorsmallstamp}%
		}%
	%----global color end
	\IfBooleanTF{#1}%
		{%
			\begin{tikzpicture}[overlay,remember picture,shift={#3},transform shape]
		}%
		{%
			\begin{tikzpicture}[transform shape,#3]
		}%
		\draw[\mycolorsmallstamp,smallstamp] (0,0) circle[radius=0.5\mylensmallstamp] ;
		\useasboundingbox (0,0) circle[radius=0.5\mylensmallstamp] ;
		\begin{scope}[rotate=\myrotatesmallstamp]
			\clip (0,0) circle[radius=0.5\mylensmallstamp] ;
			\ifboolKV[tkzsmallstamp]{inner circle}%
				{%
					\ifboolKV[tkzsmallstamp]{fill inner}%
						{%
							\fill[\mycolorsmallstamp!10,smallstampinner] (0,0) circle[radius=0.3\mylensmallstamp] ;%
						}%
						{%
							\draw[\mycolorsmallstamp!50,fill=\mycolorsmallstamp!10,smallstampinner] (0,0) circle[radius=0.3\mylensmallstamp] ;%
						}%
				}%
				{%
					\ifboolKV[tkzsmallstamp]{fill inner}%
						{%
							\fill[draw=none,\mycolorsmallstamp!10,smallstampinner] (0,0) circle[radius=0.3\mylensmallstamp] ;%
						}%
						{}%
				}%
			%top text
			\draw [draw=none,postaction={decorate},decoration={raise=0.0375\mylensmallstamp,text effects along path,text align=center,reverse path,text={#4},text effects/.cd,characters={scale=\mytmpscalesmallstamptoptext,font=\myfontsmallstamptop,color=\mytoptxtcolorsmallstamp}},text effects={text along path},rotate=-90] (0,0) circle[radius=0.3\mylensmallstamp] ;
			%bottom text
			\ifboolKV[tkzsmallstamp]{reverse bottom}%
				{%
					\draw [draw=none,postaction={decorate},decoration={reverse path,raise=0.0375\mylensmallstamp,text effects along path,text align=center,text={#5},text effects/.cd,characters={scale=\mytmpscalesmallstamptoptext,font=\myfontsmallstampbottom,color=\mybottomtxtcolorsmallstamp}},text effects={text along path},rotate=90] (0,0) circle[radius=0.3\mylensmallstamp] ;
				}%
				{%
					\draw [draw=none,postaction={decorate},decoration={raise=0.05\mylensmallstamp,text effects along path,text align=center,text={#5},text effects/.cd,characters={scale=\mytmpscalesmallstamptoptext,font=\myfontsmallstampbottom,color=\mybottomtxtcolorsmallstamp}},text effects={text along path},rotate=90] (0,0) circle[radius=0.5\mylensmallstamp] ;
				}%
			%middle logo
			\ifboolKV[tkzsmallstamp]{image}%
				{%
					\draw (0,0) node[anchor=center] {\includegraphics[height=\mylensmallstamplogoheight]{#6}} ;
				}%
				{%
					\clip (0,0) circle[radius=0.3\mylensmallstamp] ;
					\draw[\mylogotcolorsmallstamp] (0,0) node[scale=\mytmpscalesmallstamplogo] {#6} ;
				}%
		\end{scope}
	\end{tikzpicture}%
}

%====RINGS inspiration https://tex.stackexchange.com/posts/323693/timeline (3.0)

\newlength\tkzRingsHeight
\newlength\tkzRingsDepth
\newlength\tkzRingsFullHeight

\defKV[tkzRings]{height=\def\tkzRingsTypeHeight{#1},strut=\def\tkzRingsTypeStrut{#1},dstrut=\def\tkzRingsTypeDstrut{#1},clip bb=\def\tkzRingsClipBB{#1}}
\setKVdefault[tkzRings]{height=dauto,strut=H,dstrut=qH,clip bb=0pt,color=true}

\definecolor{tkzRings@color@blue}{RGB}{0,120,208}        % A blue
\definecolor{tkzRings@color@yellow}{RGB}{255,177,20}     % B yellow
\definecolor{tkzRings@color@black}{RGB}{0,0,0}           % C black
\definecolor{tkzRings@color@green}{RGB}{0,166,81}        % D green
\definecolor{tkzRings@color@red}{RGB}{240,40,45}         % E red

\def\tkzRingsGap(#1,#2)(#3:#4){%
	($(#1,#2) + (#3:\tkzRingsOuterWhiteRadius)$)
	arc(#3:#4:\tkzRingsOuterWhiteRadius) --
	($(#1,#2) + (#4:\tkzRingsInnerWhiteRadius)$)
	arc(#4:#3:\tkzRingsInnerWhiteRadius) --
	cycle
}

%constants
\def\tkzRingsxShift{169.5538bp}%
\def\tkzRingsyShift{-71.7013bp}%
\def\tkzRingsRadius{71.6821bp}%
\def\tkzRingsWhiteLineWidth{3.762bp}%
\def\tkzRingsColorLineWidth{12.9041bp}%
%radius
\pgfmathsetlengthmacro{\tkzRingsInnerColorRadius}{\tkzRingsRadius - \tkzRingsColorLineWidth/2}%
\pgfmathsetlengthmacro{\tkzRingsOuterColorRadius}{\tkzRingsRadius + \tkzRingsColorLineWidth/2}%
\pgfmathsetlengthmacro{\tkzRingsInnerWhiteRadius}{\tkzRingsInnerColorRadius - \tkzRingsWhiteLineWidth}%
\pgfmathsetlengthmacro{\tkzRingsOuterWhiteRadius}{\tkzRingsOuterColorRadius + \tkzRingsWhiteLineWidth}%
%centers
\def\tkzRingsxA{0pt}%
\def\tkzRingsyA{0pt}%
\pgfmathsetlengthmacro{\tkzRingsxC}{\tkzRingsxA + \tkzRingsxShift}%
\let\tkzRingsyC\tkzRingsyA%
\pgfmathsetlengthmacro{\tkzRingsxE}{\tkzRingsxC + \tkzRingsxShift}%
\let\tkzRingsyE\tkzRingsyC%
\pgfmathsetlengthmacro{\tkzRingsxB}{(\tkzRingsxA + \tkzRingsxC)/2}%
\pgfmathsetlengthmacro{\tkzRingsyB}{\tkzRingsxA + \tkzRingsyShift}%
\pgfmathsetlengthmacro{\tkzRingsxD}{(\tkzRingsxC + \tkzRingsxE)/2}%
\let\tkzRingsyD\tkzRingsyB%
%bbox
\pgfmathsetlengthmacro\tkzRingsllxBB{\tkzRingsxA - \tkzRingsOuterColorRadius}%
\pgfmathsetlengthmacro\tkzRingsllyBB{\tkzRingsyB - \tkzRingsOuterColorRadius}%
\pgfmathsetlengthmacro\tkzRingsurxBB{\tkzRingsxE + \tkzRingsOuterColorRadius}%
\pgfmathsetlengthmacro\tkzRingsuryBB{\tkzRingsyE + \tkzRingsOuterColorRadius}%
%cliiping bbox
\pgfmathsetlengthmacro\tkzRingsllxClip{\tkzRingsllxBB - \tkzRingsClipBB}%
\pgfmathsetlengthmacro\tkzRingsllyClip{\tkzRingsllyBB - \tkzRingsClipBB}%
\pgfmathsetlengthmacro\tkzRingsurxClip{\tkzRingsurxBB + \tkzRingsClipBB}%
\pgfmathsetlengthmacro\tkzRingsuryClip{\tkzRingsuryBB + \tkzRingsClipBB}%
\def\tkzRingsClipBoxArea{(\tkzRingsllxClip, \tkzRingsllyClip) rectangle (\tkzRingsurxClip, \tkzRingsuryClip)}

\newcommand\intTkzRings{%
	% upper
	\begin{scope}[even odd rule]
		\clip \tkzRingsClipBoxArea
		% yellow ring in blue ring
		\tkzRingsGap(\tkzRingsxB,\tkzRingsyB)(225:135)
		% yellow ring in black ring
		\tkzRingsGap(\tkzRingsxB, \tkzRingsyB)(90:45)
		% green ring in black ring
		\tkzRingsGap(\tkzRingsxD, \tkzRingsyD)(225:135)
		% green ring in red ring
		\tkzRingsGap(\tkzRingsxD, \tkzRingsyD)(90:45) ;
		\ifboolKV[tkzRings]{color}%
			{%
				\draw[tkzRings@color@blue] (\tkzRingsxA, \tkzRingsyA) circle;
				\draw[tkzRings@color@black] (\tkzRingsxC, \tkzRingsyC) circle;
				\draw[tkzRings@color@red] (\tkzRingsxE, \tkzRingsyE) circle;
			}%
			{%
				\draw (\tkzRingsxA, \tkzRingsyA) circle;
				\draw (\tkzRingsxC, \tkzRingsyC) circle;
				\draw (\tkzRingsxE, \tkzRingsyE) circle;
			}%
	\end{scope}
	% lower
	\begin{scope}[even odd rule]
		\clip \tkzRingsClipBoxArea
		% blue ring in yellow ring
		\tkzRingsGap(\tkzRingsxA, \tkzRingsyA)(45:-45)
		% black ring in yellow ring
		\tkzRingsGap(\tkzRingsxC, \tkzRingsyC)(225:270)
		% black ring in green ring
		\tkzRingsGap(\tkzRingsxC, \tkzRingsyC)(45:-45)
		% red ring in green ring
		\tkzRingsGap(\tkzRingsxE, \tkzRingsyE)(225:270) ;
		\ifboolKV[tkzRings]{color}%
			{%
				\draw[tkzRings@color@yellow] (\tkzRingsxB, \tkzRingsyB) circle;
				\draw[tkzRings@color@green] (\tkzRingsxD, \tkzRingsyD) circle;
			}%
			{%
				\draw (\tkzRingsxB, \tkzRingsyB) circle;
				\draw (\tkzRingsxD, \tkzRingsyD) circle;
			}%
	\end{scope}
	\useasboundingbox (\tkzRingsllxBB, \tkzRingsllyBB) rectangle (\tkzRingsurxBB, \tkzRingsuryBB);
}
\NewDocumentCommand\tkzRings{O{}m}{%
	\restoreKV[tkzRings]%
	\setKV[tkzRings]{#1}%
	%scale
	\IfSubStr{\tkzRingsTypeHeight}{auto}%
		{%
			\IfSubStr{\tkzRingsTypeHeight}{d}%
				{%
					\settototalheight\tkzRingsHeight{\hbox{\tkzRingsTypeDstrut}}%
					\settodepth\tkzRingsDepth{\hbox{\tkzRingsTypeDstrut}}%
					\pgfmathsetlengthmacro{\tkzRingsFullHeight}{(\tkzRingsyA+\tkzRingsRadius)-(\tkzRingsyB-\tkzRingsRadius)}%
					\xdef\tkzRingsScale{\fpeval{\tkzRingsHeight/(\tkzRingsFullHeight+\tkzRingsColorLineWidth)}}%
					\settodepth\tkzRingsDepth{\hbox{\tkzRingsTypeDstrut}}%
					\raisebox{-\tkzRingsDepth}{%
						\begin{tikzpicture}[scale=\tkzRingsScale,line width=\fpeval{\tkzRingsScale*\tkzRingsColorLineWidth},radius=\tkzRingsRadius,#2]
							\intTkzRings
						\end{tikzpicture}%
					}%
				}%
				{%
					\settototalheight\tkzRingsHeight{\hbox{\tkzRingsTypeStrut}}%
					\pgfmathsetlengthmacro{\tkzRingsFullHeight}{(\tkzRingsyA+\tkzRingsRadius)-(\tkzRingsyB-\tkzRingsRadius)}%
					\xdef\tkzRingsScale{\fpeval{\tkzRingsHeight/(\tkzRingsFullHeight+\tkzRingsColorLineWidth)}}%
					\begin{tikzpicture}[scale=\tkzRingsScale,line width=\fpeval{\tkzRingsScale*\tkzRingsColorLineWidth},radius=\tkzRingsRadius,#2]
						\intTkzRings
					\end{tikzpicture}%
				}%
		}%
		{%
			%scale
			\setlength\tkzRingsHeight{\tkzRingsTypeHeight}%
			\pgfmathsetlengthmacro{\tkzRingsFullHeight}{(\tkzRingsyA+\tkzRingsRadius)-(\tkzRingsyB-\tkzRingsRadius)}%
			\xdef\tkzRingsScale{\fpeval{\tkzRingsHeight/(\tkzRingsFullHeight+\tkzRingsColorLineWidth)}}%
			%tikzpicture
			\begin{tikzpicture}[scale=\tkzRingsScale,line width=\fpeval{\tkzRingsScale*\tkzRingsColorLineWidth},radius=\tkzRingsRadius,#2]
				\intTkzRings
			\end{tikzpicture}%
		}%
}

\NewCommandCopy\pictorings\tkzRings

%====RUBIK's CUBE
\RequirePackage{tikz-3dplot}
\usetikzlibrary{3d}

\setKVdefault[tikzrubik]{height=auto,width=auto,radius=0.1,strut={qM},empty color={},rescale=1}
\defKV[tikzrubik]{height=\def\tikzrubikmyheight{#1},width=\def\tikzrubikmywidth{#1},radius=\pgfmathsetmacro\tikzrubikradius{#1},strut=\def\tikzrubikstrut{#1},empty color=\def\tikzrubikfillempty{#1},rescale=\def\tikzrubikmycustomscale{#1}}

%====colors
\definecolor{rcB}{HTML}{0000FF}
\definecolor{rcW}{HTML}{FFFFFF}
\definecolor{rcY}{HTML}{FFFF00}
\definecolor{rcG}{HTML}{008000}
\definecolor{rcO}{HTML}{FFA500}
\definecolor{rcR}{HTML}{FF0000}
%list of colors (array)
\def\myrubcolors{{"rcW","rcY","rcY","rcR","rcW","rcB","rcW","rcO","rcB","rcG","rcR","rcG","rcR","rcO","rcG","rcY","rcG","rcW","rcB","rcO","rcB","rcG","rcG","rcW","rcO","rcW","rcR"}}
%====dim
\newlength\tikrcfixedheight
\newlength\tikrcfixedwidth
\setlength\tikrcfixedheight{4.46cm}
\setlength\tikrcfixedwidth{4.15cm}
\newlength\tikrcusedheight
\newlength\tikrcusedwidth
\newlength\tikrcuseddepth

\newcommand\inttkzrubic{%
	\begin{tikzpicture}[scale=\tikrcscale,line width=\fpeval{\tikrcscale*0.4}mm,transform shape]
%		\draw[lightgray,xstep=0.1,ystep=0.1] (-2.2,-2.3) grid (2.2,2.3) ;
%		\draw[gray] (-2.2,-2.3) grid (2.2,2.3) ;
		%\tdplotsetmaincoords{55}{150}%
		\tdplotsetmaincoords{65}{120}%
		\begin{scope}[tdplot_main_coords,line join=round,fill=\tikzrubikfillempty]
			\foreach \X in {-1.5,-0.5,0.5}{
				\foreach \Y in {-1.5,-0.5,0.5}{
					%faces1/2/3 (hidden)
					\draw [canvas is yz plane at x=-1.5,shift={(\X,\Y)}] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
					\draw [canvas is xz plane at y=-1.5,shift={(\X,\Y)}] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
					\draw [canvas is yx plane at z=-1.5,shift={(\X,\Y)}] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
				}
			}
		\end{scope}
		\begin{scope}[tdplot_main_coords,line join=round]
			\foreach \X [count=\nX starting from 0] in {-1.5,-0.5,0.5}{
				\foreach \Y [count=\nY starting from 0] in {-1.5,-0.5,0.5}{
					%faces4/5/6 (view)
					\pgfmathtruncatemacro{\numposcol}{\nX+3*(2-\nY)}
					\pgfmathsetmacro{\myrccolor}{\myrubcolors[\numposcol]}
					\draw [canvas is yz plane at x=1.5,shift={(\X,\Y)},fill=\myrccolor] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
					\pgfmathtruncatemacro{\numposcol}{2-\nX+3*(2-\nY)+9}
					\pgfmathsetmacro{\myrccolor}{\myrubcolors[\numposcol]}
					\draw [canvas is xz plane at y=1.5,shift={(\X,\Y)},fill=\myrccolor] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
					\pgfmathtruncatemacro{\numposcol}{2-\nY+3*\nX+18}
					\pgfmathsetmacro{\myrccolor}{\myrubcolors[\numposcol]}
					\draw [canvas is yx plane at z=1.5,shift={(\X,\Y)},fill=\myrccolor] (0.5,0) -- ({1-\tikzrubikradius},0) arc (-90:0:\tikzrubikradius) -- (1,{1-\tikzrubikradius}) arc (0:90:\tikzrubikradius) -- (\tikzrubikradius,1) arc (90:180:\tikzrubikradius) -- (0,\tikzrubikradius) arc (180:270:\tikzrubikradius) -- cycle;
				}
			}
		\end{scope}
	\end{tikzpicture}%
}

\NewDocumentCommand\tkzPuzzleCube{ !O{} }{%
	\restoreKV[tikzrubik]%
	\setKV[tikzrubik]{#1}%
	\ifthenelse{\equal{\tikzrubikmyheight}{auto}}%
		{%
			\ifthenelse{\equal{\tikzrubikmywidth}{auto}}%
				{%full auto (inline ?)
					\settototalheight\tikrcusedheight{\hbox{\tikzrubikstrut}}%
					\settodepth\tikrcuseddepth{\hbox{\tikzrubikstrut}}%
					\xdef\tikrcscale{\fpeval{\tikzrubikmycustomscale*\tikrcusedheight/\tikrcfixedheight}}%
					\raisebox{\dimexpr-\tikrcuseddepth+0.5\tikrcusedheight-\fpeval{0.5*\tikzrubikmycustomscale}\tikrcusedheight\relax}{\inttkzrubic}%
				}%
				{%width given
					\setlength\tikrcusedwidth{\tikzrubikmywidth}%
					\xdef\tikrcscale{\fpeval{\tikrcusedwidth/\tikrcfixedwidth}}%
					\inttkzrubic
				}%
		}%
		{%
			\ifthenelse{\equal{\tikzrubikmywidth}{auto}}%
				{%height given
					\setlength\tikrcusedheight{\tikzrubikmyheight}%
					\xdef\tikrcscale{\fpeval{\tikrcusedheight/\tikrcfixedheight}}%
					\inttkzrubic
				}%
				{}%
		}%
}

\NewCommandCopy\pictorubcube\tkzPuzzleCube

%====SIMPLE PROGRESS BAR
\newlength\widthprogressbartikz
\newlength\depthprogressbartikz
\newlength\heightprogressbartikz

\colorlet{colorprogressbartikz}{gray}
\colorlet{colorprogressbarbordertikz}{black}

\tikzset{progressbartikzshade/.style={shading=axis,right color=colorprogressbartikz,left color=colorprogressbartikz!50!white}}

\newcommand\intprogressbartikz[1]{%
	\begin{tikzpicture}[x={\widthprogressbartikz},y={\heightprogressbartikz},line width={\fpeval{0.0375*\heightprogressbartikz}pt},scale=\fpeval{1/(1+0.0375)}]
		\ifboolKV[progressbartikz]{shade}
			{%
				\fill[progressbartikzshade] (0,0) rectangle ({#1},1);
			}%
			{%
				\fill[colorprogressbartikz] (0,0) rectangle ({#1},1);
			}%
		\draw[colorprogressbarbordertikz] (0,0) rectangle (1,1);
	\end{tikzpicture}%
}

\defKV[progressbartikz]{%
	width=\setlength\widthprogressbartikz{#1},%
	height=\def\typeheightprogressbartikz{#1},%
	fill color=\colorlet{colorprogressbartikz}{#1},%
	border color=\colorlet{colorprogressbarbordertikz}{#1},%
	strut=\def\strutprogressbartikz{#1},%
	dstrut=\def\dstrutprogressbartikz{#1}
}

\setKVdefault[progressbartikz]{%
	width=1.25in,%
	height=dauto,%
	fill color=gray,%
	border color=black,%
	shade=true,%
	strut={M},%
	dstrut={qM}
}

\NewDocumentCommand{\tkzProgressbar}{ O{} m }{%
	\restoreKV[progressbartikz]%
	\setKV[progressbartikz]{#1}%
	\xdef\tmpargpbtikz{\fpeval{min(max(#2,0),1)}}%
	\ifthenelse{\equal{\typeheightprogressbartikz}{dauto}}%
		{%
			\settototalheight\heightprogressbartikz{\hbox{\dstrutprogressbartikz}}%
			\settodepth\depthprogressbartikz{\hbox{\dstrutprogressbartikz}}%
			\raisebox{-\depthprogressbartikz}%
				{%
					\intprogressbartikz{\tmpargpbtikz}%
				}%
		}%
		{%
			\ifthenelse{\equal{\typeheightprogressbartikz}{auto}}%
				{%height given
					\settoheight\heightprogressbartikz{\hbox{\strutprogressbartikz}}%
				}%
				{%
					\setlength\heightprogressbartikz{\typeheightprogressbartikz}%
				}%
			\intprogressbartikz{\tmpargpbtikz}%
		}%
}

\NewCommandCopy\pictoprogressbar\tkzProgressbar

%====kakarot Hair
\newlength\tkzhairgkheight
\newlength\tkzhairgkfullheight
\newlength\tkzhairgkdepth
\setlength\tkzhairgkfullheight{8cm}

\newcommand\inttkzhairgk[2][]{%
	\begin{tikzpicture}[scale=#2,#1,transform shape,]
		\path[draw=none,fill] (10.0, -7.9).. controls (10.0, -7.9) 
		and (10.9, -7.1) .. (11.7, -7.0).. controls (11.7, -7.0) and (10.8, -6.5) .. 
		(9.0, -6.9).. controls (9.0, -6.9) and (8.6, -5.5) .. (7.2, -5.5).. controls 
		(7.2, -5.5) and (6.7, -3.4) .. (5.7, -2.6).. controls (5.7, -2.6) and (6.2, 
		-3.9) .. (6.1, -4.9).. controls (6.1, -4.9) and (5.3, -3.4) .. (2.9, -3.4).. 
		controls (2.9, -3.4) and (3.7, -4.1) .. (3.9, -4.7).. controls (3.9, -4.7) and
		(3.3, -4.7) .. (2.9, -4.9).. controls (2.9, -4.9) and (4.1, -5.4) .. (4.1, 
		-6.1).. controls (4.1, -6.1) and (2.6, -5.2) .. (0.8, -6.3).. controls (0.8, 
		-6.3) and (2.6, -6.9) .. (3.5, -8.3).. controls (3.5, -8.3) and (2.2, -8.0) ..
		(1.0, -8.8).. controls (1.0, -8.8) and (3.3, -8.9) .. (4.0, -9.7).. controls 
		(4.0, -9.7) and (3.3, -10.1) .. (3.0, -10.3).. controls (3.0, -10.3) and (4.4,
		-10.2) .. (4.6, -10.5).. controls (4.6, -10.5) and (4.3, -9.6) .. (4.2, 
		-8.7).. controls (4.2, -8.7) and (4.5, -8.7) .. (4.9, -9.7).. controls (4.9, 
		-9.7) and (5.0, -8.5) .. (5.5, -8.4).. controls (5.5, -8.4) and (5.4, -9.5) ..
		(5.5, -9.7).. controls (5.5, -9.7) and (6.0, -8.5) .. (6.9, -8.0).. controls 
		(6.9, -8.0) and (7.2, -8.9) .. (7.0, -10.0).. controls (7.0, -10.0) and (7.9, 
		-9.0) .. (7.9, -8.1).. controls (7.9, -8.1) and (8.3, -8.6) .. (8.3, -9.3).. 
		controls (8.3, -9.3) and (8.8, -8.6) .. (9.2, -8.7).. controls (9.2, -8.7) and
		(9.3, -9.6) .. (8.3, -10.6).. controls (8.3, -10.6) and (9.5, -9.9) .. (10.3,
		-9.7).. controls (10.3, -9.7) and (10.1, -9.5) .. (9.7, -9.6).. controls 
		(9.7, -9.6) and (11.5, -8.5) .. (12.4, -8.2).. controls (12.4, -8.2) and 
		(11.7, -7.8) .. (10.0, -7.9) -- cycle;
	\end{tikzpicture}%
}

\NewDocumentCommand\pictogkhair{ O{} m }{%
	\ifthenelse{\equal{#2}{dauto}}%
		{%
			\settototalheight\tkzhairgkheight{\hbox{qM}}%
			\settodepth\tkzhairgkdepth{\hbox{qM}}%
			\xdef\tkzhairgkglobalscale{\fpeval{\tkzhairgkheight/\tkzhairgkfullheight}}%
			\raisebox{-\tkzhairgkdepth}{%
				\inttkzhairgk[#1]{\tkzhairgkglobalscale}%
			}%
		}%
		{%
			\ifthenelse{\equal{#2}{auto}}%
				{%
					\settoheight\tkzhairgkheight{\hbox{M}}%
					\xdef\tkzhairgkglobalscale{\fpeval{\tkzhairgkheight/\tkzhairgkfullheight}}%
				}%
				{%
					\xdef\tkzhairgkglobalscale{\fpeval{#2/\tkzhairgkfullheight}}%
				}%
			\inttkzhairgk[#1]{\tkzhairgkglobalscale}%
		}%
}

%====3dim deco (v1)
\newlength\tkzdecothreedimheight
\newlength\tkzdecothreedimdepth

\newcommand\inttkzdecothreedimA{%
	\foreach \angle in {0,90,180,270}{%
		\draw[rotate=\angle,tkzdecothreedim ext color] (1,1)--++(0,1.5)--++(0.5,0)--++(0,-1)--++(1,0)--++(0,-0.5)--cycle;
		\draw[rotate=\angle,tkzdecothreedim main color] (0,0)--(0.5,0)--(2.5,1)--(1,1)--cycle;
		\draw[rotate=\angle,tkzdecothreedim shadow color] (0,0)--(0,0.5)--(1,2.5)--(1,1)--cycle;
	}
}

\def\inttikztridimbigradius{3.6}
\def\inttikztridimsmallradius{3.2}
\newcommand\inttkzdecothreedimB{%
	%border
	\filldraw[tkzdecothreedim shadow alt color] (25:\inttikztridimbigradius)--(90:\inttikztridimsmallradius)--(155:\inttikztridimbigradius)--(155:{2/3*\inttikztridimbigradius})--(90:{2/3*\inttikztridimsmallradius})--(25:{2/3*\inttikztridimbigradius})--cycle ;
	\filldraw[tkzdecothreedim shadow color] (155:{2/3*\inttikztridimbigradius})--(155:\inttikztridimbigradius)--(-155:\inttikztridimbigradius)--(-90:\inttikztridimsmallradius)--(-90:{2/3*\inttikztridimsmallradius})--(-155:{2/3*\inttikztridimbigradius})--cycle ;
	\filldraw[tkzdecothreedim main color] (-90:\inttikztridimsmallradius)--(-90:{2/3*\inttikztridimsmallradius})--(-25:{2/3*\inttikztridimbigradius})--(25:{2/3*\inttikztridimbigradius})--(25:\inttikztridimbigradius)--(-25:\inttikztridimbigradius)--cycle ;
	%inner border
	\filldraw[tkzdecothreedim shadow color] (90:{1/3*\inttikztridimsmallradius})--(90:{2/3*\inttikztridimsmallradius})--(25:{2/3*\inttikztridimbigradius})--(-25:{2/3*\inttikztridimbigradius})--(-25:{1/3*\inttikztridimbigradius})--(25:{1/3*\inttikztridimbigradius})--cycle;
	\filldraw[tkzdecothreedim main color] (90:{1/3*\inttikztridimsmallradius})--(90:{2/3*\inttikztridimsmallradius})--(155:{2/3*\inttikztridimbigradius})--(-155:{2/3*\inttikztridimbigradius})--(-155:{1/3*\inttikztridimbigradius})--(155:{1/3*\inttikztridimbigradius})--cycle;
	\filldraw[tkzdecothreedim shadow alt color] (-155:{1/3*\inttikztridimsmallradius})--(-155:{2/3*\inttikztridimbigradius})--(-90:{2/3*\inttikztridimsmallradius})--(-25:{2/3*\inttikztridimbigradius})--(-25:{1/3*\inttikztridimbigradius})--(-90:{1/3*\inttikztridimsmallradius})--cycle;
	%inner
	\filldraw[tkzdecothreedim main color] (0,0)--(25:{1/3*\inttikztridimbigradius})--(-25:{1/3*\inttikztridimbigradius})--(-90:{1/3*\inttikztridimsmallradius})--cycle ;
	\filldraw[tkzdecothreedim shadow alt color] (0,0)--(25:{1/3*\inttikztridimbigradius})--(90:{1/3*\inttikztridimsmallradius})--(155:{1/3*\inttikztridimbigradius})--cycle ;
	\filldraw[tkzdecothreedim shadow color] (0,0)--(155:{1/3*\inttikztridimbigradius})--(-155:{1/3*\inttikztridimbigradius})--(-90:{1/3*\inttikztridimsmallradius})--cycle ;
}

\newcommand\inttkzdecothreedimC{%
	%shadow
	\draw[tkzdecothreedim shadow alt color] (3,3)--(9,9)--++(3,0)--(0,3)--cycle;
	\draw[tkzdecothreedim shadow alt color] (9,3)--(3,9)--++(-3,0)--(12,3)--cycle;
	\draw[tkzdecothreedim shadow alt color] (4.5,3)--(7.5,9)--++(-3,0)--(7.5,3)--cycle;
	\draw[fill=darkgray!50!black,line join=bevel] (3,4.5)--(9,7.5)--(9,4.5)--(3,7.5)--cycle;
	\draw[fill=darkgray!50!black,line join=bevel] (3,3)--(3,0)--(9,12)--(9,9)--cycle;
	\draw[fill=darkgray!50!black,line join=bevel] (9,3)--(9,0)--(3,12)--(3,9)--cycle;
	\setsepchar{,}%
	\readlist*\tkzthreedimdecolistecouls{\tkzthreedimdecocouls}%
	\foreach \i in {0,1,2}{%
		\foreach \j in {0,1,2}{%
			\xdef\k{\inteval{3*\j+\i+1}}%
			\itemtomacro\tkzthreedimdecolistecouls[\k]{\tmpmycol}%
			\draw[fill=\tmpmycol,line join=bevel] ({4.5*\i},{4.5*\j}) rectangle++ (3,3) ;
		}
	}
}

\newcommand\inttkzdecothreedimD{%
	%black part
	\begin{scope}[line join=bevel]
		\draw[fill=black] (0,3)--++(1,-1)--++(2,1)--cycle;
		\draw[fill=black] (0,3)--++(-1,-1)--++(1,-2)--cycle;
		\draw[fill=black] (-3,0)--++(1,1)--++(-1,2)--cycle;
		\draw[fill=black] (-3,0)--++(1,-1)--++(2,1)--cycle;
		\draw[fill=black] (0,-3)--++(-1,1)--++(-2,-1)--cycle;
		\draw[fill=black] (0,-3)--++(1,1)--++(-1,2)--cycle;
		\draw[fill=black] (3,0)--++(-1,1)--++(-2,-1)--cycle;
		\draw[fill=black] (3,0)--++(-1,-1)--++(1,-2)--cycle;
		%alt part
		\draw[tkzdecothreedim main color] (0,0)--++(1,2)--++(-1,1)--cycle ;
		\draw[tkzdecothreedim main color] (0,3)--++(-1,-1)--++(-2,1)--cycle ;
		\draw[tkzdecothreedim main color] (-3,0)--++(1,1)--++(2,-1)--cycle ;
		\draw[tkzdecothreedim main color] (-3,0)--++(1,-1)--++(-1,-2)--cycle ;
		\draw[tkzdecothreedim main color] (0,-3)--++(-1,1)--++(1,2)--cycle ;
		\draw[tkzdecothreedim main color] (0,-3)--++(1,1)--++(2,-1)--cycle ;
		\draw[tkzdecothreedim main color] (3,0)--++(-1,-1)--++(-2,1)--cycle ;
		\draw[tkzdecothreedim main color] (3,0)--++(-1,1)--++(1,2)--cycle ;
	\end{scope}
	\draw (-3,-3) rectangle (3,3) ;
}

\newcommand\intpictotestautodautolen[4]{%
	\ifthenelse{\equal{#1}{auto}}{#2}{\ifthenelse{\equal{#1}{dauto}}{#3}{#4}}%
}

\newcommand\intpictotestdautolen[3]{%
	\ifthenelse{\equal{#1}{dauto}}{#2}{#3}%
}

\defKV[tkzthreedimdeco]{%
	ext color=\tikzset{tkzdecothreedim ext color/.style={fill=#1,line join=rect}},%
	main color=\tikzset{tkzdecothreedim main color/.style={fill=#1,line join=bevel}},%
	shadow color=\tikzset{tkzdecothreedim shadow color/.style={fill=#1,line join=bevel}},%
	shadow alt color=\tikzset{tkzdecothreedim shadow alt color/.style={fill=#1,line join=bevel}},%
	rescale=\def\tkzthreedimdecorescale{#1},%
	couleurs=\def\tkzthreedimdecocouls{#1},%
	strut=\def\tkzthreedimdecostrut{#1},%
	dstrut=\def\tkzthreedimdecodstrut{#1},%
	style=\def\tkzthreedimdecodstyle{#1}
}

\setKVdefault[tkzthreedimdeco]{%
	ext color=white,%
	main color=red,%
	shadow color=gray,%
	shadow alt color=lightgray,%
	rescale=1,%
	couleurs={violet,cyan,brown,yellow,red,green,teal,purple,pink},%
	strut={M},%
	dstrut={(qM)},%
	style=A
}

\NewDocumentCommand\tkzthreedimdeco{O{}D<>{}m}{%
	\restoreKV[tkzthreedimdeco]%
	\setKV[tkzthreedimdeco]{#1}%
	\intpictotestautodautolen{#3}%
		{%
			\settoheight\tkzdecothreedimheight{\hbox{\tkzthreedimdecostrut}}%
		}%
		{%
			\settototalheight\tkzdecothreedimheight{\hbox{\tkzthreedimdecodstrut}}%
			\settodepth\tkzdecothreedimdepth{\hbox{\tkzthreedimdecodstrut}}%
		}%
		{%
			\setlength\tkzdecothreedimheight{#3}%
		}%
	%style A
	\xdef\tkzdecothreedimscale{\fpeval{\tkzdecothreedimheight/50.4mm}}%
	\def\tkzdecothreedimlw{0.4}%
	%alt styles
	\ifthenelse{\equal{\tkzthreedimdecodstyle}{B}}%
		{%
			\xdef\tkzdecothreedimscale{\fpeval{\tkzdecothreedimheight/64.4mm}}%
		}%
		{}%
	\ifthenelse{\equal{\tkzthreedimdecodstyle}{C}}%
		{%
			\xdef\tkzdecothreedimscale{\fpeval{\tkzdecothreedimheight/121.2mm}}%
			\def\tkzdecothreedimlw{0.6}%
		}%
		{}%
	\ifthenelse{\equal{\tkzthreedimdecodstyle}{D}}%
		{%
			\xdef\tkzdecothreedimscale{\fpeval{\tkzdecothreedimheight/60.8mm}}%
		}%
		{}%
	%picture
	\intpictotestdautolen{#3}%
		{%
			\setlength\tkzdecothreedimdepth{\dimexpr-\tkzdecothreedimdepth+\fpeval{(1-\tkzthreedimdecorescale)/2}\tkzdecothreedimheight\relax}%
			\raisebox{\tkzdecothreedimdepth}{%
				\begin{tikzpicture}[line width=\fpeval{\tkzdecothreedimscale*\tkzdecothreedimlw}mm,scale=\fpeval{\tkzthreedimdecorescale*\tkzdecothreedimscale},#2,transform shape]
					\ifthenelse{\equal{\tkzthreedimdecodstyle}{A}}{\inttkzdecothreedimA}{}%
					\ifthenelse{\equal{\tkzthreedimdecodstyle}{B}}{\inttkzdecothreedimB}{}%
					\ifthenelse{\equal{\tkzthreedimdecodstyle}{C}}{\inttkzdecothreedimC}{}%
					\ifthenelse{\equal{\tkzthreedimdecodstyle}{D}}{\inttkzdecothreedimD}{}%
				\end{tikzpicture}%
			}%
		}%
		{%
			\begin{tikzpicture}[line width=\fpeval{\tkzthreedimdecorescale*\tkzdecothreedimscale*\tkzdecothreedimlw}mm,scale=\fpeval{\tkzthreedimdecorescale*\tkzdecothreedimscale},#2,transform shape]
				\ifthenelse{\equal{\tkzthreedimdecodstyle}{A}}{\inttkzdecothreedimA}{}%
				\ifthenelse{\equal{\tkzthreedimdecodstyle}{B}}{\inttkzdecothreedimB}{}%
				\ifthenelse{\equal{\tkzthreedimdecodstyle}{C}}{\inttkzdecothreedimC}{}%
				\ifthenelse{\equal{\tkzthreedimdecodstyle}{D}}{\inttkzdecothreedimD}{}%
			\end{tikzpicture}%
		}%
}

%====QUESTIONBLOCKMARIO
\definecolor{blockquestionyellow}{HTML}{fcd203}
\definecolor{blockquestiondarkyellow}{HTML}{8a740c}

\newlength\tkzquestionblockheight
\newlength\tkzquestionblockdepth

\newcommand\inttkzquestionblock{%
	%bg
	\draw[line width=\fpeval{\tkzquestionblockscale*3}mm,rounded corners=\fpeval{\tkzquestionblockscale*6}mm,fill=blockquestionyellow] (-5,-5) rectangle (5,5) ;
	%corners
	\foreach \x/\y in {-4/4,-4/-4,4/4,4/-4}{%
		\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm,fill=blockquestiondarkyellow] (\x,\y) circle[radius=0.35] ;
	}
	%question
	\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm,fill=white,line join=bevel] (-0.9,-3.75) rectangle (0.9,-2.5) ;
	\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm,fill=white,line join=bevel] (-0.9,-1.85)--++(1.8,0)--++(0,1)--++(0.25,0.25)--++(1.25,0)--++(0.75,0.75)--++(0,2.25)--++(-0.75,0.75)--++(-4.8,0)--++(-0.75,-0.75)--++(0,-1.75)--++(1.75,0)--++(0,1.25)--++(0.25,0.25)--++(2.3,0)--++(0.25,-0.25)--++(0,-1.35)--++(-0.25,-0.25)--++(-1.3,0)--++(-0.75,-0.75)--cycle;
}

\newcommand\inttkzquestionblockbw{%
	%bg
	\draw[line width=\fpeval{\tkzquestionblockscale*3}mm,rounded corners=\fpeval{\tkzquestionblockscale*6}mm] (-5,-5) rectangle (5,5) ;
	%corners
	\foreach \x/\y in {-4/4,-4/-4,4/4,4/-4}{%
		\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm] (\x,\y) circle[radius=0.35] ;
	}
	%question
	\ifboolKV[tkzquestionblock]{fill question}%
		{%
			\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm,line join=bevel,fill=black] (-0.9,-3.75) rectangle (0.9,-2.5) ;
			\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm,line join=bevel,fill=black] (-0.9,-1.85)--++(1.8,0)--++(0,1)--++(0.25,0.25)--++(1.25,0)--++(0.75,0.75)--++(0,2.25)--++(-0.75,0.75)--++(-4.8,0)--++(-0.75,-0.75)--++(0,-1.75)--++(1.75,0)--++(0,1.25)--++(0.25,0.25)--++(2.3,0)--++(0.25,-0.25)--++(0,-1.35)--++(-0.25,-0.25)--++(-1.3,0)--++(-0.75,-0.75)--cycle;
		}%
		{%
			\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm,line join=bevel] (-0.9,-3.75) rectangle (0.9,-2.5) ;
			\draw[line width=\fpeval{\tkzquestionblockscale*1.5}mm,line join=bevel] (-0.9,-1.85)--++(1.8,0)--++(0,1)--++(0.25,0.25)--++(1.25,0)--++(0.75,0.75)--++(0,2.25)--++(-0.75,0.75)--++(-4.8,0)--++(-0.75,-0.75)--++(0,-1.75)--++(1.75,0)--++(0,1.25)--++(0.25,0.25)--++(2.3,0)--++(0.25,-0.25)--++(0,-1.35)--++(-0.25,-0.25)--++(-1.3,0)--++(-0.75,-0.75)--cycle;
		}%
}

\defKV[tkzquestionblock]{%
	rescale=\def\tkzquestionblockrescale{#1},%
	strut=\def\tkzquestionblockstrut{#1},%
	dstrut=\def\tkzquestionblockdstrut{#1}
}

\setKVdefault[tkzquestionblock]{%
	rescale=1,%
	strut={M},%
	dstrut={(qM)},%
	bw=false,%
	fill question=false
}

\NewDocumentCommand\tkzquestionblock{O{}D<>{}m}{%
	\restoreKV[tkzquestionblock]%
	\setKV[tkzquestionblock]{#1}%
	\intpictotestautodautolen{#3}%
		{%
			\settoheight\tkzquestionblockheight{\hbox{\tkzquestionblockstrut}}%
		}%
		{%
			\settototalheight\tkzquestionblockheight{\hbox{\tkzquestionblockdstrut}}%
			\settodepth\tkzquestionblockdepth{\hbox{\tkzquestionblockdstrut}}%
		}%
		{%
			\setlength\tkzquestionblockheight{#3}%
		}%
	\xdef\tkzquestionblockscale{\fpeval{\tkzquestionblockheight/103mm}}%
	%picture
	\intpictotestdautolen{#3}%
		{%
			\setlength\tkzquestionblockdepth{\dimexpr-\tkzquestionblockdepth+\fpeval{(1-\tkzquestionblockrescale)/2}\tkzquestionblockheight\relax}%
			\raisebox{\tkzquestionblockdepth}{%
				\begin{tikzpicture}[scale=\fpeval{\tkzquestionblockrescale*\tkzquestionblockscale},#2,transform shape]
					\ifboolKV[tkzquestionblock]{bw}{\inttkzquestionblockbw}{\inttkzquestionblock}
				\end{tikzpicture}%
			}%
		}%
		{%
			\begin{tikzpicture}[scale=\fpeval{\tkzquestionblockrescale*\tkzquestionblockscale},#2,transform shape]
				\ifboolKV[tkzquestionblock]{bw}{\inttkzquestionblockbw}{\inttkzquestionblock}
			\end{tikzpicture}%
		}%
}

%====BRICKBLOCKMARIO
\definecolor{blockbrickbrown}{HTML}{b15c33}

\newlength\tkzbrickblockheight
\newlength\tkzbrickblockdepth

\tikzset{tkzbrickblock main color/.style={line width=\fpeval{\tkzbrickblockscale*3}mm,rounded corners=\fpeval{\tkzbrickblockscale*6}mm,fill=blockbrickbrown}}
\tikzset{tkzbrickblock bw/.style={line width=\fpeval{\tkzbrickblockscale*3}mm,rounded corners=\fpeval{\tkzbrickblockscale*6}mm}}

\newcommand\inttkzbrickblockbw{%
	%bg
	\draw[tkzbrickblock bw] (-5,-5) rectangle (0,{-1/3*5}) ;
	\draw[tkzbrickblock bw] (0,-5) rectangle (5,{-1/3*5}) ;
	\draw[tkzbrickblock bw] (-5,{-1/3*5}) rectangle (-2.5,{1/3*5}) ;
	\draw[tkzbrickblock bw] (-2.5,{-1/3*5}) rectangle (2.5,{1/3*5}) ;
	\draw[tkzbrickblock bw] (2.5,{-1/3*5}) rectangle (5,{1/3*5}) ;
	\draw[tkzbrickblock bw] (-5,{1/3*5}) rectangle (0,{5}) ;
	\draw[tkzbrickblock bw] (0,{1/3*5}) rectangle (5,5) ;
}

\newcommand\inttkzbrickblock{%
	%bg
	\draw[tkzbrickblock main color] (-5,-5) rectangle (0,{-1/3*5}) ;
	\draw[tkzbrickblock main color] (0,-5) rectangle (5,{-1/3*5}) ;
	\draw[tkzbrickblock main color] (-5,{-1/3*5}) rectangle (-2.5,{1/3*5}) ;
	\draw[tkzbrickblock main color] (-2.5,{-1/3*5}) rectangle (2.5,{1/3*5}) ;
	\draw[tkzbrickblock main color] (2.5,{-1/3*5}) rectangle (5,{1/3*5}) ;
	\draw[tkzbrickblock main color] (-5,{1/3*5}) rectangle (0,{5}) ;
	\draw[tkzbrickblock main color] (0,{1/3*5}) rectangle (5,5) ;
}

\defKV[tkzbrickblock]{%
	rescale=\def\tkzbrickblockrescale{#1},%
	strut=\def\tkzbrickblockstrut{#1},%
	dstrut=\def\tkzbrickblockdstrut{#1}
}

\setKVdefault[tkzbrickblock]{%
	rescale=1,%
	strut={M},%
	dstrut={(qM)},%
	bw=false
}

\NewDocumentCommand\tkzbrickblock{O{}D<>{}m}{%
	\restoreKV[tkzbrickblock]%
	\setKV[tkzbrickblock]{#1}%
	\intpictotestautodautolen{#3}%
	{%
		\settoheight\tkzbrickblockheight{\hbox{\tkzbrickblockstrut}}%
	}%
	{%
		\settototalheight\tkzbrickblockheight{\hbox{\tkzbrickblockdstrut}}%
		\settodepth\tkzbrickblockdepth{\hbox{\tkzbrickblockdstrut}}%
	}%
	{%
		\setlength\tkzbrickblockheight{#3}%
	}%
	\xdef\tkzbrickblockscale{\fpeval{\tkzbrickblockheight/103mm}}%
	%picture
	\intpictotestdautolen{#3}%
	{%
		\setlength\tkzbrickblockdepth{\dimexpr-\tkzbrickblockdepth+\fpeval{(1-\tkzbrickblockrescale)/2}\tkzbrickblockheight\relax}%
		\raisebox{\tkzbrickblockdepth}{%
			\begin{tikzpicture}[scale=\fpeval{\tkzbrickblockrescale*\tkzbrickblockscale},#2,transform shape]
				\ifboolKV[tkzbrickblock]{bw}{\inttkzbrickblockbw}{\inttkzbrickblock}
			\end{tikzpicture}%
		}%
	}%
	{%
		\begin{tikzpicture}[scale=\fpeval{\tkzbrickblockrescale*\tkzbrickblockscale},#2,transform shape]
			\ifboolKV[tkzbrickblock]{bw}{\inttkzbrickblockbw}{\inttkzbrickblock}
		\end{tikzpicture}%
	}%
}

%====QUESTIONBLOCKMARIO
\definecolor{blocksimplebrown}{HTML}{b15c33}

\newlength\tkzsimpleblockheight
\newlength\tkzsimpleblockdepth

\newcommand\inttkzsimpleblock{%
	%bg
	\draw[line width=\fpeval{\tkzsimpleblockscale*3}mm,rounded corners=\fpeval{\tkzsimpleblockscale*6}mm,fill=blocksimplebrown] (-5,-5) rectangle (5,5) ;
	%corners
	\foreach \x/\y in {-4/4,-4/-4,4/4,4/-4}{%
		\draw[line width=\fpeval{\tkzsimpleblockscale*1.5}mm,fill=black] (\x,\y) circle[radius=0.35] ;
	}
}

\newcommand\inttkzsimpleblockbw{%
	%bg
	\draw[line width=\fpeval{\tkzsimpleblockscale*3}mm,rounded corners=\fpeval{\tkzsimpleblockscale*6}mm] (-5,-5) rectangle (5,5) ;
	%corners
	\foreach \x/\y in {-4/4,-4/-4,4/4,4/-4}{%
		\draw[line width=\fpeval{\tkzsimpleblockscale*1.5}mm,fill=black] (\x,\y) circle[radius=0.35] ;
	}
}

\defKV[tkzsimpleblock]{%
	rescale=\def\tkzsimpleblockrescale{#1},%
	strut=\def\tkzsimpleblockstrut{#1},%
	dstrut=\def\tkzsimpleblockdstrut{#1}
}

\setKVdefault[tkzsimpleblock]{%
	rescale=1,%
	strut={M},%
	dstrut={(qM)},%
	bw=false
}

\NewDocumentCommand\tkzsimpleblock{O{}D<>{}m}{%
	\restoreKV[tkzsimpleblock]%
	\setKV[tkzsimpleblock]{#1}%
	\intpictotestautodautolen{#3}%
		{%
			\settoheight\tkzsimpleblockheight{\hbox{\tkzsimpleblockstrut}}%
		}%
		{%
			\settototalheight\tkzsimpleblockheight{\hbox{\tkzsimpleblockdstrut}}%
			\settodepth\tkzsimpleblockdepth{\hbox{\tkzsimpleblockdstrut}}%
		}%
		{%
			\setlength\tkzsimpleblockheight{#3}%
		}%
	\xdef\tkzsimpleblockscale{\fpeval{\tkzsimpleblockheight/103mm}}%
	%picture
	\intpictotestdautolen{#3}%
		{%
			\setlength\tkzsimpleblockdepth{\dimexpr-\tkzsimpleblockdepth+\fpeval{(1-\tkzsimpleblockrescale)/2}\tkzsimpleblockheight\relax}%
			\raisebox{\tkzsimpleblockdepth}{%
				\begin{tikzpicture}[scale=\fpeval{\tkzsimpleblockrescale*\tkzsimpleblockscale},#2,transform shape]
					\ifboolKV[tkzsimpleblock]{bw}{\inttkzsimpleblockbw}{\inttkzsimpleblock}
				\end{tikzpicture}%
			}%
		}%
		{%
			\begin{tikzpicture}[scale=\fpeval{\tkzsimpleblockrescale*\tkzsimpleblockscale},#2,transform shape]
				\ifboolKV[tkzsimpleblock]{bw}{\inttkzsimpleblockbw}{\inttkzsimpleblock}
			\end{tikzpicture}%
		}%
}

%====CHIBI HAMSTER (CC0 https://www.svgrepo.com/svg/110242/hamster)
\newlength\tkzchibihamsterheight
\newlength\tkzchibihamsterdepth

\definecolor{tkzchibihamsterA}{RGB}{255,201,194}
\definecolor{tkzchibihamsterB}{RGB}{254,167,147}
\definecolor{tkzchibihamsterC}{RGB}{89,18,0}

\tikzset{tkzchibihamster ear color/.style={fill=tkzchibihamsterA}}
\tikzset{tkzchibihamster body color/.style={fill=tkzchibihamsterB}}
\tikzset{tkzchibihamster border color/.style={fill=tkzchibihamsterC}}

\newcommand\intchibihamster{%
	\path[tkzchibihamster ear color] (4.1855, 12.4825).. controls (3.2468, 11.979) and (2.4713, 11.2105) .. (1.96, 10.2765) -- (1.96, 12.1972).. controls (1.96, 12.8218) and (2.4664, 13.3282) .. (3.091, 13.3282).. controls (3.6171, 13.3282) and (4.059, 12.969) .. (4.1855, 12.4825) -- cycle;
	\path[tkzchibihamster ear color] (11.5866, 12.1972) -- (11.5866, 10.2765).. controls (11.0751, 11.2105) and (10.2998, 11.979) .. (9.3609, 12.4822).. controls (9.4876, 12.969) and (9.9296, 13.3282) .. (10.4557, 13.3282).. controls (11.0803, 13.3282) and (11.5866, 12.8218) .. (11.5866, 12.1972) -- cycle;
	\path[tkzchibihamster body color] (11.5866, 10.2751).. controls (14.3356, 5.0667) and (12.8026, 0.2185) .. (6.7733, 0.2185).. controls (0.744, 0.2185) and (-0.7889, 5.0667) .. (1.96, 10.2751) -- (1.96, 10.2765).. controls (2.4713, 11.2105) and (3.2468, 11.979) .. (4.1855, 12.4825).. controls (4.9563, 12.8956) and (5.8376, 13.1301) .. (6.7733, 13.1301).. controls (7.7094, 13.1301) and (8.5903, 12.8958) .. (9.3609, 12.4822).. controls (10.2998, 11.979) and (11.0751, 11.2105) .. (11.5866, 10.2765) -- (11.5866, 10.2751) -- cycle;
	\path[tkzchibihamster border color] (4.9276, 9.9036) -- (3.9697, 10.0274).. controls (3.8501, 10.0429) and (3.7405, 9.9583) .. (3.725, 9.8387).. controls (3.7095, 9.719) and (3.794, 9.6095) .. (3.9137, 9.594) -- (4.6811, 9.4948) -- (4.6811, 9.1042).. controls (4.6811, 8.9836) and (4.779, 8.8857) .. (4.8996, 8.8857).. controls (5.0203, 8.8857) and (5.1181, 8.9836) .. (5.1181, 9.1042) -- (5.1181, 9.6869).. controls (5.1181, 9.7967) and (5.0366, 9.8895) .. (4.9276, 9.9036) -- cycle;
	\path[tkzchibihamster border color] (9.577, 10.0273) -- (8.619, 9.9035).. controls (8.5101, 9.8895) and (8.4285, 9.7967) .. (8.4285, 9.6869) -- (8.4285, 9.1042).. controls (8.4285, 8.9835) and (8.5264, 8.8857) .. (8.647, 8.8857).. controls (8.7677, 8.8857) and (8.8655, 8.9835) .. (8.8655, 9.1042) -- (8.8655, 9.4948) -- (9.633, 9.594).. controls (9.7526, 9.6094) and (9.8371, 9.719) .. (9.8217, 9.8386).. controls (9.8062, 9.9583) and (9.6968, 10.0429) .. (9.577, 10.0273) -- cycle;
	\path[tkzchibihamster border color] (13.099, 6.1373).. controls (12.9981, 7.4545) and (12.5509, 8.9028) .. (11.8052, 10.3289) -- (11.8052, 12.1971).. controls (11.8052, 12.9413) and (11.1998, 13.5467) .. (10.4557, 13.5467).. controls (9.9315, 13.5467) and (9.4638, 13.2445) .. (9.2418, 12.7868).. controls (8.4773, 13.1538) and (7.6343, 13.3487) .. (6.7733, 13.3487).. controls (5.9124, 13.3487) and (5.0694, 13.1538) .. (4.3049, 12.7869).. controls (4.0828, 13.2445) and (3.6152, 13.5467) .. (3.091, 13.5467).. controls (2.3469, 13.5467) and (1.7415, 12.9413) .. (1.7415, 12.1971) -- (1.7415, 10.3289).. controls (0.9958, 8.9028) and (0.5486, 7.4545) .. (0.4476, 6.1373).. controls (0.3446, 4.7926) and (0.6003, 3.5673) .. (1.1872, 2.5939).. controls (1.682, 1.7734) and (2.3988, 1.1338) .. (3.3176, 0.6931).. controls (4.2765, 0.2332) and (5.4391, 0.0) .. (6.7733, 0.0).. controls (8.1075, 0.0) and (9.2702, 0.2332) .. (10.229, 0.6931).. controls (11.1479, 1.1338) and (11.8647, 1.7734) .. (12.3594, 2.5939).. controls (12.9464, 3.5673) and (13.2021, 4.7926) .. (13.099, 6.1373) -- cycle(11.9852, 2.8195).. controls (11.0454, 1.2609) and (9.2431, 0.437) .. (6.7733, 0.437).. controls (4.3035, 0.437) and (2.5013, 1.2609) .. (1.5615, 2.8195).. controls (0.4468, 4.6682) and (0.6625, 7.3485) .. (2.1532, 10.1731).. controls (2.1698, 10.2045) and (2.1784, 10.2395) .. (2.1784, 10.275) -- (2.1784, 12.1971).. controls (2.1784, 12.7003) and (2.5878, 13.1097) .. (3.091, 13.1097).. controls (3.4506, 13.1097) and (3.7709, 12.8994) .. (3.9183, 12.5824).. controls (3.6112, 12.4048) and (3.3195, 12.1982) .. (3.0478, 11.9637).. controls (2.9565, 11.8848) and (2.9464, 11.7468) .. (3.0253, 11.6555).. controls (3.0685, 11.6054) and (3.1294, 11.5798) .. (3.1907, 11.5798).. controls (3.2413, 11.5798) and (3.2922, 11.5973) .. (3.3334, 11.6329).. controls (4.2883, 12.4576) and (5.51, 12.9117) .. (6.7734, 12.9117).. controls (8.0367, 12.9117) and (9.2583, 12.4576) .. (10.2132, 11.633).. controls (10.3046, 11.5541) and (10.4426, 11.5642) .. (10.5214, 11.6555).. controls (10.6003, 11.7469) and (10.5902, 11.8848) .. (10.4988, 11.9637).. controls (10.2272, 12.1983) and (9.9355, 12.4048) .. (9.6284, 12.5824).. controls (9.7758, 12.8994) and (10.096, 13.1097) .. (10.4557, 13.1097).. controls (10.9588, 13.1097) and (11.3682, 12.7003) .. (11.3682, 12.1971) -- (11.3682, 10.275).. controls (11.3682, 10.2395) and (11.3769, 10.2045) .. (11.3935, 10.1731).. controls (12.8842, 7.3485) and (13.0999, 4.6682) .. (11.9852, 2.8195) -- cycle;
	\path[tkzchibihamster border color] (7.3061, 7.4572).. controls (7.1657, 7.4572) and (7.0467, 7.5496) .. (7.0065, 7.6768) -- (7.3672, 7.897).. controls (7.4702, 7.9599) and (7.5027, 8.0944) .. (7.4398, 8.1974).. controls (7.377, 8.3004) and (7.2425, 8.3329) .. (7.1395, 8.27) -- (6.7733, 8.0465) -- (6.4071, 8.27).. controls (6.304, 8.3329) and (6.1696, 8.3004) .. (6.1068, 8.1974).. controls (6.0439, 8.0944) and (6.0764, 7.9599) .. (6.1794, 7.897) -- (6.5402, 7.6768).. controls (6.4999, 7.5496) and (6.3808, 7.4572) .. (6.2406, 7.4572).. controls (6.1199, 7.4572) and (6.0221, 7.3593) .. (6.0221, 7.2387).. controls (6.0221, 7.118) and (6.1199, 7.0202) .. (6.2406, 7.0202).. controls (6.4486, 7.0202) and (6.6371, 7.1052) .. (6.7733, 7.2423).. controls (6.9094, 7.1052) and (7.098, 7.0202) .. (7.306, 7.0202).. controls (7.4267, 7.0202) and (7.5245, 7.118) .. (7.5245, 7.2387).. controls (7.5245, 7.3593) and (7.4267, 7.4572) .. (7.3061, 7.4572) -- cycle;
}

\defKV[tkzchibihamster]{%
	rescale=\def\tkzchibihamsterrescale{#1},%
	strut=\def\tkzchibihamsterstrut{#1},%
	dstrut=\def\tkzchibihamsterdstrut{#1},%
	ear color=\tikzset{tkzchibihamster ear color/.style={fill=#1}},%
	body color=\tikzset{tkzchibihamster body color/.style={fill=#1}},%
	border color=\tikzset{tkzchibihamster border color/.style={fill=#1}}
}

\setKVdefault[tkzchibihamster]{%
	rescale=1,%
	strut={M},%
	dstrut={(qM)},%
	bw=false,%
	ear color=tkzchibihamsterA,%
	body color=tkzchibihamsterB,%
	border color=tkzchibihamsterC
}

\NewDocumentCommand\tkzhamsterkawaii{ O{} D<>{} m }{%
	\restoreKV[tkzchibihamster]%
	\setKV[tkzchibihamster]{#1}%
	\intpictotestautodautolen{#3}%
		{%
			\settoheight\tkzchibihamsterheight{\hbox{\tkzchibihamsterstrut}}%
		}%
		{%
			\settototalheight\tkzchibihamsterheight{\hbox{\tkzchibihamsterdstrut}}%
			\settodepth\tkzchibihamsterdepth{\hbox{\tkzchibihamsterdstrut}}%
		}%
		{%
			\setlength\tkzchibihamsterheight{#3}%
		}%
	\xdef\tkzchibihamsterscale{\fpeval{\tkzchibihamsterheight/135.5mm}}%
	%bw
	\ifboolKV[tkzchibihamster]{bw}%
		{%
			\tikzset{tkzchibihamster ear color/.style={fill=lightgray!25}}%
			\tikzset{tkzchibihamster body color/.style={fill=gray!25}}%
			\tikzset{tkzchibihamster border color/.style={fill=darkgray}}%
		}%
		{}%
	%picture
	\intpictotestdautolen{#3}%
		{%
			\setlength\tkzchibihamsterdepth{\dimexpr-\tkzchibihamsterdepth+\fpeval{(1-\tkzchibihamsterrescale)/2}\tkzchibihamsterheight\relax}%
			\raisebox{\tkzchibihamsterdepth}{%
				\begin{tikzpicture}[scale=\fpeval{\tkzchibihamsterrescale*\tkzchibihamsterscale},#2,transform shape]
					\clip (0.41,0) rectangle (13.12,13.55) ;
					\intchibihamster
				\end{tikzpicture}%
			}%
		}%
		{%
			\begin{tikzpicture}[scale=\fpeval{\tkzchibihamsterrescale*\tkzchibihamsterscale},#2,transform shape]
			\clip (0.41,0) rectangle (13.12,13.55) ;
				\intchibihamster
			\end{tikzpicture}%
		}%
}

%====SPIDERCAB
\newlength\tkzspidercabheight
\newlength\tkzspidercabdepth

\defKV[tkzspidercab]{%
	levels=\def\tkzspidercablevel{#1},%
	rescale=\def\tkzspidercabrescale{#1},%
	strut=\def\tkzspidercabstrut{#1},%
	dstrut=\def\tkzspidercabdstrut{#1},%
	inner margin=\def\tkzspidercabstart{#1}
}
\setKVdefault[tkzspidercab]{%
	levels=5,%
	rescale=1,%
	strut={M},%
	dstrut={(qM)},%
	inner margin=0.85
}

\newcommand\inttkzspidercab{
	%cab
	\foreach \i in {0,...,10}{\draw (0,0)--({\i/12*360}:5);}
	\draw[line width=\fpeval{\tkzspidercabscale*0.5}mm] (0,0)--({11/12*360}:{5-\tkzspidercabstart});
	\foreach \i in {0,...,\inteval{12*\tkzspidercablevel}}{%
		\xdef\j{\inteval{1-\i}}%
		\draw ({\j/12*360}:{\tkzspidercabstart+\i*\tkzspidercaboffset}) to[bend left=-20] ({(\j-1)/12*360}:{\tkzspidercabstart+(\i+1)*\tkzspidercaboffset}) ;
	}
	\draw (0:{\tkzspidercabstart+(12*\tkzspidercablevel+1)*\tkzspidercaboffset})--++(0,{-0.55*5}) ;
	%spider
	\coordinate (SPIDER) at ({\tkzspidercabstart+(12*\tkzspidercablevel+1)*\tkzspidercaboffset},{-0.55*5}) ;
	\filldraw (SPIDER) circle[x radius=0.6cm,y radius=0.35cm] ;
	\begin{scope}[line width=\fpeval{\tkzspidercabscale*0.8}mm]
		\draw[line cap=round] ([xshift=0.1cm]SPIDER) to[bend left=45]++ (0.75cm,0.2cm) ;
		\draw[line cap=round] ([xshift=0.1cm,yshift=-0.025cm]SPIDER) to[bend left=30]++ (0.675cm,0.05cm) ;
		\draw[line cap=round] ([xshift=0.1cm,yshift=-0.1cm]SPIDER) to[bend left=60]++ (0.625cm,-0.2cm) ;
		\draw[line cap=round] ([xshift=-0.1cm]SPIDER) to[bend right=45]++ (-0.75cm,0.2cm) ;
		\draw[line cap=round] ([xshift=-0.1cm,yshift=-0.025cm]SPIDER) to[bend right=30]++ (-0.675cm,0.05cm) ;
		\draw[line cap=round] ([xshift=-0.1cm,yshift=-0.1cm]SPIDER) to[bend right=60]++ (-0.625cm,-0.2cm) ;
	\end{scope}
	\draw[fill=white] ([xshift=-0.2cm,yshift=0.4cm]SPIDER) circle[x radius=0.2cm,y radius=0.275cm] ;
	\draw[fill=white] ([xshift=0.2cm,yshift=0.4cm]SPIDER) circle[x radius=0.2cm,y radius=0.275cm] ;
	\filldraw ([xshift=-0.175cm,yshift=0.35cm]SPIDER) circle[radius=0.05cm] ;
	\filldraw ([xshift=0.175cm,yshift=0.35cm]SPIDER) circle[radius=0.05cm] ;
}

\NewDocumentCommand\tkzspidercabweb{ O{} D<>{} m }{%
	\restoreKV[tkzspidercab]%
	\setKV[tkzspidercab]{#1}%
	\intpictotestautodautolen{#3}%
		{%
			\settoheight\tkzspidercabheight{\hbox{\tkzspidercabstrut}}%
		}%
		{%
			\settototalheight\tkzspidercabheight{\hbox{\tkzspidercabdstrut}}%
			\settodepth\tkzspidercabdepth{\hbox{\tkzspidercabdstrut}}%
		}%
		{%
			\setlength\tkzspidercabheight{#3}%
		}%
	\xdef\tkzspidercabscale{\fpeval{\tkzspidercabheight/100.6mm}}%
	\def\tkzspidercaboffset{\fpeval{(5-2*\tkzspidercabstart)/(12*\tkzspidercablevel)}}%calcul automatique
	%picture
	\intpictotestdautolen{#3}%
		{%
			\setlength\tkzspidercabdepth{\dimexpr-\tkzspidercabdepth+\fpeval{(1-\tkzspidercabrescale)/2}\tkzspidercabheight\relax}%
			\raisebox{\tkzspidercabdepth}{%
				\begin{tikzpicture}[scale=\fpeval{\tkzspidercabrescale*\tkzspidercabscale},line width=\fpeval{\tkzspidercabrescale*\tkzspidercabscale*0.6}mm,#2,transform shape]
					\inttkzspidercab
				\end{tikzpicture}%
			}%
		}%
		{%
			\begin{tikzpicture}[scale=\fpeval{\tkzspidercabrescale*\tkzspidercabscale},line width=\fpeval{\tkzspidercabrescale*\tkzspidercabscale*0.6}mm,#2,transform shape]
				\inttkzspidercab
			\end{tikzpicture}%
		}%
}

%====DONUT
\newlength\tkzdonutheight
\newlength\tkzdonutdepth

\definecolor{tkzdonutpastry}{HTML}{dcc6aa}
\definecolor{tkzdonutjelly}{HTML}{e89dd5}

\defKV[tkzdonut]{%
	rescale=\def\tkzdonutrescale{#1},%
	strut=\def\tkzdonutstrut{#1},%
	dstrut=\def\tkzdonutdstrut{#1},%
	main color=\def\tkzdonutmaincolor{#1},%
	deco color=\def\tkzdonutdecocolor{#1}
}
\setKVdefault[tkzdonut]{%
	rescale=1,%
	strut={M},%
	dstrut={(qM)},%
	main color=tkzdonutpastry,%
	deco color=tkzdonutjelly,%
	decorations=true,%
	bw=false
}

\newcommand\inttkzdonutdeco[1]{%
	\begin{scope}[line width=\fpeval{\tkzdonutscale*0.0875}cm]
		\foreach \ptpos/\ptcolor in {#1} {%
			\draw[fill={\ptcolor}] \ptpos circle[radius=0.15cm] ;
		}
	\end{scope}
}

\newcommand\inttkzdonut{%
	\path (6.5cm,0) arc [start angle=0,end angle=180,x radius=6.5cm,y radius=4cm] node [pos=0.075] (YYY-1) {} node [pos=0.925] (YYY-2) {} ;
	\ifboolKV[tkzdonut]{bw}%
		{%
			\draw[fill=white] (0,0) circle[x radius=6.5cm,y radius=4cm] ;
			\draw[fill=lightgray!25] plot[smooth,tension=1] coordinates {(YYY-2)(-5.75,-0.75)(-4.75,-0.25)(-4.35,-1.75)(-3,-1.25)(-2,-3)(-0.25,-2.15)(1,-3.1)(2.25,-2)(3.25,-2.5)(4,-1.5)(5.15,-1.5)(5.5,-0.5)(6.125,-0.5)(YYY-1)} arc [start angle=13.5,end angle=166.5,x radius=6.5cm,y radius=4cm] ;
			\draw[line cap=round] (3,1.5) to[bend left=40] node [pos=0.2] (ZZZ-1) {} node [pos=0.8] (ZZZ-2) {}  (-3,1.5) ;
			\draw[fill=white] (ZZZ-1.center) to[bend right=35] (ZZZ-2.center) to[bend right=25] cycle ;
		}%
		{%
			\draw[fill={\tkzdonutmaincolor}] (0,0) circle[x radius=6.5cm,y radius=4cm] ;
			\draw[fill={\tkzdonutdecocolor}] plot[smooth,tension=1] coordinates {(YYY-2)(-5.75,-0.75)(-4.75,-0.25)(-4.35,-1.75)(-3,-1.25)(-2,-3)(-0.25,-2.15)(1,-3.1)(2.25,-2)(3.25,-2.5)(4,-1.5)(5.15,-1.5)(5.5,-0.5)(6.125,-0.5)(YYY-1)} arc [start angle=13.5,end angle=166.5,x radius=6.5cm,y radius=4cm] ;
			\draw[line cap=round] (3,1.5) to[bend left=40] node [pos=0.2] (ZZZ-1) {} node [pos=0.8] (ZZZ-2) {}  (-3,1.5) ;
			\draw[fill={\tkzdonutmaincolor}] (ZZZ-1.center) to[bend right=35] (ZZZ-2.center) to[bend right=25] cycle ;
		}%
	\ifboolKV[tkzdonut]{decorations}%
		{%
			%decorations
			\inttkzdonutdeco{(-5.75,0.75)/white,(-4.5,0.5)/white,(-4,2)/white,(-3.5,1.15)/white,(-2.5,0)/white,(-2.5,2.5)/white,(-1,-1.25)/white,(-0.1,-0.5)/white,(-1,3.25)/white,(-1.25,2.25)/white,(0,3.15)/white,(1,2.25)/white,(1.75,-1.5)/white,(2.5,2)/white,(3,0)/white,(3,3)/white,(4,-0.5)/white,(4,2.25)/white,(5,1)/white}
		}%
		{}%
}

\NewDocumentCommand\tkzdonut{ O{} D<>{} m }{%
	\restoreKV[tkzdonut]%
	\setKV[tkzdonut]{#1}%
	\intpictotestautodautolen{#3}%
		{%
			\settoheight\tkzdonutheight{\hbox{\tkzdonutstrut}}%
		}%
		{%
			\settototalheight\tkzdonutheight{\hbox{\tkzdonutdstrut}}%
			\settodepth\tkzdonutdepth{\hbox{\tkzdonutdstrut}}%
		}%
		{%
			\setlength\tkzdonutheight{#3}%
		}%
	\xdef\tkzdonutscale{\fpeval{\tkzdonutheight/82.5mm}}%
	%picture
	\intpictotestdautolen{#3}%
		{%
			\setlength\tkzdonutdepth{\dimexpr-\tkzdonutdepth+\fpeval{(1-\tkzdonutrescale)/2}\tkzdonutheight\relax}%
			\raisebox{\tkzdonutdepth}{%
				\begin{tikzpicture}[scale=\fpeval{\tkzdonutrescale*\tkzdonutscale},line width=\fpeval{\tkzdonutrescale*\tkzdonutscale*0.25}cm,transform shape]
					\inttkzdonut
				\end{tikzpicture}%
			}%
		}%
		{%
			\begin{tikzpicture}[scale=\fpeval{\tkzdonutrescale*\tkzdonutscale},line width=\fpeval{\tkzdonutrescale*\tkzdonutscale*0.25}cm,transform shape]
				\inttkzdonut
			\end{tikzpicture}%
		}%
}

%====POOLBALL
\usetikzlibrary{shadings}

\newlength\tkzpoolballheight
\newlength\tkzpoolballdepth

\defKV[tkzpoolball]{%
	font=\tikzset{poolball font/.style={font=#1}},%
	rescale=\def\tkzpoolballrescale{#1},%
	strut=\def\tkzpoolballstrut{#1},%
	dstrut=\def\tkzpoolballdstrut{#1},%
	color=\colorlet{tkzpoolballmaincolor}{#1},%
	number=\def\tkzpoolballnb{#1},%
	xscale=\def\tkzpoolballxscale{#1},%
	rotate=\def\tkzpoolballrotate{#1}
}
\setKVdefault[tkzpoolball]{%
	font=\sffamily,%
	rescale=1,%
	strut={M},%
	dstrut={(qM)},%
	color=red,%
	number={},%
	xscale=1,%
	rotate=0
}

\newcommand\inttkzpoolball[1]{%
	%clip pour la Rotation
	\useasboundingbox (0,0) circle[radius=1cm] ;
	\fill[upper left=tkzpoolballmaincolor!50,upper right=tkzpoolballmaincolor!80,lower left=tkzpoolballmaincolor!80,lower right=tkzpoolballmaincolor] (0,0) circle[radius=1cm] ;
	\begin{scope}[rotate=\tkzpoolballrotate]
		\clip (0,0) circle[radius=1cm] ;
		\fill[white!95!tkzpoolballmaincolor] (1.5cm,0) circle[radius=0.675cm] ;
		\fill[white!95!tkzpoolballmaincolor] (-1.5cm,0) circle[radius=0.675cm] ;
		\fill[white!95!tkzpoolballmaincolor] (0,1.5cm) circle[radius=0.675cm] ;
		\fill[white!95!tkzpoolballmaincolor] (0,-1.5cm) circle[radius=0.675cm] ;
		\fill[white] (0,0) circle[radius=0.5cm] ;
	\end{scope}
	\begin{scope}[rotate=\tkzpoolballrotate]
		\clip (0,0) circle[radius=0.5cm] ;
		\ifthenelse{\equal{\tkzpoolballnb}{}}%
			{}%
			{%
				\draw (0,0) node[inner sep=0pt,poolball font,xscale=\tkzpoolballxscale] {\resizebox*{!}{0.6cm}{\tkzpoolballnb}} ;
			}%
	\end{scope}
	\draw[tkzpoolballmaincolor!25!black,line width=\fpeval{\tkzpoolballscale*0.2}mm] (0,0) circle[radius=1cm] ;
}

\NewDocumentCommand\tkzpoolball{ O{} D<>{} m }{%
	\restoreKV[tkzpoolball]%
	\setKV[tkzpoolball]{#1}%
	\intpictotestautodautolen{#3}%
	{%
		\settoheight\tkzpoolballheight{\hbox{\tkzpoolballstrut}}%
	}%
	{%
		\settototalheight\tkzpoolballheight{\hbox{\tkzpoolballdstrut}}%
		\settodepth\tkzpoolballdepth{\hbox{\tkzpoolballdstrut}}%
	}%
	{%
		\setlength\tkzpoolballheight{#3}%
	}%
	\xdef\tkzpoolballscale{\fpeval{\tkzpoolballheight/20.2mm}}%
	%picture
	\intpictotestdautolen{#3}%
	{%
		\setlength\tkzpoolballdepth{\dimexpr-\tkzpoolballdepth+\fpeval{(1-\tkzpoolballrescale)/2}\tkzpoolballheight\relax}%
		\raisebox{\tkzpoolballdepth}{%
			\begin{tikzpicture}[scale=\fpeval{\tkzpoolballrescale*\tkzpoolballscale},transform shape]
				\inttkzpoolball{\tkzpoolballnb}
			\end{tikzpicture}%
		}%
	}%
	{%
		\begin{tikzpicture}[scale=\fpeval{\tkzpoolballrescale*\tkzpoolballscale},transform shape]
			\inttkzpoolball{\tkzpoolballnb}
		\end{tikzpicture}%
	}%
}

%====EXCALAMATION
\newlength\tmptkzexclaheight
\newlength\tmptkzexcladepth

\defKV[tkzexclamation]{%
	rescale=\def\tkzexclarescale{#1},%
	strut=\def\tkzexclastrut{#1},%
	dstrut=\def\tkzexcladstrut{#1}
}
\setKVdefault[tkzexclamation]{%
	rescale=1,%
	strut={M},%
	dstrut={(qM)}
}

\newcommand\inttkzexcla{
	\useasboundingbox (0.05,0) circle[radius=1] ;
	\fill[even odd rule] (0.05,0) circle[radius=1] (0.129,-0.651) circle[x radius=0.275,y radius=0.18] plot[smooth,line join=round] coordinates {(0,-0.4) (-0.274,0.196) (-0.347,0.658) (0.03,0.874) (0.2,0.8) (0.248,0.535) (0.224,0.264) (0.1,-0.385) (0,-0.4)};
}

\NewDocumentCommand\tkzexcla{ O{} D<>{} m }{%
	\restoreKV[tkzexclamation]%
	\setKV[tkzexclamation]{#1}%
	\intpictotestautodautolen{#3}%
	{%
		\settoheight\tmptkzexclaheight{\hbox{\tkzexclastrut}}%
	}%
	{%
		\settototalheight\tmptkzexclaheight{\hbox{\tkzexcladstrut}}%
		\settodepth\tmptkzexcladepth{\hbox{\tkzexcladstrut}}%
	}%
	{%
		\setlength\tmptkzexclaheight{#3}%
	}%
	\intpictotestdautolen{#3}%
		{%
			\setlength\tmptkzexcladepth{\dimexpr-\tmptkzexcladepth+\fpeval{(1-\tkzexclarescale)/2}\tmptkzexclaheight\relax}%
			\raisebox{\tmptkzexcladepth}{%
				\begin{tikzpicture}[x=\fpeval{\tkzexclarescale*0.5}\tmptkzexclaheight,y=\fpeval{\tkzexclarescale*0.5}\tmptkzexclaheight,#2]
					\inttkzexcla
				\end{tikzpicture}%
			}%
		}%
		{%
			\begin{tikzpicture}[x=0.5\tmptkzexclaheight,y=0.5\tmptkzexclaheight,#2]
				\inttkzexcla
			\end{tikzpicture}%
		}%
}

\endinput