/**
 * Crypto Live Feed — the coin widgets that are not the full board.
 *
 * They share the board's tokens, so a colour changed in one place changes all
 * of them. Declared through :where() so every value stays overridable.
 */

:where(.clf-cw) {
	--clf-brand: #fc9902;
	--clf-brand-2: #02d4fc;

	--clf-bg: #0a0d14;
	--clf-card: rgba(255, 255, 255, .04);
	--clf-text: #eef2f8;
	--clf-muted: #8892a6;
	--clf-border: rgba(255, 255, 255, .09);
	--clf-accent: var(--clf-brand);
	--clf-up: #16c784;
	--clf-down: #ea3943;
	--clf-chain: #8b95a7;

	--clf-glass: rgba(255, 255, 255, .05);
	--clf-glass-edge: rgba(255, 255, 255, .12);
	--clf-blur: 16px;

	--clf-radius: 12px;
	--clf-font-size: 13px;
	--clf-cw-speed: 40s;
	--clf-cols: 3;
}

:where(.clf-cw.clf-theme-light) {
	--clf-bg: #ffffff;
	--clf-card: rgba(15, 23, 42, .03);
	--clf-text: #0f172a;
	--clf-muted: #64748b;
	--clf-border: rgba(15, 23, 42, .1);
	--clf-glass: rgba(255, 255, 255, .65);
	--clf-glass-edge: rgba(15, 23, 42, .08);
}

:where(.clf-cw.clf-theme-auto) {
	--clf-bg: #ffffff;
	--clf-card: rgba(15, 23, 42, .03);
	--clf-text: #0f172a;
	--clf-muted: #64748b;
	--clf-border: rgba(15, 23, 42, .1);
	--clf-glass: rgba(255, 255, 255, .65);
	--clf-glass-edge: rgba(15, 23, 42, .08);
}

@media (prefers-color-scheme: dark) {
	:where(.clf-cw.clf-theme-auto) {
		--clf-bg: #0a0d14;
		--clf-card: rgba(255, 255, 255, .04);
		--clf-text: #eef2f8;
		--clf-muted: #8892a6;
		--clf-border: rgba(255, 255, 255, .09);
		--clf-glass: rgba(255, 255, 255, .05);
		--clf-glass-edge: rgba(255, 255, 255, .12);
	}
}

.clf-cw {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	color: var(--clf-text);
	background: var(--clf-bg);
	border: 1px solid var(--clf-border);
	border-radius: var(--clf-radius);
	font-size: var(--clf-font-size);
	line-height: 1.45;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

.clf-cw *,
.clf-cw *::before,
.clf-cw *::after { box-sizing: inherit; }

.clf-cw--glass {
	background: var(--clf-glass);
	border-color: var(--clf-glass-edge);
	backdrop-filter: blur(var(--clf-blur)) saturate(150%);
	-webkit-backdrop-filter: blur(var(--clf-blur)) saturate(150%);
	box-shadow: 0 0 0 1px rgba(252, 153, 2, .14), 0 16px 40px -22px rgba(2, 212, 252, .35);
	isolation: isolate;
}

.clf-cw--glass::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	background:
		radial-gradient(110% 80% at 0% 0%, rgba(252, 153, 2, .15), transparent 55%),
		radial-gradient(110% 80% at 100% 0%, rgba(2, 212, 252, .13), transparent 55%),
		var(--clf-bg);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.clf-cw--glass { background: var(--clf-bg); }
}

@media (prefers-reduced-transparency: reduce) {
	.clf-cw--glass {
		backdrop-filter: none;
		-webkit-backdrop-filter: none;
		background: var(--clf-bg);
	}
}

/* ------------------------------------------------------------------ head */

.clf-cw__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--clf-border);
}

.clf-cw__heading {
	margin: 0;
	font-size: calc(var(--clf-font-size) * 1.15);
	font-weight: 700;
	letter-spacing: -.01em;
	background: linear-gradient(100deg, var(--clf-brand), var(--clf-brand-2));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

@supports not (background-clip: text) {
	.clf-cw__heading { color: var(--clf-text); }
}

.clf-cw__live {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 8px;
	border-radius: 999px;
	background: rgba(2, 212, 252, .14);
	color: var(--clf-brand-2);
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: .08em;
}

.clf-cw__dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--clf-brand-2);
	animation: clf-cw-pulse 1.8s ease-in-out infinite;
}

@keyframes clf-cw-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: .3; }
}

.clf-cw__empty {
	padding: 22px 16px;
	text-align: center;
	color: var(--clf-muted);
	font-size: .95em;
}

/* ------------------------------------------------------------- shared bits */

.clf-cw__icon {
	flex: none;
	border-radius: 50%;
	object-fit: cover;
	background: var(--clf-card);
	box-shadow: 0 0 0 1px var(--clf-glass-edge);
}

.clf-cw__icon--empty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 800;
	text-transform: uppercase;
	color: #0a0d14;
	background: var(--clf-chain);
}

.clf-cw__sym { font-weight: 700; }
.clf-cw__px { font-variant-numeric: tabular-nums; }

.clf-cw__px sub {
	font-size: .72em;
	vertical-align: baseline;
	position: relative;
	bottom: -.25em;
}

.clf-cw__pct {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.clf-cw__pct--up { color: var(--clf-up); }
.clf-cw__pct--down { color: var(--clf-down); }
.clf-cw__pct--flat { color: var(--clf-muted); }

/* ---------------------------------------------------------------- ticker */

.clf-cw--ticker { border-radius: var(--clf-radius); }

.clf-cw__ticker {
	overflow: hidden;
	padding: 9px 0;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.clf-cw__track {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	white-space: nowrap;
	animation: clf-cw-scroll var(--clf-cw-speed) linear infinite;
	will-change: transform;
}

.clf-cw__track-copy {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.clf-cw__ticker:hover .clf-cw__track { animation-play-state: paused; }

@keyframes clf-cw-scroll {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.clf-cw__track { animation: none; }
	.clf-cw__ticker { overflow-x: auto; }
	.clf-cw__dot { animation: none; }
}

.clf-cw__chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 12px;
	border-radius: 999px;
	background: var(--clf-card);
	border: 1px solid var(--clf-border);
	color: inherit;
	text-decoration: none;
	transition: border-color .15s ease;
}

.clf-cw__chip:hover { border-color: var(--clf-brand); }

/* --------------------------------------------------------------- marquee */

.clf-cw__marquee {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 10px 14px;
	overflow-x: auto;
	white-space: nowrap;
	scrollbar-width: none;
}

.clf-cw__marquee::-webkit-scrollbar { display: none; }

.clf-cw__marquee-item {
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	flex: none;
}

/* ---------------------------------------------------------------- movers */

.clf-cw__movers {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
	background: var(--clf-border);
}

.clf-cw__movers-col {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px;
	background: var(--clf-bg);
}

.clf-cw--glass .clf-cw__movers-col { background: transparent; }

.clf-cw__movers-title {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .09em;
	text-transform: uppercase;
	padding-bottom: 8px;
	border-bottom: 2px solid currentColor;
	align-self: flex-start;
}

.clf-cw__movers-col--up .clf-cw__movers-title { color: var(--clf-up); }
.clf-cw__movers-col--down .clf-cw__movers-title { color: var(--clf-down); }

.clf-cw__mover {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.clf-cw__mover-sym {
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1 1 auto;
	min-width: 0;
}

.clf-cw__mover-px {
	color: var(--clf-muted);
	font-size: .9em;
	font-variant-numeric: tabular-nums;
	flex: none;
}

.clf-cw__mover .clf-cw__pct {
	flex: none;
	min-width: 58px;
	text-align: right;
	font-size: .92em;
}

/* ------------------------------------------------------------- spotlight */

.clf-cw__spot { padding: 18px; }

.clf-cw__spot-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.clf-cw__spot-names {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.clf-cw__spot-names a { color: inherit; text-decoration: none; }
.clf-cw__spot-names a:hover .clf-cw__spot-sym { color: var(--clf-brand); }

.clf-cw__spot-sym {
	font-size: calc(var(--clf-font-size) * 1.5);
	font-weight: 800;
	letter-spacing: -.02em;
}

.clf-cw__spot-quote {
	color: var(--clf-muted);
	font-weight: 500;
	font-size: .7em;
}

.clf-cw__spot-name {
	color: var(--clf-muted);
	font-size: .9em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.clf-cw__spot-chain {
	flex: none;
	padding: 3px 9px;
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	color: var(--clf-chain);
	border: 1px solid currentColor;
}

.clf-cw__spot-price {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.clf-cw__spot-px {
	font-size: calc(var(--clf-font-size) * 2.2);
	font-weight: 800;
	letter-spacing: -.03em;
	font-variant-numeric: tabular-nums;
}

.clf-cw__spot-px sub {
	font-size: .55em;
	vertical-align: baseline;
	position: relative;
	bottom: -.3em;
}

.clf-cw__spot-price .clf-cw__pct { font-size: calc(var(--clf-font-size) * 1.1); }

.clf-cw__spot-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
	gap: 10px;
}

.clf-cw__spot-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--clf-card);
	border: 1px solid var(--clf-border);
}

.clf-cw__spot-label {
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--clf-muted);
}

.clf-cw__spot-value {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ list */

.clf-cw__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.clf-cw__list-item {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--clf-border);
	transition: background .12s ease;
}

.clf-cw__list-item:last-child { border-bottom: 0; }
.clf-cw__list-item:hover { background: rgba(252, 153, 2, .06); }

.clf-cw__list-rank {
	flex: none;
	width: 20px;
	text-align: center;
	color: var(--clf-muted);
	font-size: 11px;
	font-weight: 700;
}

.clf-cw__list-item:nth-child(1) .clf-cw__list-rank { color: var(--clf-brand); }
.clf-cw__list-item:nth-child(2) .clf-cw__list-rank { color: var(--clf-brand-2); }

.clf-cw__list-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.clf-cw__list-body a { color: inherit; text-decoration: none; }
.clf-cw__list-body a:hover { color: var(--clf-brand); }

.clf-cw__list-chain {
	color: var(--clf-muted);
	font-size: .8em;
}

.clf-cw__list-nums {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
	flex: none;
}

.clf-cw__list-nums .clf-cw__pct { font-size: .85em; }

/* ----------------------------------------------------------------- stats */

.clf-cw__stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 10px;
	padding: 14px;
}

.clf-cw__stat {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 13px 15px;
	border-radius: 11px;
	background: var(--clf-card);
	border: 1px solid var(--clf-border);
	position: relative;
	overflow: hidden;
}

.clf-cw__stat::after {
	content: "";
	position: absolute;
	inset: auto auto 0 0;
	width: 100%;
	height: 2px;
	background: linear-gradient(90deg, var(--clf-brand), var(--clf-brand-2));
}

.clf-cw__stat-label {
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--clf-muted);
}

.clf-cw__stat-value {
	font-size: calc(var(--clf-font-size) * 1.35);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.02em;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 782px) {
	:where(.clf-cw) { --clf-blur: 10px; }
	.clf-cw__spot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.clf-cw__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
	.clf-cw__movers { grid-template-columns: 1fr; }
	.clf-cw__spot-px { font-size: calc(var(--clf-font-size) * 1.8); }
	.clf-cw__spot { padding: 14px; }
	.clf-cw__stats { grid-template-columns: 1fr; }
	.clf-cw__list-chain { display: none; }
}
