/* Wallets as people (user.ts): the face, the name, the short address, the chip
   and the profile card. Loaded by every page that shows a wallet, so the home
   page's faithful wall, the Altar's lists and the server-rendered pages
   (src/user.ts writes the same markup) look alike. */

/* A wallet's face (.av) is drawn by header.css, which every page loads, since
   the bar's profile chip shows one everywhere. The profile card's banner
   loads the same way. */
.cc-banner.loading {
	background-color: #15110b;
}
.cc-banner.loading img {
	opacity: 0;
}
.cc-banner img {
	transition: opacity 0.3s;
}

/* The burn engine's face (lib/engine.ts): an ember with a flame in it, at
   whatever size the face around it sets. Its name's glow is live.css .mg-engine. */
.av.av-engine {
	background:
		radial-gradient(circle at 50% 62%, rgba(255, 214, 150, 0.85), rgba(255, 214, 150, 0) 42%),
		radial-gradient(circle at 35% 28%, #ff8a4c, #d9361c 58%, #5c1208);
}
.av-engine svg {
	display: block;
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 0 3px rgba(255, 140, 70, 0.6));
}

.cc-banner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.user-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
}
.cc {
	min-width: 0;
}
/* The wall's placeholders while it loads: the card's shape in skeletons
   (site.css .skel), sized here. */
.cc-skel .cc-in {
	gap: 8px;
}
.cc-skel .skel {
	display: block;
}
.cc-skel .sk-banner {
	height: 64px;
	margin: 0 -12px;
	border-radius: 0;
}
.cc-skel .sk-av {
	width: 56px;
	height: 56px;
	margin-top: -28px;
	border-radius: 50%;
	box-shadow: 0 0 0 3px var(--card);
}
.cc-skel .sk-name {
	width: 60%;
	height: 16px;
	margin-top: 4px;
}
.cc-skel .sk-line {
	width: 90%;
	height: 11px;
}
.cc-skel .sk-line.short {
	width: 70%;
}
.cc-skel .sk-bio {
	height: 30px;
}
.cc-skel .sk-stats {
	height: 94px;
	margin-top: auto;
	border-radius: var(--r-sm);
}
.cc-skel .sk-bar {
	height: 6px;
	margin-top: 12px;
	border-radius: var(--r-pill);
}
.cc-in {
	position: relative;
	height: 100%;
	display: flex;
	flex-direction: column;
	padding: 0 12px 12px;
	border-radius: var(--r-lg);
	overflow: hidden;
	--edge: rgba(var(--gold-rgb), 0.14);
	background: var(--card);
	color: var(--bone);
	text-decoration: none;
	transition:
		box-shadow 0.3s,
		transform 0.3s var(--ease);
}
/* The outline sits on its own layer over everything in the card, so the banner never hides its top edge. */
.cc-in::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px var(--edge);
	pointer-events: none;
	transition: box-shadow 0.3s;
}
.cc-in:hover {
	--edge: rgba(var(--gold-rgb), 0.55);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	transform: translateY(-2px);
}
.cc-banner {
	position: relative;
	display: block;
	height: 64px;
	margin: 0 -12px;
	overflow: hidden;
	background: linear-gradient(
		120deg,
		hsl(var(--h, 40) 45% 22%),
		hsl(calc(var(--h, 40) + 60) 45% 14%)
	);
}
.cc-rank {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 2px 8px;
	border-radius: var(--r-pill);
	background: rgba(var(--void-rgb), 0.7);
	font: 700 var(--t-xs) var(--sans);
	font-variant-numeric: tabular-nums;
	color: var(--soft);
}
.cc-rank.top {
	color: #1a1206;
	background: linear-gradient(160deg, #f6d995, #d9a94c 60%, #b98a33);
}
.cc-rank.r1 {
	background: radial-gradient(circle at 35% 30%, #fff1c2, var(--gold) 55%, #a8741f);
	box-shadow: 0 0 12px rgba(var(--gold-hi-rgb), 0.5);
}
.cc-rank.r2 {
	background: radial-gradient(circle at 35% 30%, #ffffff, #c9ccd2 55%, #8a8f99);
}
.cc-rank.r3 {
	background: radial-gradient(circle at 35% 30%, #ffd9b8, #c98a4b 55%, #8a5427);
}
/* The banner fades into the card, so the face sits on it cleanly. */
.cc-banner::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, transparent 40%, rgba(20, 16, 10, 0.85));
}
/* Chips for what a wallet has done: gold for its bag, violet for its muses, sky for the bell, ember for burns. */
.cc-stats .cc-chip {
	gap: 4px;
	padding: 3px 8px 3px 6px;
	border-radius: var(--r-pill);
	font-size: var(--t-xs);
	background: rgba(var(--kr, var(--gold-rgb)), 0.1);
	box-shadow: inset 0 0 0 1px rgba(var(--kr, var(--gold-rgb)), 0.22);
}
.cc-stats .cc-chip b {
	color: var(--k1, var(--gold-hi));
}
.cc-stats .cc-chip .i {
	width: 12px;
	height: 12px;
	color: var(--k2, var(--gold));
}
.cc-chip.bell {
	--kr: 111, 184, 238;
	--k1: #bfe6ff;
	--k2: var(--bell);
}
.cc-chip.muse {
	--kr: 178, 140, 255;
	--k1: #e6dbff;
	--k2: #b28cff;
}
.cc-chip.burn {
	--kr: 255, 122, 82;
	--k1: #ffd2c2;
	--k2: var(--burn);
}
/* Holographic cards (holo.css): the tilt replaces the lift, and the wall's
   foil is quieter than an open card's; the top three wear their medal. */
.cc {
	position: relative;
}
.cc-in.holo-on {
	transition: box-shadow 0.3s;
}
.cc-in.holo-on:hover {
	transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-2px);
}
.cc-in .holo-foil {
	opacity: calc(var(--o) * 0.22);
}
.cc-in .holo-glare {
	opacity: calc(var(--o) * 0.7);
}
.cc[data-medal] .cc-in .holo-foil {
	background:
		linear-gradient(
			115deg,
			transparent 15%,
			var(--m1) 32%,
			var(--m2) 45%,
			var(--m3) 58%,
			var(--m1) 70%,
			transparent 85%
		)
		var(--mx) var(--my) / 300% 300% no-repeat;
	opacity: calc(0.05 + var(--o) * 0.35);
}
.cc[data-medal="1"] {
	--m1: #fff1c2;
	--m2: var(--gold);
	--m3: #a8741f;
}
.cc[data-medal="2"] {
	--m1: #ffffff;
	--m2: #c9ccd2;
	--m3: #8a8f99;
}
.cc[data-medal="3"] {
	--m1: #ffd9b8;
	--m2: #c98a4b;
	--m3: #8a5427;
}
/* An Altar seat holder's seat, over the banner: opens the seat's card. */
.cc-seat {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 26px;
	padding: 0 9px 0 7px;
	border: 0;
	border-radius: var(--r-pill);
	background: rgba(var(--void-rgb), 0.72);
	box-shadow: inset 0 0 0 1px rgba(var(--gold-hi-rgb), 0.5);
	color: var(--gold-hi);
	font: 700 var(--t-xs) var(--sans);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.cc-seat .i {
	width: 12px;
	height: 12px;
}
@media (hover: hover) {
	.cc-seat:hover {
		background: rgba(var(--gold-rgb), 0.25);
	}
}
.cc-seat:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}
/* A wallet that burned carries a faint ember edge. */
.cc.burner .cc-in {
	--edge: rgba(var(--burn-rgb), 0.28);
}
.cc.burner .cc-in:hover {
	--edge: rgba(var(--burn-rgb), 0.6);
	box-shadow:
		0 10px 30px rgba(0, 0, 0, 0.5),
		0 0 24px rgba(255, 110, 70, 0.18);
}
.cc-av {
	position: relative;
	z-index: 1;
	width: 56px;
	height: 56px;
	margin-top: -28px;
	border-radius: 50%;
	overflow: hidden;
	display: block;
	box-shadow:
		0 0 0 3px var(--card),
		0 0 0 4px rgba(var(--gold-rgb), 0.5);
	--av-ring: 3px;
}
.cc-name {
	margin-top: 8px;
	font-size: var(--t-base);
	font-weight: 700;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.cc-addr {
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
}
.cc-bio {
	margin-top: 6px;
	font-size: var(--t-sm);
	line-height: 1.4;
	color: var(--soft);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
	min-height: 2.8em;
}
.cc-bio.empty {
	min-height: 0;
	margin: 0;
}
.cc-stats {
	margin-top: auto;
	padding-top: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	font-size: var(--t-sm);
	color: var(--soft);
}
.cc-stats span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.cc-stats b {
	color: var(--gold-hi);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.cc-stats .i {
	width: 13px;
	height: 13px;
	color: var(--gold);
}
.cc-split {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid rgba(var(--gold-rgb), 0.12);
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: var(--t-xs);
	color: var(--dim);
}
/* One slice: its figure, then its bar filling the rest of the row. Two
   slices (a wallet with MUSEGOD and muses) take half each, the bar under
   the figure. */
.cc-part {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}
.cc-split.halves {
	gap: 12px;
}
.cc-split.halves .cc-part {
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
}
.cc-part .cc-share {
	flex: none;
}
.cc-part .cc-bar {
	flex: 1;
}
.cc-split.halves .cc-share {
	flex: none;
	min-width: 0;
	line-height: 1.3;
}
.cc-split.halves .cc-share b {
	display: block;
	font-size: var(--t-sm);
}
.cc-split.halves .cc-bar {
	flex: none;
}
.cc-split:empty {
	display: none;
}
.cc-share b {
	color: var(--bone);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.cc-bar {
	display: block;
	height: 4px;
	border-radius: 2px;
	background: rgba(var(--gold-rgb), 0.14);
	overflow: hidden;
}
.cc-bar i {
	display: block;
	height: 100%;
	border-radius: 2px;
	background: linear-gradient(90deg, var(--gold), var(--gold-hi));
	box-shadow: 0 0 8px rgba(var(--gold-hi-rgb), 0.6);
}
.cc-part.muse .cc-bar {
	background: rgba(178, 140, 255, 0.14);
}
.cc-part.muse .cc-bar i {
	background: linear-gradient(90deg, #b28cff, #e6dbff);
	box-shadow: 0 0 8px rgba(178, 140, 255, 0.6);
}
.cc-nft {
	margin-top: 2px;
	display: flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
	font-size: var(--t-xs);
	color: var(--bless-hi);
}
.cc-nft span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.cc-nft .i {
	width: 12px;
	height: 12px;
	flex: none;
	color: var(--bless);
}

/* The card's icons (lib/icons.ts) take their strokes here, on pages without
   the home page's .i rule. */
.cc .i,
.user-chip .i {
	flex: none;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
	vertical-align: -0.18em;
}
.cc .i {
	width: 1.1em;
	height: 1.1em;
}
.cc-banner {
	--h: 40;
}
/* A card's body can add a line between the name and the chips (the Altar's burn time). */
.cc-mid {
	margin-top: 6px;
	font: 600 var(--d-2) / 1.1 var(--serif);
	letter-spacing: -0.01em;
	color: var(--gold-hi);
	font-variant-numeric: lining-nums tabular-nums;
}
/* The compact card: a shorter banner and a smaller face, no bio or NFT line. */
.cc-compact .cc-in {
	padding: 0 10px 10px;
}
.cc-compact .cc-banner {
	height: 40px;
	margin: 0 -10px;
}
.cc-compact .cc-av {
	width: 44px;
	height: 44px;
	margin-top: -22px;
}
.cc-compact .cc-name {
	margin-top: 6px;
	font-size: var(--t-note);
}
.cc-compact .cc-bio,
.cc-compact .cc-nft {
	display: none;
}
.cc-compact .cc-stats {
	padding-top: 8px;
}
/* An ember glow behind the card, hotter for a bigger burn (--heat 0 to 1). Fill only. */
.cc-heat .cc-in {
	isolation: isolate;
}
.cc-heat .cc-in::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	border-radius: inherit;
	background:
		radial-gradient(
			90% 60% at 50% 120%,
			rgba(255, 150, 70, calc(0.08 + var(--heat) * 0.34)),
			transparent 72%
		),
		linear-gradient(180deg, transparent 30%, rgba(255, 92, 52, calc(0.03 + var(--heat) * 0.14)));
	animation: cc-glow 3.4s ease-in-out infinite;
	animation-delay: calc(var(--i, 0) * -0.7s);
}
@keyframes cc-glow {
	50% {
		opacity: 0.6;
	}
}
@media (prefers-reduced-motion: reduce) {
	.cc-heat .cc-in::before {
		animation: none;
	}
}

/* The small forms: a name, a short address, and a face with its name. */
.user-addr {
	font-family: var(--mono);
	color: var(--dim);
}
.user-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
	max-width: 100%;
	vertical-align: middle;
	color: inherit;
	text-decoration: none;
}
.user-chip .av {
	flex: none;
	width: 1.6em;
	height: 1.6em;
	border-radius: 50%;
	overflow: hidden;
}
.user-chip .user-name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 650;
}
.user-chip .user-addr {
	font-size: 0.8em;
}
/* A chip is small text in a line: a finger gets a taller target without
   moving anything. */
@media (pointer: coarse) {
	a.user-chip {
		padding-block: 5px;
		margin-block: -5px;
	}
}
/* The viewer's own card: a warmer fill and edge. */
.cc.mine .cc-in {
	--edge: rgba(var(--gold-hi-rgb), 0.7);
	background: #211a0e;
}

/* The peek (user.ts): a chip's mini card on hover or keyboard focus. The
   banner across the top in the wallet's own hue until its picture lands, the
   face over its lower edge, then the name, the short address and the bio. */
.user-peek {
	position: fixed;
	z-index: 60;
	width: 280px;
	overflow: hidden;
	border-radius: var(--r-lg);
	background: var(--card);
	box-shadow:
		0 0 0 1px rgba(var(--gold-rgb), 0.22),
		0 18px 44px rgba(0, 0, 0, 0.6);
	color: var(--bone);
	font: 400 var(--t-ui) / 1.45 var(--sans);
	pointer-events: auto;
	animation: pk-in 0.18s ease-out;
}
.user-peek[hidden] {
	display: none;
}
@keyframes pk-in {
	from {
		opacity: 0;
		transform: translateY(4px);
	}
}
.pk-banner {
	position: relative;
	display: block;
	height: 84px;
	background: linear-gradient(135deg, hsl(var(--h, 40) 45% 30%), hsl(var(--h, 40) 40% 12%));
}
.pk-banner img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.user-peek .pk-av {
	position: absolute;
	top: 56px;
	left: 14px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	overflow: hidden;
	box-shadow: 0 0 0 3px var(--card);
	--av-ring: 3px;
}
.pk-body {
	display: grid;
	gap: 2px;
	padding: 32px 16px 14px;
}
.pk-name {
	font-weight: 700;
	font-size: var(--t-base);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.pk-addr {
	font: 400 var(--t-xs) var(--mono);
	color: var(--dim);
}
.pk-bio {
	margin-top: 6px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--soft);
}
@media (prefers-reduced-motion: reduce) {
	.user-peek {
		animation: none;
	}
}

/* A wallet's Discord roles (roleTags in user.ts and src/user.ts), alive the
   way Discord's gradient roles are: each name's gradient (--r1 to --r2) flows
   through it and its dot breathes. Hovered, a pill lifts, a sheen sweeps
   across it and its colors glow underneath. The first, the role that colors
   the name, is bigger and glows at rest. The pointer stays a pointer over a
   pill, whose tooltip says what earns it (roleNote). */
.roles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.role {
	position: relative;
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 11px;
	border-radius: var(--r-pill);
	--t1: color-mix(in oklab, var(--r1) 72%, white);
	--t2: color-mix(in oklab, var(--r2) 72%, white);
	font: 700 var(--t-sm) / 1.3 var(--sans);
	letter-spacing: 0.01em;
	white-space: nowrap;
	color: var(--t1);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	background:
		linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.28) 50%, transparent 62%) 160% 0
		/ 250% 100% no-repeat,
		color-mix(in oklab, var(--r1) 13%, var(--void));
	box-shadow:
		inset 0 0 0 1px color-mix(in oklab, var(--r1) 42%, transparent),
		0 0 12px -6px color-mix(in oklab, var(--r1) 45%, transparent);
	transition:
		transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3),
		box-shadow 0.3s,
		background-position 0.7s ease;
}
@supports (background-clip: text) {
	.role > span {
		background: linear-gradient(90deg, var(--t1), var(--t2), var(--t1)) 0 0 / 200% 100%;
		background-clip: text;
		-webkit-background-clip: text;
		color: transparent;
		animation: role-flow 7s linear infinite;
	}
}
.role::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: none;
	background: linear-gradient(135deg, var(--r1), var(--r2));
	animation: role-breathe 2.8s ease-in-out infinite;
	transition: transform 0.25s;
}
/* The glow under a pill, its own colors blurred, lit on hover. */
.role::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 30% 8% -35%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--r1), var(--r2));
	filter: blur(8px);
	opacity: 0;
	transform: scale(0.85);
	transition:
		opacity 0.3s,
		transform 0.3s;
	pointer-events: none;
}
@media (hover: hover) {
	.role:hover {
		transform: translateY(-2px);
		background-position:
			-60% 0,
			0 0;
		box-shadow:
			inset 0 0 0 1px color-mix(in oklab, var(--r1) 75%, transparent),
			0 8px 20px -10px color-mix(in oklab, var(--r1) 60%, transparent);
	}
	.role:hover::after {
		opacity: 0.4;
		transform: translateY(6px) scale(1);
	}
	.role:hover::before {
		transform: scale(1.3);
	}
}
.role.top {
	padding: 6px 15px;
	font-size: var(--t-note);
	box-shadow:
		inset 0 0 0 1px color-mix(in oklab, var(--r1) 60%, transparent),
		0 0 20px -8px color-mix(in oklab, var(--r1) 55%, transparent);
}
.role.top::after {
	opacity: 0.18;
	transform: translateY(4px) scale(0.95);
	animation: role-aura 3.6s ease-in-out infinite;
}
.role.top::before {
	width: 10px;
	height: 10px;
}
.role.more {
	--r1: var(--soft);
	--r2: var(--soft);
	--t1: var(--bone);
	--t2: var(--bone);
	box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--r1) 30%, transparent);
}
.role.more > span {
	animation: none;
}
.role.more::before,
.role.more::after {
	display: none;
}
@keyframes role-flow {
	to {
		background-position: 200% 0;
	}
}
@keyframes role-breathe {
	0%,
	100% {
		box-shadow: 0 0 0 0 color-mix(in oklab, var(--r1) 0%, transparent);
	}
	50% {
		box-shadow: 0 0 10px 2px color-mix(in oklab, var(--r1) 70%, transparent);
	}
}
@keyframes role-aura {
	0%,
	100% {
		opacity: 0.12;
	}
	50% {
		opacity: 0.28;
	}
}
@media (prefers-reduced-motion: reduce) {
	.role,
	.role::before,
	.role::after,
	.role > span {
		animation: none;
		transition: none;
	}
}

/* What a holder has done (honorChips in user.ts and src/user.ts): gold chips
   under the roles, each a pointer with its tooltip (lib/tip.ts) saying what
   earned it. */
.honors {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.honors li {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 0 12px;
	border-radius: var(--r-pill);
	background: rgba(var(--gold-rgb), 0.12);
	font: 600 var(--t-sm) var(--sans);
	color: var(--gold-hi);
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition:
		background-color 0.2s,
		transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@media (hover: hover) {
	.honors li:hover {
		background: rgba(var(--gold-rgb), 0.2);
		transform: translateY(-1px);
	}
}
@media (prefers-reduced-motion: reduce) {
	.honors li {
		transition: none;
	}
}
