* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 2rem;
}

body {
	margin: 0;
	min-height: 100vh;
	background: #000;
	color: #f8f6f2;
	font-family: Arial, Helvetica, sans-serif;
}

.site-loader {
	position: fixed;
	z-index: 10000;
	inset: 0;
	display: grid;
	place-items: center;
	background: #000;
	opacity: 1;
	visibility: visible;
	transition: opacity 350ms ease, visibility 0s linear 350ms;
}

.site-loader.is-hidden {
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
}

.site-loader img {
	display: block;
	width: clamp(3.5rem, 10vw, 6rem);
	height: auto;
	filter: grayscale(1);
	animation: loader-spin 8s linear infinite;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	clip-path: inset(50%);
}

@keyframes loader-spin {
	to {
		transform: rotate(360deg);
	}
}

.sidebar {
	position: fixed;
	z-index: 2;
	inset: 12px auto 12px 12px;
	display: flex;
	width: 76px;
	flex-direction: column;
	overflow: hidden;
	padding: 1.25rem 0.65rem;
	border: 1px solid #292929;
	border-radius: 1.25rem;
	background: #151515;
	transition: width 220ms ease, padding 220ms ease;
}

.brand {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
	border-radius: 0.8rem;
	text-decoration: none;
}

.brand img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: inherit;
}

.eyebrow {
	margin: 0;
	color: #a8a8a7;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.08em;
}

.sidebar-nav {
	display: grid;
	gap: 0.65rem;
	margin-block: auto;
	width: 100%;
}

.nav-link {
	display: flex;
	min-height: 3.75rem;
	align-items: center;
	justify-content: center;
	gap: 0;
	padding: 0.75rem 0;
	border: 1px solid transparent;
	border-radius: 0.85rem;
	background: #242120;
	color: #a8a8a7;
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.ranking-link {
	display: flex;
	min-height: 3.75rem;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 0;
	margin-top: 0.85rem;
	padding: 0.75rem 0;
	border: 2px solid #ffee02;
	border-radius: 0.85rem;
	background: #ffee02;
	color: #171514;
	font-size: 0.9rem;
	font-weight: 800;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.ranking-link span {
	position: absolute;
	overflow: hidden;
	width: 0;
	opacity: 0;
	visibility: hidden;
	white-space: nowrap;
	transition: opacity 160ms ease, width 160ms ease;
}

.ranking-link svg {
	width: 1.4rem;
	height: 1.4rem;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.menu-bars {
	display: grid;
	flex: 0 0 auto;
	place-items: center;
	margin-top: 0.65rem;
	color: #a8a8a7;
	font-size: 0;
}

.menu-bars svg {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-width: 2;
}

.ranking-link:hover,
.ranking-link:focus-visible {
	transform: translateY(-2px);
	background: #f8f6f2;
	color: #171514;
}

.nav-link span {
	position: absolute;
	overflow: hidden;
	width: 0;
	opacity: 0;
	visibility: hidden;
	white-space: nowrap;
	transition: opacity 160ms ease, width 160ms ease;
}

.nav-link svg {
	width: 1.35rem;
	height: 1.35rem;
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.8;
}

.nav-link:hover,
.nav-link:focus-visible {
	transform: translateX(3px);
	background: #f8f6f2;
	color: #171514;
}

.nav-link:focus-visible,
.ranking-link:focus-visible,
.brand:focus-visible {
	outline: 3px solid #ff7829;
	outline-offset: 3px;
}

.page-content {
	position: relative;
	z-index: 1;
	--sidebar-offset: 100px;
	margin-left: var(--sidebar-offset);
	transition: margin-left 220ms ease;
}

.page-section {
	display: flex;
	min-height: 100vh;
	min-height: 100svh;
	flex-direction: column;
	justify-content: center;
	padding: clamp(2rem, 8vw, 7rem);
	scroll-margin-top: 1rem;
}

.hero {
	position: relative;
	width: calc(100% + var(--sidebar-offset));
	margin-left: calc(0px - var(--sidebar-offset));
	align-items: center;
	text-align: center;
}

.page-section h1,
.page-section h2 {
	max-width: 9ch;
	margin: 0.8rem 0 1rem;
	font-size: clamp(3.5rem, 10vw, 8rem);
	font-weight: 900;
	letter-spacing: -0.085em;
	line-height: 0.88;
}

.hero h1 {
	max-width: none;
	font-family: "Rubik Spray Paint", cursive;
	font-size: clamp(3.5rem, 10vw, 8rem);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.05;
}

.title-projet,
.title-overall {
	display: block;
	background-clip: text;
	-webkit-background-clip: text;
	color: transparent;
}

.title-projet {
	background-image: linear-gradient(110deg, #39ff14, #a6ff00);
	animation: title-appear 900ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.title-overall {
	background-image: linear-gradient(110deg, #fff200, #ffb800);
	animation: title-appear 900ms cubic-bezier(0.2, 0.75, 0.25, 1) 180ms both;
}

@keyframes title-appear {
	from {
		opacity: 0;
		transform: translateY(0.3em) scale(0.96);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.page-section h2 {
	max-width: 12ch;
	font-size: clamp(3rem, 8vw, 6.5rem);
}

.section-copy {
	max-width: 34rem;
	margin: 0;
	color: #b5b0ac;
	font-size: clamp(1rem, 2vw, 1.25rem);
	line-height: 1.65;
}

.background-decoration {
	position: fixed;
	z-index: 0;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.background-decoration img {
	position: absolute;
	max-width: min(35vw, 320px);
	max-height: 40vh;
	object-fit: contain;
	opacity: 0.8;
	mix-blend-mode: screen;
	user-select: none;
	-webkit-user-drag: none;
}

.background-decoration img:first-child {
	top: 2rem;
	left: 5rem;
	opacity: 1;
	transform: rotate(10deg) scale(2);
}

.background-decoration img:last-child {
	right: 1rem;
	bottom: 0rem;
	width: min(35vw, 320px);
	transform: rotate(15deg) scale(2);
}

.ranking-section {
	display: flex;
	min-height: 100vh;
	min-height: 100svh;
	flex-direction: column;
	justify-content: flex-start;
	gap: 1.5rem;
	padding: clamp(1.5rem, 4vw, 4rem) clamp(1rem, 3vw, 3rem);
}

.ranking-header {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
}

.ranking-header h1 {
	max-width: none;
	margin: 0.5rem 0 0;
	font-size: clamp(2.25rem, 5vw, 4rem);
	letter-spacing: -0.06em;
	line-height: 1;
}

.ranking-note {
	margin: 0 0 0.3rem;
	color: #a8a8a7;
	font-size: 0.85rem;
	text-align: right;
}

.ranking-table-wrapper {
	max-height: calc(100svh - 12rem);
	overflow: auto;
	border: 1px solid #444;
	border-radius: 0.8rem;
	background: #282828;
	scrollbar-color: #777 #292929;
}

.ranking-table {
	width: 100%;
	min-width: 660px;
	border-collapse: collapse;
	color: #f2f2f2;
	font-size: 0.9rem;
	text-align: center;
}

.ranking-table th {
	position: sticky;
	z-index: 1;
	top: 0;
	padding: 0.9rem 1rem;
	background: #414141;
	color: #b9b9b9;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ranking-table td {
	height: 3.1rem;
	padding: 0.45rem 1rem;
	border-top: 1px solid rgb(255 255 255 / 5%);
}

.ranking-table tbody tr:nth-child(odd) {
	background: #333;
}

.ranking-table tbody tr:nth-child(even) {
	background: #2a2a2a;
}

.ranking-table tbody tr:hover {
	background: #3b3b3b;
}

.ranking-table .rank-column {
	width: 3.75rem;
}

.ranking-table .player-column {
	width: 36%;
	text-align: left;
}

.ranking-table .rank-cell {
	border-left: 3px solid #ff3748;
	font-weight: 800;
}

.ranking-table tbody tr:nth-child(n + 6):nth-child(-n + 12) .rank-cell {
	border-left-color: #ffbe00;
}

.ranking-table tbody tr:nth-child(n + 13):nth-child(-n + 18) .rank-cell {
	border-left-color: #00d47b;
}

.ranking-table tbody tr:nth-child(n + 19) .rank-cell {
	border-left-color: #18b9ff;
}

.ranking-table .player-cell {
	font-weight: 700;
	text-align: left;
}

.player-cell-content {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
}

.player-head,
.player-head-fallback {
	width: 2rem;
	height: 2rem;
	flex: 0 0 2rem;
	border-radius: 0.3rem;
	background: #4a4a4a;
	image-rendering: pixelated;
	object-fit: cover;
}

.player-head-fallback {
	display: grid;
	place-items: center;
	color: #ddd;
	font-size: 0.8rem;
}

.points-value {
	display: inline-block;
	min-width: 3.5rem;
	padding: 0.2rem 0.6rem;
	border: 1px solid #555;
	border-radius: 999px;
	background: #242424;
	font-weight: 700;
}

@media (min-width: 641px) {
	.sidebar:hover,
	.sidebar:focus-within {
		width: 190px;
		padding-inline: 1.25rem;
	}

	.sidebar:hover .nav-link,
	.sidebar:focus-within .nav-link {
		justify-content: flex-start;
		gap: 0.8rem;
		padding-inline: 0.75rem;
	}

	.sidebar:hover .nav-link span,
	.sidebar:focus-within .nav-link span,
	.sidebar:hover .ranking-link span,
	.sidebar:focus-within .ranking-link span {
		position: static;
		width: auto;
		opacity: 1;
		visibility: visible;
	}

	.sidebar:hover .ranking-link,
	.sidebar:focus-within .ranking-link {
		justify-content: flex-start;
		gap: 0.5rem;
		padding-inline: 0.5rem;
	}

	.sidebar:hover + .page-content,
	.sidebar:focus-within + .page-content {
		--sidebar-offset: 214px;
		margin-left: 214px;
	}
}

@media (max-width: 640px) {
	.sidebar {
		inset: 8px 8px auto;
		width: auto;
		max-height: none;
		display: grid;
		grid-template-columns: 2.25rem minmax(0, 1fr);
		gap: 0.35rem 0.5rem;
		padding: 0.5rem;
		border-radius: 1rem;
	}

	.brand {
		align-self: center;
		width: 2.25rem;
		height: 2.25rem;
		grid-column: 1;
		grid-row: 1;
		flex: 0 0 2.25rem;
	}

	.nav-link span,
	.ranking-link span {
		position: static;
		width: auto;
		overflow: visible;
		opacity: 1;
		visibility: visible;
		transition: none;
	}

	.brand img {
		width: 100%;
		height: 100%;
		object-fit: contain;
	}

	.sidebar-nav {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-column: 2;
		grid-row: 1;
		gap: 0.25rem;
		margin: 0;
	}

	.nav-link {
		min-height: 2.75rem;
		flex-direction: column;
		justify-content: center;
		gap: 0.15rem;
		padding: 0.25rem 0.05rem;
		font-size: clamp(0.48rem, 2.3vw, 0.65rem);
	}

	.ranking-link {
		grid-column: 1 / -1;
		grid-row: 2;
		min-height: 2.25rem;
		align-self: center;
		justify-content: center;
		gap: 0.4rem;
		margin-top: 0;
		padding: 0.25rem 0.75rem;
		font-size: 0.75rem;
	}

	.nav-link span {
		white-space: nowrap;
	}

	.ranking-link span {
		white-space: nowrap;
	}

	.nav-link svg {
		width: 1rem;
		height: 1rem;
	}

	.menu-bars {
		grid-column: 1 / -1;
		grid-row: 3;
		margin-top: -0.15rem;
	}

	.page-content {
		--sidebar-offset: 0px;
		margin: 0;
		padding-top: 7.5rem;
	}

	.page-section {
		min-height: calc(100svh - 7.5rem);
		padding: 2rem clamp(1.25rem, 6vw, 2rem);
	}

	.ranking-section {
		min-height: calc(100svh - 7.5rem);
		justify-content: flex-start;
		gap: 0.75rem;
		padding: 1rem 0.75rem 2rem;
	}

	.ranking-header {
		align-items: flex-start;
		flex-direction: column;
		gap: 0.75rem;
	}

	.ranking-note {
		text-align: left;
	}

	.ranking-table-wrapper {
		max-height: calc(100svh - 10rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.site-loader img {
		animation: none;
	}

	.site-loader {
		transition: none;
	}

	.title-projet,
	.title-overall {
		animation: none;
	}

	.nav-link {
		transition: none;
	}

	.ranking-link {
		transition: none;
	}

	.sidebar,
	.page-content {
		transition: none;
	}

	.nav-link span,
	.ranking-link span {
		transition: none;
	}
}
