/* The thumbnail frame, alive (thumbs.js). Every tile turns slowly to and fro on its own vertical
   center line, at its own pace; the tiles sit a little off the line, off the size and off the
   upright; now and then one turns over to show another game. */
/* 0 = swaying and untidy, 1 = facing the viewer, flat and upright: what pointing at a tile does */
@property --face {
	syntax: "<number>";
	inherits: true;
	initial-value: 0;
}
@property --ang {
	syntax: "<angle>";
	inherits: true;
	initial-value: 0deg;
}
@keyframes tile-turn {
	from { --ang: var(--a0, -20deg); }
	to   { --ang: var(--a1, 20deg); }
}

.thumb-col .tile {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: 100%;
	aspect-ratio: 1;
	/* turn on the tile's OWN center line first (so it never comes nearer: no "breathing"), then
	   size it, tilt it and set it off the line */
	transform: translateX(var(--dx, 0)) rotate(calc(var(--rz, 0deg) * (1 - var(--face)))) scale(var(--s, 1)) perspective(420px) rotate3d(var(--ax, 0), var(--ay, 1), 0, calc(var(--ang) * (1 - var(--face))));
	animation: tile-turn var(--dur, 9s) ease-in-out var(--delay, 0s) infinite alternate;
	z-index: 0;
	transition: --face .3s ease;
}
.thumb-col .sway { display: block; width: 100%; height: 100%; }
.thumb-col .face {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 7px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.14);
	transition: transform .25s ease;
}
.thumb-col .face img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	flex: none !important;
	border-radius: 0;
}
.thumb-col .nm {
	position: absolute;
	left: 50%;
	bottom: 6%;
	transform: translateX(-50%);
	padding: 1px 7px;
	border-radius: 9px;
	background: rgba(0,0,0,.72);
	color: #fff;
	font-size: 11px;
	line-height: 1.5;
	white-space: nowrap;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}
@media (hover: hover) {
	.thumb-col .tile:hover { z-index: 2; animation-play-state: paused; --face: 1; }
	.thumb-col .tile:hover .face { transform: scale(1.12); }
	.thumb-col .tile:hover .nm { opacity: 1; }
}
@media (min-width: 880px) {
	.thumb-left, .thumb-right { overflow: visible; }
	.thumb-left .tile, .thumb-right .tile {
		flex: 0 0 var(--thumb-size);
		width: var(--thumb-size);
		height: var(--thumb-size);
		aspect-ratio: unset;
	}
}
/* the phone strip is narrow and scrolls (it clips): no sideways offset, half the lean, less turn */
@media (max-width: 879px) {
	.thumb-right { padding: 0 4px; box-sizing: border-box; width: 64px; right: 0; }
	.thumb-col .tile { transform: rotate(calc(var(--rz, 0deg) * .5 * (1 - var(--face)))) scale(calc(.94 + (var(--s, 1) - .94) * .5)) perspective(420px) rotate3d(var(--ax, 0), var(--ay, 1), 0, calc(var(--ang) * (1 - var(--face)))); }
}

/* the nomizo page's game tiles and katalaveno's phones turn the same way */
.phone img { transform: perspective(900px) rotate3d(var(--ax, 0), var(--ay, 1), 0, calc(var(--ang) * (1 - var(--face)))); animation: tile-turn var(--dur, 9s) ease-in-out var(--delay, 0s) infinite alternate; }
.shelf img {
	transform: translate(var(--dx, 0), var(--dy, 0)) rotate(calc(var(--rz, 0deg) * (1 - var(--face)))) scale(calc(var(--s, 1) * (1 + 0.1 * var(--face)))) perspective(420px) rotate3d(var(--ax, 0), var(--ay, 1), 0, calc(var(--ang) * (1 - var(--face))));
	animation: tile-turn var(--dur, 9s) ease-in-out var(--delay, 0s) infinite alternate;
	transition: box-shadow .18s ease, --face .3s ease !important;
}
/* pointing at a game tile: it turns to face you, flat and upright, and grows a little, as in the main page's frame */
.shelf a:hover img { animation-play-state: paused; --face: 1; }
