/* ══ Rise mark ══════════════════════════════════════════════════ */
.rise-logo {
	display: block;
	height: 100%;
	width: auto;
	color: var(--accent);
}

/* ══ Signup gate ════════════════════════════════════════════════ */
body.is-gated {
	overflow: hidden;
}

body.is-gated > *:not(.gate) {
	filter: blur(6px) saturate(0.6);
	pointer-events: none;
	user-select: none;
}

.gate {
	--gate-cut: #0b0d0c;
	position: fixed;
	inset: 0;
	z-index: 200;
	display: grid;
	grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
	background: var(--bg);
	opacity: 0;
	transition: opacity 0.4s var(--ease);
}

.gate.is-open {
	opacity: 1;
}

.gate.is-done {
	opacity: 0;
	transition: opacity 0.4s var(--ease);
}

/* Left rail: flat panel, one hairline. No glow, no drifting grid. */
.gate__aside {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 2rem;
	padding: clamp(2rem, 4vw, 3.4rem);
	border-right: 1px solid var(--line);
	background: var(--bg-2);
	overflow: hidden;
}

.gate__aside::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--accent);
}

.gate__mark {
	height: 34px;
}

.gate__pitch h2 {
	margin: 0 0 0.9rem;
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	font-weight: 760;
	line-height: 1.1;
	letter-spacing: -0.035em;
}

.gate__pitch p {
	margin: 0;
	max-width: 34ch;
	font-size: 0.88rem;
	line-height: 1.6;
	color: var(--text-dim);
}

.gate__facts {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin: 0;
	border-top: 1px solid var(--line);
}

.gate__fact {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: 0.7rem 0;
	border-bottom: 1px solid var(--line);
}

.gate__fact dt {
	font-size: 0.7rem;
	font-weight: 680;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-mute);
}

.gate__fact dd {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 620;
	color: var(--text);
}

.gate__main {
	display: grid;
	place-items: center;
	padding: clamp(1.5rem, 4vw, 3rem);
	overflow: auto;
}

.gate__panel {
	width: min(380px, 100%);
}

.gate__track {
	display: flex;
	gap: 1.4rem;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

.gate__tick {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.72rem;
	font-weight: 680;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--text-mute);
	transition: color 0.3s var(--ease);
}

.gate__tick span {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	border: 1px solid var(--line-2);
	border-radius: 7px;
	font-size: 0.66rem;
	letter-spacing: 0;
	transition:
		background 0.3s var(--ease),
		border-color 0.3s var(--ease),
		color 0.3s var(--ease);
}

.gate__tick.on {
	color: var(--text);
}

.gate__tick.on span {
	border-color: transparent;
	background: var(--accent);
	color: var(--accent-ink);
}

.gate__tick.done span {
	border-color: rgb(var(--accent-rgb) / 0.45);
	color: var(--accent);
}

.gate__panel.shake {
	animation: gate-shake 0.4s var(--ease);
}

@keyframes gate-shake {
	0%,
	100% {
		transform: translateX(0);
	}
	20% {
		transform: translateX(-7px);
	}
	40% {
		transform: translateX(6px);
	}
	60% {
		transform: translateX(-4px);
	}
	80% {
		transform: translateX(3px);
	}
}

.gate__logo {
	height: 100%;
}

.gate__title {
	margin: 0 0 0.3rem;
	font-size: 1.35rem;
	font-weight: 760;
	letter-spacing: -0.03em;
}

.gate__sub {
	margin: 0 0 1.6rem;
	font-size: 0.83rem;
	line-height: 1.55;
	color: var(--text-mute);
}

.gate__form {
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.gate__input {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: 0.02em;
}

.gate__error {
	margin: 0.1rem 0 0;
	font-size: 0.76rem;
	color: #ff9d86;
}

.gate__go {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 46px;
	margin-top: 0.7rem;
	border: none;
	border-radius: var(--r);
	background: var(--accent);
	color: var(--accent-ink);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 720;
	cursor: pointer;
	transition:
		transform 0.3s var(--spring),
		filter 0.2s var(--ease),
		opacity 0.2s var(--ease);
}

.gate__go .lucide {
	width: 16px;
	height: 16px;
	transition: transform 0.35s var(--spring);
}

.gate__go:hover {
	filter: brightness(1.06);
}

.gate__go:hover .lucide {
	transform: translateX(3px);
}

.gate__go:active {
	transform: scale(0.98);
}

.gate__go.is-busy {
	opacity: 0.6;
	cursor: progress;
}

/* Restore is the rare path, so it reads as a footnote rather than a button. */
.gate__alt {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 1.4rem 0 0;
	padding-top: 1.2rem;
	border-top: 1px solid var(--line);
	font-size: 0.78rem;
	color: var(--text-mute);
}

.gate__alt button {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0;
	border: none;
	background: none;
	color: var(--accent);
	font: inherit;
	font-weight: 660;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-color: rgb(var(--accent-rgb) / 0.35);
	transition: text-decoration-color 0.2s var(--ease);
}

.gate__alt button:hover {
	text-decoration-color: var(--accent);
}

.gate__alt button .lucide {
	width: 14px;
	height: 14px;
}

.gate__alt button:disabled {
	opacity: 0.55;
	cursor: progress;
}

.gate__avatar-row {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
}

.gate__avatar {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	cursor: pointer;
	outline: none;
}

.gate__avatar-img {
	position: relative;
	display: grid;
	place-items: center;
	width: 76px;
	height: 76px;
	border-radius: var(--r-lg);
	border: 1px dashed var(--line-2);
	background: rgb(255 255 255 / 0.04);
	color: var(--text-mute);
	overflow: hidden;
	transition:
		border-color 0.25s var(--ease),
		background 0.25s var(--ease),
		transform 0.35s var(--spring);
}

.gate__avatar:hover .gate__avatar-img,
.gate__avatar:focus-visible .gate__avatar-img {
	border-color: rgb(var(--accent-rgb) / 0.5);
	background: var(--accent-low);
	color: var(--accent);
	transform: scale(1.03);
}

.gate__avatar-img.has-image {
	border-style: solid;
	border-color: rgb(var(--accent-rgb) / 0.4);
}

.gate__avatar-img img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gate__avatar-hint {
	font-size: 0.68rem;
	font-weight: 650;
	color: var(--text-mute);
}

.gate__fields {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
}

/* Narrow: drop the rail and keep the form, with the mark moved above it. */
@media (max-width: 820px) {
	.gate {
		grid-template-columns: 1fr;
	}

	.gate__aside {
		display: none;
	}

	.gate__panel::before {
		content: "";
		display: block;
		width: 34px;
		height: 3px;
		margin-bottom: 1.6rem;
		border-radius: 99px;
		background: var(--accent);
	}
}

/* ══ Left dock ══════════════════════════════════════════════════ */
.dock {
	--dock-cut: #0e1011;
	position: fixed;
	left: 14px;
	bottom: 14px;
	z-index: 61;
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.3rem 0.55rem 0.3rem 0.7rem;
	border: 1px solid var(--line-2);
	border-radius: var(--r-lg);
	background: var(--shell);
	box-shadow:
		0 18px 45px rgb(0 0 0 / 0.55),
		inset 0 1px 0 rgb(255 255 255 / 0.07);
	animation: taskbar-rise 0.7s 0.12s var(--spring) both;
}

.dock__mark {
	display: block;
	height: 22px;
	filter: drop-shadow(0 0 12px var(--accent-glow));
}

.dock__sep {
	width: 1px;
	height: 24px;
	background: var(--line-2);
}

.dock__profile {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.25rem 0.45rem 0.25rem 0.25rem;
	border: 1px solid transparent;
	border-radius: var(--r-sm);
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition:
		background 0.24s var(--ease),
		border-color 0.24s var(--ease),
		transform 0.35s var(--spring);
}

.dock__profile:hover {
	background: rgb(255 255 255 / 0.07);
	border-color: var(--line);
}

.dock__profile:active {
	transform: scale(0.97);
}

.dock__avatar {
	position: relative;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 50%;
	overflow: visible;
	background: linear-gradient(150deg, var(--accent-hi), var(--accent-deep));
	color: var(--accent-ink);
	font-size: 0.85rem;
	font-weight: 800;
}

.dock__avatar img {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.dock__level {
	position: absolute;
	right: -5px;
	bottom: -5px;
	min-width: 17px;
	height: 17px;
	padding: 0 3px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: var(--bg-2);
	border: 1px solid rgb(var(--accent-rgb) / 0.45);
	color: var(--accent);
	font-size: 0.58rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.dock__who {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
	min-width: 0;
}

.dock__who strong {
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.dock__tags {
	display: flex;
	align-items: center;
	gap: 0.3rem;
}

.dock__role,
.dock__title {
	padding: 0.05rem 0.4rem;
	border-radius: 999px;
	font-size: 0.58rem;
	font-weight: 750;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	white-space: nowrap;
}

.dock__role {
	background: var(--accent-low);
	border: 1px solid rgb(var(--accent-rgb) / 0.3);
	color: var(--accent);
}

.dock__title {
	color: var(--text-mute);
	border: 1px solid var(--line);
}

/* ══ Profile page ═══════════════════════════════════════════════ */
.profile-page {
	flex: 1;
	overflow-y: auto;
	padding: 2rem var(--gutter) calc(var(--taskbar-h) + 3rem);
}

.profile-hero {
	position: relative;
	max-width: 1080px;
	margin: 0 auto 1.5rem;
	padding: 1.8rem;
	border: 1px solid var(--line);
	border-radius: var(--r-xl);
	background: rgb(255 255 255 / 0.028);
	overflow: hidden;
	animation: set-in 0.5s var(--ease) both;
}

.profile-hero__glow {
	position: absolute;
	inset: -40% 40% 40% -20%;
	background: radial-gradient(
		circle,
		rgb(var(--accent-rgb) / 0.14),
		transparent 65%
	);
	pointer-events: none;
}

.profile-id {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1.6rem;
	flex-wrap: wrap;
}

.profile-ring {
	position: relative;
	width: 120px;
	height: 120px;
	flex-shrink: 0;
	display: grid;
	place-items: center;
}

.profile-ring svg {
	position: absolute;
	inset: 0;
	transform: rotate(-90deg);
}

.profile-ring__track {
	fill: none;
	stroke: rgb(255 255 255 / 0.08);
	stroke-width: 5;
}

.profile-ring__value {
	fill: none;
	stroke: var(--accent);
	stroke-width: 5;
	stroke-linecap: round;
	filter: drop-shadow(0 0 8px var(--accent-glow));
	transition: stroke-dashoffset 0.9s var(--ease);
}

.profile-avatar {
	display: grid;
	place-items: center;
	width: 88px;
	height: 88px;
	border-radius: 50%;
	overflow: hidden;
	background: linear-gradient(150deg, var(--accent-hi), var(--accent-deep));
	color: var(--accent-ink);
	font-size: 2rem;
	font-weight: 800;
}

.profile-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.profile-level {
	position: absolute;
	right: 2px;
	bottom: 2px;
	min-width: 28px;
	height: 24px;
	padding: 0 6px;
	display: grid;
	place-items: center;
	border-radius: 999px;
	background: var(--bg-2);
	border: 1px solid rgb(var(--accent-rgb) / 0.45);
	color: var(--accent);
	font-size: 0.75rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.profile-meta {
	flex: 1;
	min-width: 220px;
}

.profile-meta h1 {
	margin: 0;
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 800;
	letter-spacing: -0.035em;
}

.profile-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.6rem 0 1rem;
}

.profile-badge {
	padding: 0.25rem 0.65rem;
	border-radius: 999px;
	border: 1px solid var(--line-2);
	background: rgb(255 255 255 / 0.04);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-dim);
}

.profile-badge--role {
	background: var(--accent-low);
	border-color: rgb(var(--accent-rgb) / 0.35);
	color: var(--accent);
}

.profile-xp__bar {
	height: 8px;
	border-radius: 99px;
	background: rgb(255 255 255 / 0.08);
	overflow: hidden;
}

.profile-xp__bar span {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--accent-deep), var(--accent));
	box-shadow: 0 0 14px var(--accent-glow);
	transition: width 0.9s var(--ease);
}

.profile-xp p {
	margin: 0.45rem 0 0;
	font-size: 0.75rem;
	color: var(--text-mute);
	font-variant-numeric: tabular-nums;
}

.profile-out {
	align-self: flex-start;
}

.profile-stats {
	position: relative;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 0.6rem;
	margin-top: 1.8rem;
}

.stat-tile {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.03);
	transition:
		border-color 0.25s var(--ease),
		transform 0.35s var(--spring);
}

.stat-tile:hover {
	border-color: rgb(var(--accent-rgb) / 0.3);
	transform: translateY(-3px);
}

.stat-tile__icon {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	margin-bottom: 0.3rem;
	border-radius: 8px;
	background: var(--accent-low);
	color: var(--accent);
}

.stat-tile__icon .lucide {
	width: 14px;
	height: 14px;
}

.stat-tile strong {
	font-size: 1.3rem;
	font-weight: 780;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.stat-tile span:last-child {
	font-size: 0.72rem;
	color: var(--text-mute);
}

.profile-section {
	max-width: 1080px;
	margin: 0 auto 1.5rem;
	animation: set-in 0.5s 0.08s var(--ease) both;
}

.profile-section__head {
	margin-bottom: 0.9rem;
}

.profile-section__head h2 {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	font-size: 1.05rem;
	font-weight: 740;
	letter-spacing: -0.02em;
}

.profile-section__head h2 .lucide {
	width: 17px;
	height: 17px;
	color: var(--accent);
}

.profile-section__head p {
	margin: 0.25rem 0 0;
	font-size: 0.8rem;
	color: var(--text-mute);
}

.unlock-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 0.6rem;
}

.unlock-card {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.9rem 1rem;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.028);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
	overflow: hidden;
	transition:
		border-color 0.25s var(--ease),
		background 0.25s var(--ease),
		transform 0.35s var(--spring);
}

.unlock-card:not(.is-locked):hover {
	transform: translateY(-3px);
	border-color: var(--line-2);
	background: rgb(255 255 255 / 0.05);
}

.unlock-card.is-active {
	border-color: rgb(var(--accent-rgb) / 0.5);
	background: var(--accent-low);
}

.unlock-card.is-locked {
	cursor: not-allowed;
	opacity: 0.45;
	filter: grayscale(0.7);
}

.unlock-card__preview {
	flex-shrink: 0;
	width: 92px;
	font-size: 0.95rem;
	font-weight: 750;
	letter-spacing: -0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.unlock-card__preview--title {
	color: var(--accent);
	font-size: 0.9rem;
}

.unlock-card__meta {
	flex: 1;
	min-width: 0;
}

.unlock-card__meta strong {
	display: block;
	font-size: 0.83rem;
	font-weight: 700;
}

.unlock-card__state {
	flex-shrink: 0;
	color: var(--accent);
}

.unlock-card__state .lucide {
	width: 17px;
	height: 17px;
}

.unlock-card__lock,
.unlock-card__use {
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	border: 1px solid var(--line-2);
	font-size: 0.62rem;
	font-weight: 750;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--text-mute);
}

.unlock-card:not(.is-locked):hover .unlock-card__use {
	border-color: rgb(var(--accent-rgb) / 0.4);
	color: var(--accent);
}

@media (max-width: 760px) {
	.dock__who {
		display: none;
	}

	.profile-id {
		gap: 1rem;
	}
}


/* ══ Name effects ═══════════════════════════════════════════════ */
.fx {
	position: relative;
	display: inline-block;
	/* Halos and sparks need room to spill without being clipped. */
	padding: 0.12em 0.06em;
	margin: -0.12em -0.06em;
	overflow: visible;
	white-space: nowrap;
}

.fx--split {
	display: inline-flex;
	align-items: baseline;
}

.fx__l {
	display: inline-block;
	will-change: transform;
}

.fx__sp {
	display: inline-block;
	width: 0.32em;
}

/* Sparks used by ember and prism. */
.fx__sparks {
	position: absolute;
	inset: -0.3em -0.2em 0;
	pointer-events: none;
}

.fx__sparks i {
	position: absolute;
	bottom: 0;
	width: 3px;
	height: 3px;
	border-radius: 50%;
	opacity: 0;
	animation: fx-spark 2.6s ease-out infinite;
}

.fx__sparks i:nth-child(1) { left: 8%; animation-delay: 0s; }
.fx__sparks i:nth-child(2) { left: 25%; animation-delay: 0.45s; }
.fx__sparks i:nth-child(3) { left: 42%; animation-delay: 0.9s; }
.fx__sparks i:nth-child(4) { left: 60%; animation-delay: 1.35s; }
.fx__sparks i:nth-child(5) { left: 77%; animation-delay: 1.8s; }
.fx__sparks i:nth-child(6) { left: 92%; animation-delay: 2.2s; }

@keyframes fx-spark {
	0% {
		opacity: 0;
		transform: translateY(0) scale(0.6);
	}
	15% {
		opacity: 1;
	}
	100% {
		opacity: 0;
		transform: translateY(-2.1em) translateX(0.4em) scale(0.2);
	}
}

/* ── 2 · Soft glow ── */
.fx--glow {
	color: var(--accent-hi);
	text-shadow:
		0 0 8px var(--accent-glow),
		0 0 22px rgb(var(--accent-rgb) / 0.35);
	animation: fx-glow 3.4s ease-in-out infinite;
}

@keyframes fx-glow {
	50% {
		text-shadow:
			0 0 12px var(--accent-glow),
			0 0 34px rgb(var(--accent-rgb) / 0.5);
	}
}

/* ── 3 · Gradient ── */
.fx--gradient {
	background: linear-gradient(100deg, #fff 10%, var(--accent) 90%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* ── 4 · Wave: a sine rolling through the letters ── */
.fx--wave .fx__l {
	color: var(--accent-hi);
	animation: fx-wave 1.6s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.085s);
}

@keyframes fx-wave {
	0%,
	100% {
		transform: translateY(0) rotate(0deg);
	}
	30% {
		transform: translateY(-0.26em) rotate(-4deg);
	}
	60% {
		transform: translateY(0.08em) rotate(2deg);
	}
}

/* ── 5 · Skip rope: a jump that travels down the line ── */
.fx--rope .fx__l {
	color: var(--accent);
	transform-origin: 50% 100%;
	animation: fx-rope 1.9s cubic-bezier(0.3, 0.9, 0.4, 1) infinite;
	animation-delay: calc(var(--i) * 0.07s);
}

@keyframes fx-rope {
	0%,
	55%,
	100% {
		transform: translateY(0) scaleY(1);
	}
	12% {
		transform: translateY(0.06em) scaleY(0.82);
	}
	28% {
		transform: translateY(-0.55em) scaleY(1.12);
	}
	42% {
		transform: translateY(0) scaleY(0.94);
	}
}

/* ── 6 · Ember ── */
.fx--ember {
	background: linear-gradient(180deg, #ffd9a0, #ff8a3d 55%, #d4432a);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	filter: drop-shadow(0 0 8px rgb(255 122 61 / 0.45));
	animation: fx-ember 2.6s ease-in-out infinite;
}

.fx--ember .fx__sparks i {
	background: #ff9d4d;
	box-shadow: 0 0 6px #ff7a3d;
}

@keyframes fx-ember {
	50% {
		filter: drop-shadow(0 0 16px rgb(255 138 61 / 0.7));
	}
}

/* ── 7 · Neon ── */
.fx--neon {
	color: #fff;
	text-shadow:
		0 0 4px #fff,
		0 0 11px var(--accent),
		0 0 22px var(--accent),
		0 0 42px rgb(var(--accent-rgb) / 0.6);
	animation: fx-neon 5s steps(1) infinite;
}

@keyframes fx-neon {
	0%,
	92%,
	96%,
	100% {
		opacity: 1;
	}
	94% {
		opacity: 0.45;
	}
	98% {
		opacity: 0.7;
	}
}

/* ── 8 · Chrome ── */
.fx--chrome {
	background: linear-gradient(
		100deg,
		#8e99a5 0%,
		#ffffff 18%,
		#c8d0d8 34%,
		#6d7783 52%,
		#ffffff 68%,
		#aeb8c2 86%,
		#7d8792 100%
	);
	background-size: 260% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: fx-chrome 5.5s linear infinite;
}

@keyframes fx-chrome {
	to {
		background-position: -260% 0;
	}
}

/* ── 9 · Glitch: per-letter channel split ── */
.fx--glitch .fx__l {
	position: relative;
	color: var(--text);
	animation: fx-glitch-jitter 3.4s steps(1) infinite;
	animation-delay: calc(var(--i) * 0.06s);
}

.fx--glitch .fx__l::before,
.fx--glitch .fx__l::after {
	content: attr(data-char);
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.fx--glitch .fx__l::before {
	color: #ff4d6d;
	animation: fx-glitch-a 3.4s steps(1) infinite;
	animation-delay: calc(var(--i) * 0.06s);
}

.fx--glitch .fx__l::after {
	color: #4dd8ff;
	animation: fx-glitch-b 3.4s steps(1) infinite;
	animation-delay: calc(var(--i) * 0.06s);
}

@keyframes fx-glitch-jitter {
	0%,
	86%,
	100% {
		transform: translate(0);
	}
	88% {
		transform: translate(-1px, 1px);
	}
	92% {
		transform: translate(1px, -1px);
	}
}

@keyframes fx-glitch-a {
	0%,
	86%,
	100% {
		transform: translate(0);
		opacity: 0;
	}
	88% {
		transform: translate(-2px, -1px);
		opacity: 0.9;
	}
	94% {
		transform: translate(2px, 1px);
		opacity: 0.7;
	}
}

@keyframes fx-glitch-b {
	0%,
	86%,
	100% {
		transform: translate(0);
		opacity: 0;
	}
	90% {
		transform: translate(2px, 1px);
		opacity: 0.9;
	}
	96% {
		transform: translate(-2px, -1px);
		opacity: 0.7;
	}
}

/* ── 10 · Prism: spectrum sweep, letters lifting in sequence ── */
.fx--prism .fx__l {
	background: linear-gradient(
		100deg,
		#ff5f6d,
		#ffc371,
		#7ff0c4,
		#5b9dff,
		#a78bfa,
		#ff5f6d
	);
	background-size: 600% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation:
		fx-prism-sweep 6s linear infinite,
		fx-prism-lift 2.4s ease-in-out infinite;
	animation-delay: 0s, calc(var(--i) * 0.06s);
}

.fx--prism .fx__sparks i {
	background: #fff;
	box-shadow: 0 0 8px rgb(var(--accent-rgb) / 0.9);
}

@keyframes fx-prism-sweep {
	to {
		background-position: 600% 0;
	}
}

@keyframes fx-prism-lift {
	0%,
	100% {
		transform: translateY(0);
	}
	45% {
		transform: translateY(-0.16em);
	}
}

/* Names sit in containers that must not clip the effects. */
.profile-name {
	margin: 0;
	padding: 0.1em 0;
	font-size: clamp(1.8rem, 4vw, 2.5rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	overflow: visible;
}

.profile-hero,
.profile-meta,
.dock__who,
.unlock-card {
	overflow: visible;
}

.unlock-card__preview {
	overflow: visible;
	text-overflow: clip;
}

/* ── Bounce: each letter hops in turn ── */
.fx--bounce .fx__l {
	color: var(--accent-hi);
	animation: fx-bounce 1.4s cubic-bezier(0.28, 0.84, 0.42, 1) infinite;
	animation-delay: calc(var(--i) * 0.08s);
}

@keyframes fx-bounce {
	0%,
	60%,
	100% {
		transform: translateY(0);
	}
	25% {
		transform: translateY(-0.38em);
	}
	40% {
		transform: translateY(0.04em) scaleY(0.92);
	}
}

/* ── Wobble: swinging off a pivot above each letter ── */
.fx--wobble .fx__l {
	color: var(--accent);
	transform-origin: 50% -0.4em;
	animation: fx-wobble 2.2s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.09s);
}

@keyframes fx-wobble {
	0%,
	100% {
		transform: rotate(-7deg);
	}
	50% {
		transform: rotate(7deg);
	}
}

/* ── Tide: colour rolling through the letters ── */
.fx--tide .fx__l {
	color: var(--text);
	animation: fx-tide 2.8s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.11s);
}

@keyframes fx-tide {
	0%,
	100% {
		color: var(--text);
		text-shadow: none;
	}
	40% {
		color: var(--accent);
		text-shadow: 0 0 14px var(--accent-glow);
	}
}

/* ── Comet: a bright head dragging a tail ── */
.fx--comet .fx__l {
	color: rgb(255 255 255 / 0.45);
	animation: fx-comet 2.4s linear infinite;
	animation-delay: calc(var(--i) * -0.12s);
}

@keyframes fx-comet {
	0%,
	100% {
		color: rgb(255 255 255 / 0.4);
		text-shadow: none;
		transform: translateY(0);
	}
	8% {
		color: #fff;
		text-shadow:
			0 0 10px var(--accent),
			0 0 26px var(--accent);
		transform: translateY(-0.1em);
	}
	22% {
		color: var(--accent-hi);
		text-shadow: 0 0 8px var(--accent-glow);
	}
}

.fx--comet .fx__sparks i {
	background: var(--accent-hi);
	box-shadow: 0 0 8px var(--accent);
}

/* ══ Unlock cards: square, effect always previewed ══════════════ */
.unlock-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 0.7rem;
}

.unlock-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0.45rem;
	aspect-ratio: 1;
	padding: 0.85rem 0.75rem 0.8rem;
	text-align: center;
	overflow: visible;
}

.unlock-card__preview {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 100%;
	min-height: 82px;
	font-size: 1.05rem;
	font-weight: 750;
	letter-spacing: -0.01em;
	overflow: visible;
}

/* Locked previews still animate, just dimmed. */
.unlock-card.is-locked .unlock-card__preview {
	opacity: 0.45;
	filter: saturate(0.5);
}

.unlock-card.is-locked {
	cursor: not-allowed;
}

.unlock-card__meta {
	display: block;
	width: 100%;
	margin-top: auto;
	padding: 0 0.25rem;
	text-align: center;
	overflow: visible;
	flex-shrink: 0;
}

.unlock-card__meta strong {
	display: block;
	font-size: 0.83rem;
	font-weight: 680;
	line-height: 1.3;
}

.unlock-card__state {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 22px;
}

.unlock-card__lock,
.unlock-card__use {
	display: inline-block;
	padding: 0.22rem 0.6rem;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.07);
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--text-mute);
}

.unlock-card__use {
	background: var(--accent-low);
	color: var(--accent);
}

/* ══ Profile dialog ═════════════════════════════════════════════ */
.pf {
	margin: -1.1rem -1.25rem -1.25rem;
}

.pf__banner {
	position: relative;
	height: 132px;
	background:
		linear-gradient(120deg, var(--accent-deep), rgb(255 255 255 / 0.04));
	background-size: cover;
	background-position: center;
}

.pf__banner-fade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 35%, rgb(17 19 21 / 0.98));
	pointer-events: none;
}

.pf__edit {
	position: absolute;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.35rem 0.6rem;
	border: 1px solid rgb(255 255 255 / 0.16);
	border-radius: 999px;
	background: rgb(0 0 0 / 0.66);
	color: #fff;
	font: inherit;
	font-size: 0.7rem;
	font-weight: 640;
	cursor: pointer;
	opacity: 0;
	transition:
		opacity 0.22s var(--ease),
		background 0.2s var(--ease);
}

.pf__edit .lucide {
	width: 12px;
	height: 12px;
}

.pf__edit--banner {
	top: 0.6rem;
	right: 0.7rem;
}

.pf__banner:hover .pf__edit {
	opacity: 1;
}

.pf__edit:hover {
	background: rgb(0 0 0 / 0.72);
}

.pf__id {
	display: flex;
	align-items: flex-end;
	gap: 1rem;
	margin-top: -46px;
	padding: 0 1.25rem;
}

.pf__avatar {
	position: relative;
	width: 96px;
	height: 96px;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	border: 4px solid rgb(17 19 21 / 0.98);
	border-radius: 50%;
	background: linear-gradient(150deg, var(--accent-hi), var(--accent-deep));
	color: var(--accent-ink);
	cursor: pointer;
	padding: 0;
	overflow: visible;
}

.pf__avatar > img {
	width: 100%;
	height: 100%;
	border-radius: 999px;
	object-fit: cover;
}

.pf__initial {
	font-size: 2rem;
	font-weight: 850;
}

.pf__avatar-edit {
	position: absolute;
	right: -4px;
	bottom: -4px;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	border: 2px solid rgb(17 19 21 / 0.98);
	background: var(--accent);
	color: var(--accent-ink);
	opacity: 0;
	transform: scale(0.7);
	transition:
		opacity 0.22s var(--ease),
		transform 0.35s var(--spring);
}

.pf__avatar-edit .lucide {
	width: 13px;
	height: 13px;
}

.pf__avatar:hover .pf__avatar-edit {
	opacity: 1;
	transform: scale(1);
}

/* Overlay art sits above the picture and scales with it. */
.av-fx {
	position: absolute;
	inset: -14%;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	pointer-events: none;
}

.pf__who {
	flex: 1;
	min-width: 0;
	padding-bottom: 0.35rem;
}

.pf__name {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.3rem 0.4rem;
	margin: 0 0 0.4rem;
	padding: 0.1em 0;
	font-size: 1.5rem;
	font-weight: 780;
	letter-spacing: -0.03em;
	line-height: 1.15;
	overflow: visible;
}

.pf__name > .fx {
	display: inline-flex;
	align-items: center;
	line-height: 1.15;
}

.pf__name-badges {
	display: inline-flex;
	align-items: center;
	align-self: center;
	gap: 0.28rem;
	flex-wrap: wrap;
	height: 1.15em;
}

.pf__icon-badge {
	position: relative;
	display: inline-grid;
	place-items: center;
	width: 1.05em;
	height: 1.05em;
	flex-shrink: 0;
	cursor: default;
}

.pf__icon-badge img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 2px 4px rgb(0 0 0 / 0.35));
}

.pf__icon-badge::after {
	content: attr(data-tip);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 8px);
	transform: translateX(-50%) translateY(4px);
	padding: 0.35rem 0.55rem;
	border-radius: 8px;
	background: rgb(12 14 16 / 0.96);
	border: 1px solid var(--line-2);
	color: var(--text);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 0.18s var(--ease),
		transform 0.22s var(--spring);
	z-index: 5;
	box-shadow: 0 10px 24px rgb(0 0 0 / 0.45);
}

.pf__icon-badge:hover::after {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.badge-panes {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding: 0 1.25rem 0.5rem;
}

.badge-section__title {
	margin: 0 0 0.2rem;
	font-size: 0.92rem;
	font-weight: 740;
}

.badge-section__sub {
	margin: 0 0 0.7rem;
	font-size: 0.74rem;
	color: var(--text-mute);
}

.unlock-grid--badges {
	display: grid;
	gap: 0.7rem;
}

.badge-preview {
	width: 52px;
	height: 52px;
	object-fit: contain;
	filter: drop-shadow(0 4px 10px rgb(0 0 0 / 0.35));
}

.dock__name {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.28rem;
	line-height: 1.15;
}

.dock__name > .fx {
	display: inline-flex;
	align-items: center;
	line-height: 1.15;
}

.dock__name .pf__name-badges {
	height: 1.15em;
}

.dock__name .pf__icon-badge {
	width: 1.05em;
	height: 1.05em;
}

.pf__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.pf__badge {
	padding: 0.22rem 0.6rem;
	border-radius: var(--r-xs);
	border: 1px solid var(--line);
	background: rgb(255 255 255 / 0.05);
	font-size: 0.68rem;
	font-weight: 680;
	color: var(--text-dim);
}

.pf__badge--role {
	border-color: rgb(var(--accent-rgb) / 0.35);
	background: var(--accent-low);
	color: var(--accent);
}

.pf__xp {
	padding: 1rem 1.25rem 0;
}

.pf__xp-bar {
	height: 6px;
	border-radius: 99px;
	background: rgb(255 255 255 / 0.08);
	overflow: hidden;
}

.pf__xp-bar span {
	display: block;
	height: 100%;
	border-radius: 99px;
	background: linear-gradient(90deg, var(--accent-deep), var(--accent));
	transition: width 0.6s var(--ease);
}

.pf__xp p {
	margin: 0.4rem 0 0;
	font-size: 0.72rem;
	color: var(--text-mute);
	font-variant-numeric: tabular-nums;
}

.pf__stats {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 0.4rem;
	padding: 1rem 1.25rem 0;
}

.pf__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	padding: 0.6rem 0.3rem;
	border: 1px solid var(--line);
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.03);
	text-align: center;
}

.pf__stat > span:first-child {
	color: var(--accent);
}

.pf__stat .lucide {
	width: 15px;
	height: 15px;
}

.pf__stat strong {
	font-size: 0.9rem;
	font-weight: 720;
	font-variant-numeric: tabular-nums;
}

.pf__stat > span:last-child {
	font-size: 0.63rem;
	color: var(--text-mute);
}

.pf__tabs {
	position: relative;
	display: inline-flex;
	gap: 0.3rem;
	margin: 1.2rem 1.25rem 0.8rem;
	padding: 0.25rem;
	border-radius: var(--r);
	background: rgb(255 255 255 / 0.04);
	border: 1px solid var(--line);
}

.pf__tabs-pill {
	position: absolute;
	top: 0.25rem;
	left: 0;
	height: calc(100% - 0.5rem);
	border-radius: var(--r-xs);
	background: var(--accent-low);
	border: 1px solid rgb(var(--accent-rgb) / 0.3);
	pointer-events: none;
	transition:
		transform 0.45s var(--spring),
		width 0.45s var(--spring);
}

.pf__tab {
	position: relative;
	z-index: 1;
	padding: 0.45rem 0.9rem;
	border: 1px solid transparent;
	border-radius: var(--r-xs);
	background: transparent;
	color: var(--text-dim);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 640;
	cursor: pointer;
	transition:
		background 0.2s var(--ease),
		color 0.2s var(--ease);
}

.pf__tab:hover {
	background: rgb(255 255 255 / 0.06);
	color: var(--text);
}

.pf__tab.on {
	background: transparent;
	border-color: transparent;
	color: var(--accent);
}

.pf .unlock-grid,
.pf .unlock-grid--badges {
	padding: 0 1.25rem;
	grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
	grid-auto-rows: 1fr;
}

.pf .unlock-card,
.pf .unlock-card--badge {
	aspect-ratio: 1;
	height: 100%;
	box-sizing: border-box;
}

.av-preview {
	position: relative;
	display: grid;
	place-items: center;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	overflow: visible;
	color: var(--accent-ink);
}

.av-preview > img,
.av-preview .pf__initial {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
}

.av-preview .pf__initial {
	display: grid;
	place-items: center;
	font-size: 1.15rem;
	background: linear-gradient(150deg, var(--accent-hi), var(--accent-deep));
}

.av-preview .av-fx {
	z-index: 2;
	inset: -6%;
	border-radius: 0;
	background-size: contain;
}

.pf .unlock-card:has(.av-preview) .unlock-card__meta {
	margin-top: auto;
}

.pf__foot {
	display: flex;
	justify-content: flex-end;
	padding: 1.2rem 1.25rem 1.25rem;
}

/* Avatar overlay on the taskbar card. */
.dock__avatar .av-fx {
	inset: 0;
	background-size: cover;
}

@media (max-width: 620px) {
	.pf__stats {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* ══ Avatar overlay fit ═════════════════════════════════════════ */
/* Art is drawn for a square frame - inset it so it hugs the picture. */
.pf__avatar {
	background: none;
	overflow: visible;
}

.pf__avatar > img {
	border-radius: 50%;
}


/* The shop preview tile is small, so the art needs to sit tighter. */
.av-preview {
	overflow: visible;
}

.av-preview > img,
.av-preview {
	border-radius: 50%;
}

.av-preview .av-fx {
	inset: -13%;
}

/* Taskbar card: give the art room instead of cropping it. */
.dock__avatar {
	overflow: visible;
	border-radius: 50%;
}

.dock__avatar > img {
	border-radius: 50%;
}

.dock__avatar .av-fx {
	inset: -14%;
}

/* Keep the level pip above the overlay art. */
.dock__level,
.pf__avatar-edit {
	z-index: 2;
}

/* Confetti sits above the dialog contents but ignores the pointer. */
.confetti-layer {
	position: absolute;
	inset: 0;
	z-index: 40;
	pointer-events: none;
}

.modal {
	position: relative;
}

/*
 * Only the taskbar's role and level chips. Earned badges (the owner mark and
 * friends) stay put, here and on the profile page.
 */
html.hide-badges .dock__tags {
	display: none;
}
