.pctf-leaderboard,
.pctf-public-result {
	--pctf-red: #e3232e;
	--pctf-bg: #080c16;
	--pctf-surface: #111827;
	--pctf-border: #344057;
	--pctf-text: #f4f6fb;
	--pctf-muted: #aeb8cb;
	--pctf-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

	box-sizing: border-box;
	width: calc(100% - 24px);
	max-width: 864px;
	margin: 24px auto;
	padding: clamp(18px, 4vw, 32px);
	overflow: hidden;
	border: 1px solid var(--pctf-border);
	border-top: 5px solid var(--pctf-red);
	border-radius: 8px;
	background: var(--pctf-bg);
	color: var(--pctf-text);
	box-shadow: 0 16px 48px rgb(0 0 0 / 28%);
	font-family: var(--pctf-mono);
}

.pctf-leaderboard {
	max-width: 1180px;
}

.pctf-leaderboard *,
.pctf-public-result * {
	box-sizing: border-box;
	min-width: 0;
}

.pctf-leaderboard__header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	margin-bottom: 20px;
}

.pctf-leaderboard h2,
.pctf-public-result h1,
.pctf-public-result h2 {
	margin: 0;
	color: var(--pctf-text);
	overflow-wrap: break-word;
}

.pctf-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--pctf-red);
	border-radius: 4px;
	background: var(--pctf-red);
	color: #fff !important;
	font: 700 15px/1.2 var(--pctf-mono);
	cursor: pointer;
	text-align: center;
	text-decoration: none;
}

.pctf-button:hover {
	border-color: #b91822;
	background: #b91822;
	color: #fff;
}

.pctf-button:focus-visible,
.pctf-leaderboard a:focus-visible,
.pctf-public-result a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

.pctf-leaderboard__actions,
.pctf-navigation {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.pctf-navigation--bottom,
.pctf-public-result__navigation {
	margin-top: 24px;
}

.pctf-leaderboard__message {
	margin-bottom: 18px;
	color: var(--pctf-muted);
	font-size: 14px;
}

.pctf-leaderboard__podium {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	align-items: stretch;
	margin-bottom: 24px;
}

.pctf-leaderboard__podium-card {
	display: grid;
	align-content: start;
	gap: 7px;
	width: 100%;
	min-height: 230px;
	padding: 18px;
	border: 1px solid var(--pctf-border);
	border-left: 4px solid var(--pctf-red);
	background: var(--pctf-surface);
}

.pctf-leaderboard__podium-card:nth-child(1) {
	grid-column: 1 / -1;
	justify-self: center;
	width: calc(50% - 7px);
}

.pctf-leaderboard__rank,
.pctf-leaderboard__status,
.pctf-public-result__status {
	color: var(--pctf-red);
	font-weight: 800;
}

.pctf-leaderboard__podium-card .pctf-leaderboard__nick {
	margin: 0;
	color: #fff;
	font-size: clamp(21px, 2.5vw, 25px);
	font-weight: 800;
	line-height: 1.25;
	overflow-wrap: anywhere;
	word-break: normal;
}

.pctf-leaderboard__score {
	font-size: 18px;
}

.pctf-leaderboard__flags,
.pctf-leaderboard__time,
.pctf-leaderboard__hints,
.pctf-leaderboard__status {
	font-size: 13px;
}

.pctf-leaderboard__table {
	display: grid;
	width: 100%;
	max-width: 100%;
	gap: 6px;
	overflow: hidden;
}

.pctf-leaderboard__row {
	display: grid;
	width: 100%;
	max-width: 100%;
	grid-template-columns:
		minmax(72px, 0.65fr)
		minmax(150px, 1.8fr)
		minmax(70px, 0.75fr)
		minmax(90px, 0.9fr)
		minmax(95px, 1fr)
		minmax(110px, 1fr)
		minmax(155px, 1.5fr);
	gap: 12px;
	align-items: center;
	padding: 13px 14px;
	border: 1px solid var(--pctf-border);
	background: var(--pctf-surface);
	font-size: 14px;
}

.pctf-leaderboard__row > span {
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: normal;
}

.pctf-leaderboard__row > span:last-child {
	font-size: 13px;
	line-height: 1.35;
}

.pctf-leaderboard__row > span:nth-child(3),
.pctf-leaderboard__row > span:nth-child(4),
.pctf-leaderboard__row > span:nth-child(5),
.pctf-leaderboard__row > span:nth-child(6),
.pctf-leaderboard__row > span:nth-child(7) {
	white-space: nowrap;
	overflow-wrap: normal;
}

.pctf-leaderboard__row--header {
	background: transparent;
	color: var(--pctf-muted);
	font-weight: 700;
}

.programista-ctf-result-page {
	margin: 0;
	padding: 1px 0;
	background: #050811;
}

.pctf-public-result {
	margin-top: clamp(24px, 8vh, 80px);
}

.pctf-public-result__status {
	margin: 0 0 8px;
}

.pctf-public-result__stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 24px 0;
}

.pctf-public-result__stats p {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 16px;
	border: 1px solid var(--pctf-border);
	background: var(--pctf-surface);
}

.pctf-public-result__stats span {
	color: var(--pctf-muted);
	font-size: 13px;
}

.pctf-public-result__stats strong {
	font-size: 18px;
}

.pctf-public-result__levels {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 0;
	list-style: none;
}

.pctf-public-result__levels li {
	display: flex;
	gap: 12px;
	padding: 9px 12px;
	border: 1px solid var(--pctf-border);
	background: var(--pctf-surface);
}

.pctf-public-result__date {
	margin-top: 24px;
}

@media (max-width: 700px) {
	.pctf-leaderboard__podium,
	.pctf-public-result__stats {
		grid-template-columns: 1fr;
	}

	.pctf-leaderboard__podium-card:nth-child(1) {
		grid-column: 1;
		width: 100%;
	}

	.pctf-leaderboard__row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px 16px;
		padding: 16px;
	}

	.pctf-leaderboard__row--header {
		display: none;
	}

	.pctf-leaderboard__row span {
		display: grid;
		gap: 3px;
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: normal;
	}

	.pctf-leaderboard__row span::before {
		content: attr(data-label);
		color: var(--pctf-muted);
		font-size: 12px;
	}
}

@media (max-width: 600px) {
	.pctf-leaderboard__actions,
	.pctf-navigation,
	.pctf-button {
		width: 100%;
	}
}

@media (max-width: 420px) {
	.pctf-leaderboard__row {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pctf-leaderboard *,
	.pctf-public-result * {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}
