/******************************************************************************************
	RACE
******************************************************************************************/
.race-content {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	margin: 0 auto;
	--padding: min(1vw, 1vh);
	gap: var(--padding);
	padding: 0 var(--padding) 0 calc(var(--padding)*2);
	/* narrower when updates sticky note displayed */
	@media screen and (width >= 1000px) and (height >= 700px) { max-width: 85%; }
	@media screen and (width < 1000px) or (height < 700px)) { max-width: 85%; }
	
	img { pointer-events: none; user-select: none; }
}

#race-tracks {
	user-select: none;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	align-items: flex-start;
	position: relative;
	moz-box-sizing: border-box; webkit-box-sizing: border-box; box-sizing: border-box;
	margin-bottom: var(--padding);
	padding: 0 2%;
	aspect-ratio: 3/2;
	
	@media screen and (width >= 933px) {
		width: 55%;
		min-width: 600px;
		max-width: min(700px, 90vw);
	}
	@media screen and (width < 933px) {
		width: min(90vw, 600px);
		max-height: 75vh;
	}
}
#race-tracks:before {
	content: '';
	position: absolute;
	z-index: -1;
	width: 100%;
	height: 100%;
	left: -.5%;
	border-radius: 2rem;
	background: var(--white);
	opacity: .8;
}

.race-row {
	position: relative;
	text-align: left;
	height: 17%;
	width: 100%;
	&:not(:last-of-type) { margin-bottom: -7%; }
}
.race-row .dots {
	display: inline-block;
	--size: min(8px,max(2px,1.5vw));
	height: calc(50% - (var(--size) / 2));
	border-top: var(--size) var(--d-blue) dotted;
	animation-name: race;
	animation-duration: var(--time);
  animation-fill-mode: forwards;
	animation-timing-function: linear;
}
@keyframes race {
	from { width: 0%; }
	to { width: var(--percent); }
}
.race-row .wrapper img {
	width: 100%;
	position: absolute;
	top: 50%; transform: translateY(-50%);
}
.race-row .wrapper {
	display: inline-block;
	position: relative;
	height: 100%;
	width: 25%;
	margin-left: -.5em;
	animation-name: bounce;
	animation-duration: var(--bounce);
  animation-iteration-count: infinite;
}
@keyframes bounce {
	0% { top: -2% }
	50% { top: 2% }
	100% { top: -2% }
}
.race-row.winner .wrapper:after {
	content: '';
	position: absolute;
	opacity: 0;
	width: 100%;
	height: 100%;
	background-image: url('../images/racer_crown.png');
	background-size: 100%;
	background-position: center;
	background-repeat: no-repeat;
	animation-name: crown;
	animation-duration: var(--time);
  animation-fill-mode: forwards;
	animation-name: crown;
	animation-duration: var(--time);
  animation-fill-mode: forwards;
	animation-delay: .3s;
}
@keyframes crown {
	0% { opacity: 0; }
	95% { opacity: 0; }
	100% { opacity: 1; }
}

/******************************************************************************************
	WINNER TEXT
******************************************************************************************/

#win-text {
	position: relative;
	width: 100%;
	text-align: center;
	padding: .5em 1em;
	moz-box-sizing: border-box; webkit-box-sizing: border-box; box-sizing: border-box;
	margin-top: .7em;
	
	color: var(--dd-blue);
	text-transform: uppercase;
	
	background-color: var(--white);
	border-bottom: max(3px, calc(var(--menu-border)*.75)) var(--blue) solid;
	
	.name {
		font-family: "Super Comic", sans-serif;
		letter-spacing: .05em;
		color: var(--white);
		text-shadow: 2px 3px var(--dd-blue);
		background: var(--color);
		border: .1em var(--color-light) solid;
		padding: .2em .5em;
		border-radius: 1em;
	}
	span:not(.name) { font-weight: bold; }
}

/******************************************************************************************
	RECENT FEEDINGS
******************************************************************************************/

#feed-log {
	width: 100%;
	flex-shrink: 0;
	height: fit-content;
	
	margin: 1rem auto;
	width: min(90%, 30rem);
	
	.details {
		padding: .25em 0 1em 0;
	}
	
	.feed-log-item { padding: .2em 1em .2em 1em; }
	.feed-log-item:nth-child(even) { background: rgb(var(--blue-rgb),0.15); }
	
	.user.registered {
		font-weight: bold;
		color: var(--d-blue);
	}
	
	.worm {
		color: var(--white);
		border-radius: .5em;
		font-size: 1rem;
		font-family: "Super Comic", sans-serif;
	}
}

/******************************************************************************************
	WORM STATS
******************************************************************************************/

/* container div for worm stats */
#worm-stats {
	flex: 1; flex-shrink: 0;
	text-align: center;
	display: flex; flex-flow: row wrap;
	justify-content: center; align-items: center;
	padding: 0 var(--padding);
	moz-box-sizing: border-box; webkit-box-sizing: border-box; box-sizing: border-box;
	gap: var(--padding);
	min-width: min(90%,max(40%, 400px));
	max-width: 90%;
}
/* worm stat block */
.worm-stats {
	padding: var(--padding);
	margin-bottom: var(--padding);
	/* put the border/padding inside instead of outside */
	-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
	border-radius: 1em;
	border: max(2px, calc(var(--menu-border)*.75)) var(--white) solid;
	color: var(--white);
	text-align: center;
	font-size: max(.8rem, min(min(1rem, 3vw), 3vh));
	width: max(48%, 9rem);
	max-height: max(20vh, 12rem);
	flex-shrink: 1; flex-grow: 1;
	webkit-box-sizing: border-box; box-sizing: border-box;
	/* background lines */
	background:
		repeating-linear-gradient(
			45deg,
			rgba(255, 255, 255, 0.08),
			rgba(255, 255, 255, 0.08) min(8px,.8vw),
			transparent min(8px,.8vw),
			transparent min(16px,1.6vw)
		);
	background-color: var(--bg);
	background-blend-mode: screen;
}
.worm-stats .title {
	text-align: center; text-transform: uppercase;
	letter-spacing: .05em;
	font-family: "Super Comic", sans-serif;
	text-shadow: 2px 3px var(--dd-blue);
	a, a:link, a:visited, a:hover { color: inherit; }
}
.worm-stats .progress {
	font-size: 1.25em;
	margin-top: 0.25em;
}
.worm-stats .progress img {
	margin: 0 0 -.1em .15em;
	height: 1em;
}
.wrapper:has(> .item-stat) {
	display: flex; flex-wrap: wrap;
	justify-content: center;
}
.worm-stats .item-stat {
	max-width: max(2em, min(25%, 8vh));
	aspect-ratio: 1;
	font-size: 1.15em;
	padding: .2em; padding-bottom: 0;
	/* put the border/padding inside instead of outside */
	-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
.worm-stats .item-stat img {
	width: auto; max-width: 100%;
}