/* ═══════════════════════════════════════════════════════
   TRENFEED — .25-1000 SOL
   Clean, warm, readable. No terminal, no trench.
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ── */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	-webkit-text-size-adjust: 100%;
}

body {
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	background: #f7f5f0;
	color: #2d2a24;
	line-height: 1.5;
	min-height: 100vh;
	overflow-x: hidden;
}

/* ── Layout ── */
#app {
	max-width: 1040px;
	margin: 0 auto;
	padding: 20px 24px 32px;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#race-details {
	background: rgba(10, 11, 12, 0.72);
	border: 1px solid var(--race-border-soft);
	border-radius: 8px;
	overflow: hidden;
}

#race-details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 42px;
	padding: 9px 13px;
	color: #d9dddf;
	cursor: pointer;
	font-family: var(--race-display);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	list-style: none;
	text-transform: uppercase;
}

#race-details > summary::-webkit-details-marker { display: none; }
#race-details > summary::after {
	content: "+";
	margin-left: 14px;
	color: var(--race-muted);
	font-family: var(--race-mono);
	font-size: 16px;
	font-weight: 400;
}
#race-details[open] > summary::after { content: "−"; }
#race-details > summary small {
	margin-left: auto;
	color: var(--race-faint);
	font-size: 10px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: none;
}
#race-details > .bottom-grid {
	margin: 0 10px 10px;
}
#race-details > #trade-tape {
	margin: 0 10px 10px;
}

/* ── Header ── */
#header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 16px 0 8px;
}

.brand-group {
	display: flex;
	align-items: center;
	gap: 12px;
	color: inherit;
	text-decoration: none;
}
.brand-logo {
	height: 32px;
	width: auto;
	display: block;
}

.brand-range {
	font-size: 18px;
	font-weight: 600;
	color: #e85d3a;
	margin-left: 12px;
	letter-spacing: 0;
}

.header-right {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
	color: #8a857a;
}

.charts-link {
	color: #5d5950;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 140ms ease;
}

.charts-link::before {
	content: "\2190";
	margin-right: 6px;
}

.charts-link:hover,
.charts-link:focus-visible {
	color: #171512;
}

.header-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #4caf50;
}

.header-dot.offline {
	background: #bdb9ae;
}

/* ── Flagship Bar ── */
#flagship-bar {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #e4e0d6;
	border-radius: 10px;
	font-size: 13px;
}

.flagship-label {
	font-weight: 600;
	color: #8a857a;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-right: 4px;
}

.flagship-stat {
	display: flex;
	align-items: center;
	gap: 4px;
	color: #5d5950;
}

.flagship-stat strong {
	font-weight: 600;
	color: #2d2a24;
}

.flagship-stat .positive {
	color: #e85d3a;
}

.flagship-stat .negative {
	color: #e85d3a;
}

/* ── Main Two-Column Grid ── */
.main-grid {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 12px;
	flex: 1;
	min-height: 0;
}

/* ── Card ── */
.card {
	background: #fff;
	border: 1px solid #e4e0d6;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

#leaderboard {
	scroll-margin-top: 12px;
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px 8px;
	border-bottom: 1px solid #f0ede6;
}

.card-title {
	font-size: 14px;
	font-weight: 600;
	color: #8a857a;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.card-sub {
	font-size: 12px;
	color: #bdb9ae;
}

.card-body {
	flex: 1;
	padding: 0;
	overflow-y: auto;
}

/* ── Table Header ── */
.table-header {
	display: grid;
	grid-template-columns: 36px 1fr 86px 72px 90px;
	gap: 0;
	padding: 10px 16px 6px;
	font-size: 11px;
	font-weight: 600;
	color: #bdb9ae;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-bottom: 1px solid #f0ede6;
}

.th-rank {
	text-align: center;
}
.th-name {
	text-align: left;
}
.th-equity {
	text-align: right;
}
.th-return {
	text-align: right;
}
.th-trades {
	text-align: right;
}

/* ── Racer Row ── */
.racer-row {
	display: grid;
	grid-template-columns: 36px 1fr 86px 72px 90px;
	gap: 0;
	padding: 12px 16px;
	border-bottom: 1px solid #f5f3ee;
	font-size: 14px;
	transition: background 0.15s;
	align-items: center;
}

.racer-row:last-child {
	border-bottom: none;
}

.racer-row:hover {
	background: #faf9f6;
}

.racer-row.primary {
	background: #fefaf6;
	border-left: 3px solid #e85d3a;
}

.rr-rank {
	font-weight: 700;
	font-size: 16px;
	color: #bdb9ae;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.racer-row.top-1 .rr-rank {
	color: #e85d3a;
}
.racer-row.top-2 .rr-rank {
	color: #8a857a;
}
.racer-row.top-3 .rr-rank {
	color: #b0a99a;
}

.rr-name {
	font-weight: 600;
	color: #2d2a24;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rr-name .benchmark-tag {
	font-size: 10px;
	font-weight: 500;
	color: #bdb9ae;
	margin-left: 6px;
}

.rr-equity {
	text-align: right;
	color: #5d5950;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.rr-return {
	text-align: right;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.rr-return.positive {
	color: #e85d3a;
}
.rr-return.negative {
	color: #8a857a;
}

.rr-trades {
	text-align: right;
	color: #8a857a;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.rankings-empty {
	padding: 40px 16px;
	text-align: center;
	color: #bdb9ae;
	font-size: 14px;
}

/* ── Your Run Panel ── */
#your-run {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.run-summary {
	padding: 16px;
	text-align: center;
	border-bottom: 1px solid #f0ede6;
}

.run-balance {
	font-size: 38px;
	font-weight: 700;
	letter-spacing: -0.03em;
	color: #2d2a24;
	line-height: 1;
}

.run-balance-sol {
	font-size: 18px;
	font-weight: 500;
	color: #8a857a;
}

.run-return {
	font-size: 20px;
	font-weight: 600;
	margin-top: 2px;
}

.run-return.positive {
	color: #e85d3a;
}
.run-return.negative {
	color: #8a857a;
}

.run-stats {
	display: flex;
	justify-content: center;
	gap: 16px;
	padding: 10px 16px;
	border-bottom: 1px solid #f0ede6;
	font-size: 12px;
}

.run-stat {
	text-align: center;
}

.run-stat strong {
	display: block;
	font-weight: 700;
	font-size: 16px;
	color: #2d2a24;
}

.run-stat span {
	color: #8a857a;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.run-cta {
	margin: 12px 16px;
	padding: 10px;
	border: none;
	border-radius: 8px;
	background: #2d2a24;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s;
	font-family: inherit;
}

.run-cta:hover {
	background: #3d3932;
}

/* ── Ladder ── */
#ladder {
	padding: 12px 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 80px;
}

.ladder-title {
	font-size: 10px;
	font-weight: 600;
	color: #bdb9ae;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 8px;
	text-align: center;
}

.ladder-track {
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
	padding: 4px 0;
}

.ladder-track::before {
	content: "";
	position: absolute;
	left: 10px;
	right: 10px;
	top: 50%;
	height: 2px;
	background: #e4e0d6;
	transform: translateY(-50%);
	z-index: 0;
}

.ladder-dot {
	position: relative;
	z-index: 1;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f0ede6;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 700;
	color: #bdb9ae;
	cursor: default;
	transition: all 0.3s;
}

.ladder-dot.reached {
	background: #2d2a24;
	color: #fff;
}

.ladder-dot.current {
	background: #e85d3a;
	color: #fff;
	box-shadow: 0 0 0 3px rgba(232, 93, 58, 0.2);
	transform: scale(1.1);
}

.ladder-labels {
	display: flex;
	justify-content: space-between;
	margin-top: 4px;
	font-size: 9px;
	color: #bdb9ae;
	padding: 0 2px;
}

.ladder-labels span {
	text-align: center;
	width: 28px;
}

/* ── Bottom Two-Column Grid ── */
.bottom-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* ── Activity (Field Report) ── */
.activity-empty {
	padding: 24px 16px;
	text-align: center;
	color: #bdb9ae;
	font-size: 13px;
}

.activity-row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	padding: 8px 16px;
	font-size: 13px;
	border-bottom: 1px solid #f5f3ee;
}

.activity-row:last-child {
	border-bottom: none;
}

.activity-time {
	font-weight: 500;
	color: #bdb9ae;
	white-space: nowrap;
	font-size: 11px;
	flex-shrink: 0;
}

.activity-text {
	color: #5d5950;
	word-break: break-word;
}

/* ── Achievements ── */
.achievement-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px;
	border-bottom: 1px solid #f5f3ee;
	font-size: 13px;
}

.achievement-row:last-child {
	border-bottom: none;
}

.achievement-icon {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 600;
}

.achievement-icon.earned {
	background: #2d2a24;
	color: #fff;
}

.achievement-icon.locked {
	background: #f0ede6;
	color: #bdb9ae;
}

.achievement-info {
	flex: 1;
}

.achievement-name {
	font-weight: 600;
	color: #2d2a24;
	font-size: 13px;
}

.achievement-desc {
	font-size: 11px;
	color: #8a857a;
}

.achievement-empty {
	padding: 24px 16px;
	text-align: center;
	color: #bdb9ae;
	font-size: 13px;
}

/* ── Footer Strip ── */
#footer-strip {
	padding: 10px 14px;
	background: #fff;
	border: 1px solid #e4e0d6;
	border-radius: 10px;
	font-size: 12px;
	color: #8a857a;
	text-align: center;
}

#footer-strip strong {
	color: #2d2a24;
}

/* ── Modal ── */
#register-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(45, 42, 36, 0.5);
	z-index: 100;
	display: none;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(4px);
}

#register-modal.open {
	display: flex;
}

.modal-panel {
	background: #fff;
	border-radius: 14px;
	padding: 28px;
	width: 360px;
	max-width: 90vw;
	position: relative;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 22px;
	color: #8a857a;
	cursor: pointer;
}

.modal-panel h2 {
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 16px;
	color: #2d2a24;
}

.modal-panel label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #8a857a;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
	margin-top: 12px;
}

.modal-panel input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #e4e0d6;
	border-radius: 8px;
	font-size: 14px;
	color: #2d2a24;
	background: #f7f5f0;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s;
}

.modal-panel input:focus {
	border-color: #2d2a24;
}

#reg-status {
	margin-top: 12px;
	font-size: 12px;
	font-weight: 600;
	color: #e85d3a;
	min-height: 1em;
}

#reg-submit {
	width: 100%;
	margin-top: 16px;
	padding: 11px;
	border: none;
	border-radius: 8px;
	background: #2d2a24;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
}

#reg-submit:hover {
	background: #3d3932;
}

/* ── Registration Steps ── */
.reg-step {
	display: block;
}

.reg-subtitle {
	font-size: 12px;
	font-weight: 600;
	color: #8a857a;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f0ede6;
}

#reg-verify,
#reg-submit {
	width: 100%;
	margin-top: 16px;
	padding: 11px;
	border: none;
	border-radius: 8px;
	background: #2d2a24;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s;
}

#reg-verify:hover,
#reg-submit:hover {
	background: #3d3932;
}

#reg-verify:disabled,
#reg-submit:disabled {
	background: #c4bfb4;
	cursor: default;
}

#reg-verify-status,
#reg-submit-status {
	margin-top: 12px;
	font-size: 12px;
	font-weight: 600;
	color: #e85d3a;
	min-height: 1em;
}

.reg-ok {
	color: #2d8a4a;
}

/* ── Responsive ── */
@media (max-width: 720px) {
	#app {
		padding: 12px 16px;
		gap: 10px;
	}

	.main-grid {
		grid-template-columns: 1fr;
	}

	.bottom-grid {
		grid-template-columns: 1fr;
	}

	#header {
		flex-direction: column;
		gap: 4px;
		padding: 10px 0 4px;
	}

	.brand-main {
		font-size: 22px;
	}

	.brand-range {
		font-size: 15px;
		margin-left: 0;
	}

	.header-right {
		font-size: 12px;
	}

	.racer-row {
		grid-template-columns: 28px 1fr 64px 54px 70px;
		padding: 10px 12px;
		font-size: 13px;
	}

	.table-header {
		grid-template-columns: 28px 1fr 64px 54px 70px;
		padding: 8px 12px;
		font-size: 10px;
	}

	.rr-rank {
		font-size: 14px;
	}

	.run-balance {
		font-size: 30px;
	}

	#flagship-bar {
		flex-wrap: wrap;
		gap: 8px;
		padding: 8px 12px;
		font-size: 12px;
	}
}

/* ── Stats Bar ── */
#stats-bar {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 8px 14px;
	background: #fff;
	border: 1px solid #e4e0d6;
	border-radius: 10px;
	font-size: 12px;
}

.stat-item {
	display: flex;
	align-items: center;
	gap: 4px;
	color: #5d5950;
}

.stat-item strong {
	font-weight: 700;
	color: #2d2a24;
	font-size: 14px;
}

.stat-divider {
	width: 1px;
	height: 14px;
	background: #e4e0d6;
}

/* ── Tabs ── */
.tabs {
	display: flex;
	border-bottom: 1px solid #f0ede6;
	padding: 0;
}
.tab {
	padding: 10px 16px 8px;
	font-size: 12px;
	font-weight: 600;
	color: #bdb9ae;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	transition: all 0.15s;
	user-select: none;
}
.tab:hover {
	color: #8a857a;
}
.tab.active {
	color: #2d2a24;
	border-bottom-color: #2d2a24;
}
.tab-count {
	font-size: 10px;
	font-weight: 700;
	background: #f0ede6;
	color: #8a857a;
	border-radius: 8px;
	padding: 1px 6px;
	margin-left: 4px;
	vertical-align: middle;
}
.tab.active .tab-count {
	background: #e4e0d6;
	color: #2d2a24;
}

/* ── Tier Badges ── */
.badge {
	display: inline-block;
	padding: 1px 5px;
	border-radius: 4px;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.03em;
	vertical-align: middle;
	margin-left: 4px;
	line-height: 1.4;
}
.badge-cert {
	background: #2d2a24;
	color: #fff;
}
.badge-sf {
	background: #e85d3a;
	color: #fff;
}

.row-cert {
	border-left: 3px solid #2d2a24;
}
.row-sf {
	border-left: 3px solid #e85d3a;
}

/* ── Tabs responsive ── */
@media (max-width: 720px) {
	.tab {
		padding: 8px 10px 6px;
		font-size: 10px;
	}
	.tab-count {
		font-size: 9px;
		padding: 0 4px;
	}
	#stats-bar {
		font-size: 10px;
		gap: 8px;
		padding: 6px 10px;
	}
	.stat-item strong {
		font-size: 12px;
	}
}

/* Launch polish: editorial hierarchy with telemetry reserved for the numbers. */
#war-bg {
	opacity: 0.48;
}

#war-bg-overlay {
	background:
		linear-gradient(180deg, rgba(8, 9, 10, 0.32), rgba(8, 9, 10, 0.82)),
		radial-gradient(circle at 50% 0%, transparent, rgba(8, 9, 10, 0.42) 72%);
}

#race-stage::before {
	opacity: 0.28;
}

#race-stage,
.card {
	border-radius: 10px;
}

.product-nav {
	border-radius: 999px;
	padding: 3px;
}

.product-nav-link {
	border-radius: 999px;
}

.stage-kicker,
.hero-label,
.flight-key,
.card-title,
.tab,
.table-header,
.run-stat span,
.ladder-title,
.contract-label,
.contract-state,
#contract-copy,
.run-cta,
#reg-submit {
	font-family: var(--race-display);
	letter-spacing: 0.055em;
}

.rr-name,
.card-sub,
.rankings-empty,
.activity-empty,
.achievement-empty {
	font-family: var(--race-display);
}

.hero-label::before {
	width: 10px;
	box-shadow: none;
}

.hero-cell {
	padding-top: 24px;
	padding-bottom: 22px;
}

/* ── Canvas War Background ── */
#war-bg-overlay {
	position: fixed;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(
		180deg,
		rgba(10, 4, 2, 0.2) 0%,
		rgba(10, 4, 2, 0.08) 40%,
		rgba(8, 3, 1, 0.12) 65%,
		rgba(6, 2, 1, 0.3) 100%
	);
}

#war-bg {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	z-index: 0;
	display: block;
	pointer-events: none;
	touch-action: none;
}

#app {
	position: relative;
	z-index: 2;
}

/* ── Beat #1 Cell ── */
.hero-beat .hero-number {
  font-size: 24px;
  color: #e8b080;
}
.hero-beat .hero-sub {
  font-size: 11px;
  color: rgba(255, 200, 150, 0.4);
}

/* ── Mini Sparkline ── */
#fs-sparkline {
  display: block;
  width: 100%;
  max-width: 200px;
  height: 36px;
  margin: 2px auto 0;
  border-radius: 2px;
  opacity: 0.75;
}

/* ── Trade Flash Animation ── */
@keyframes trade-flash {
  0% { background: rgba(255, 180, 80, 0.25); }
  100% { background: transparent; }
}
.h-flash.flash-win {
  animation: trade-flash 0.8s ease-out;
}
@keyframes trade-flash-loss {
  0% { background: rgba(200, 60, 40, 0.25); }
  100% { background: transparent; }
}
.h-flash.flash-loss {
  animation: trade-flash-loss 0.8s ease-out;
}

/* ── Rank Delta Arrows ── */
.rank-arrow {
  display: inline-block;
  width: 16px;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}
.rank-arrow.up { color: #b08050; }
.rank-arrow.down { color: #804030; }
.rank-arrow.same { color: rgba(255, 200, 150, 0.2); }

/* ── Leaderboard rank cell ── */
.th-rank { width: 36px; }
.rank-cell { display: flex; align-items: center; gap: 2px; }

/* ── Trade Tape ── */
#trade-tape {
  height: 28px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(255, 180, 100, 0.06);
  border-bottom: 1px solid rgba(255, 180, 100, 0.06);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
}
#tape-items {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  animation: scroll-tape 30s linear infinite;
  font-size: 12px;
  color: rgba(255, 220, 180, 0.6);
  font-variant-numeric: tabular-nums;
}
@keyframes scroll-tape {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.tape-item {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}
.tape-item .tape-type {
  color: rgba(255, 180, 100, 0.5);
  font-size: 10px;
  text-transform: uppercase;
}
.tape-item .tape-pnl.pos { color: #b08050; }
.tape-item .tape-pnl.neg { color: #804030; }
.tape-item .tape-name { color: rgba(255, 220, 180, 0.8); font-weight: 600; }

/* ═══════════════════════════════════════════════════════
   WALLET RACE / LAUNCH SYSTEM
   Graphite telemetry, live flight paths, dense data layout
   ═══════════════════════════════════════════════════════ */
:root {
	--race-bg: #08090a;
	--race-panel: rgba(15, 17, 18, 0.92);
	--race-panel-solid: #0f1112;
	--race-border: rgba(255, 255, 255, 0.1);
	--race-border-soft: rgba(255, 255, 255, 0.055);
	--race-text: #f0f2f3;
	--race-muted: #8d9498;
	--race-faint: #555b5f;
	--race-positive: #82d6a0;
	--race-negative: #d97878;
	--race-display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif;
	--race-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html {
	background: var(--race-bg);
	color-scheme: dark;
}

body {
	background: var(--race-bg);
	color: var(--race-text);
	font-family: var(--race-display);
	letter-spacing: 0.005em;
}

#war-bg-overlay {
	z-index: 1;
	background:
		linear-gradient(180deg, rgba(8, 9, 10, 0.08) 0%, rgba(8, 9, 10, 0.16) 48%, rgba(8, 9, 10, 0.72) 100%),
		radial-gradient(circle at 50% 2%, transparent 0%, rgba(8, 9, 10, 0.12) 58%, rgba(8, 9, 10, 0.45) 100%);
}

#app {
	max-width: 1180px;
	padding: 12px 24px 28px;
	gap: 10px;
}

#header {
	align-items: center;
	min-height: 46px;
	padding: 5px 0;
	border-bottom: 1px solid var(--race-border-soft);
}

.brand-logo {
	height: 28px;
	filter: grayscale(1) invert(1) brightness(1.45);
	opacity: 0.9;
}

.brand-range {
	margin-left: 4px;
	color: #a9afb2;
	font-family: var(--race-mono);
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.1em;
}

.header-right {
	color: var(--race-muted);
	font-family: var(--race-mono);
	font-size: 11px;
}

.charts-link {
	color: #d5d9db;
	font-size: 10px;
}

.charts-link:hover,
.charts-link:focus-visible {
	color: #fff;
}

.product-nav {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 2px;
	border: 1px solid var(--race-border-soft);
	background: rgba(255, 255, 255, 0.025);
}

.product-nav-link {
	padding: 5px 8px;
	color: var(--race-muted);
	font-family: var(--race-mono);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	transition: background 140ms ease, color 140ms ease;
}

.product-nav-link:hover,
.product-nav-link:focus-visible {
	color: #fff;
	outline: none;
}

.product-nav-link:focus-visible {
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.product-nav-link.is-active {
	background: #e7e9ea;
	color: #0a0b0c;
}

.header-dot {
	width: 6px;
	height: 6px;
	background: var(--race-positive);
	box-shadow: 0 0 10px rgba(130, 214, 160, 0.7);
}

#race-stage {
	position: relative;
	min-height: 252px;
	overflow: hidden;
	background: linear-gradient(110deg, rgba(12, 14, 15, 0.7), rgba(15, 17, 18, 0.36));
	border: 1px solid var(--race-border);
	border-radius: 4px;
	box-shadow: 0 18px 52px rgba(0, 0, 0, 0.26);
	backdrop-filter: blur(8px);
}

#race-stage::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
		linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
	background-size: 48px 48px;
	mask-image: linear-gradient(90deg, #000, transparent 85%);
}

.stage-kicker {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px 9px;
	border-bottom: 1px solid var(--race-border-soft);
	color: var(--race-faint);
	font-family: var(--race-mono);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.stage-kicker i {
	display: inline-block;
	width: 5px;
	height: 5px;
	margin-right: 7px;
	background: var(--race-positive);
	border-radius: 50%;
	box-shadow: 0 0 8px rgba(130, 214, 160, 0.7);
}

#hero-strip {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1.45fr) 1px minmax(0, 0.8fr);
	align-items: stretch;
	min-height: 208px;
}

.hero-cell {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 0;
	padding: 20px 24px 18px;
}

.hero-flagship {
	background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0));
}

.hero-divider {
	width: 1px;
	margin: 18px 0;
	background: linear-gradient(transparent, rgba(255,255,255,0.14), transparent);
}

.hero-label {
	margin-bottom: 8px;
	color: var(--race-muted);
	font-family: var(--race-mono);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.hero-number,
.hero-beat .hero-number {
	max-width: 100%;
	color: var(--race-text);
	font-family: var(--race-display);
	font-size: clamp(36px, 4.5vw, 64px);
	font-stretch: condensed;
	font-weight: 750;
	letter-spacing: -0.055em;
	line-height: 0.92;
	white-space: nowrap;
	font-variant-numeric: tabular-nums lining-nums;
	text-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
}

.hero-flagship .hero-number {
	font-size: clamp(50px, 6.4vw, 84px);
}

.hero-beat .hero-number {
	font-size: clamp(28px, 3.1vw, 45px);
}

.hero-unit {
	margin-left: 3px;
	color: #878e92;
	font-family: var(--race-mono);
	font-size: 0.25em;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.hero-sub {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 19px;
	margin-top: 10px;
	color: #a7adb0;
	font-family: var(--race-mono);
	font-size: 10px;
	font-variant-numeric: tabular-nums;
}

.hero-dot {
	width: 3px;
	height: 3px;
	background: #4e5457;
	border-radius: 50%;
}

.flight-key {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 16px;
	color: var(--race-faint);
	font-family: var(--race-mono);
	font-size: 8px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.flight-key span {
	display: block;
	width: 22px;
	height: 1px;
	background: #858b8f;
	box-shadow: 0 0 8px rgba(255,255,255,0.25);
}

.leader-key span {
	background: #edf0f1;
}

#fs-sparkline {
	width: 100%;
	max-width: 480px;
	height: 44px;
	margin: 8px 0 -5px;
	opacity: 0.82;
}

.card {
	background: var(--race-panel);
	border: 1px solid var(--race-border);
	border-radius: 4px;
	box-shadow: 0 12px 32px rgba(0,0,0,0.18);
	backdrop-filter: blur(8px);
}

.card-header,
.tabs,
.table-header,
.run-summary,
.run-stats {
	border-color: var(--race-border-soft);
}

.card-title,
.tab.active {
	color: var(--race-text);
}

.card-title,
.table-header,
.tab,
.run-stat span,
.ladder-title {
	font-family: var(--race-mono);
	letter-spacing: 0.08em;
}

.card-sub,
.tab,
.table-header,
.rr-trades,
.run-stat span,
.ladder-title,
.rankings-empty,
.activity-empty,
.achievement-empty {
	color: var(--race-muted);
}

.tab.active {
	border-bottom-color: #eef1f2;
}

.tab-count,
.tab.active .tab-count {
	background: #222527;
	color: #c4c9cb;
}

.table-header,
.racer-row {
	grid-template-columns: 36px 18px minmax(120px, 1fr) 90px 86px 108px;
}

.th-rank {
	grid-column: 1 / span 2;
}

.racer-row {
	border-color: var(--race-border-soft);
	color: var(--race-text);
}

.racer-row:hover {
	background: rgba(255,255,255,0.035);
}

.racer-row.primary {
	background: rgba(255,255,255,0.045);
	border-left-color: #eef1f2;
}

.rr-name,
.rr-equity,
.run-balance,
.run-stat strong {
	color: var(--race-text);
}

.rr-rank {
	color: var(--race-faint);
}

.racer-row.top-1 .rr-rank,
.racer-row.top-2 .rr-rank,
.racer-row.top-3 .rr-rank {
	color: #dce0e2;
}

.rr-equity,
.rr-return,
.rr-trades,
.run-balance,
.run-return,
.run-stat strong {
	font-family: var(--race-mono);
	font-variant-numeric: tabular-nums;
}

.rr-return.positive,
.run-return.positive,
.rank-arrow.up {
	color: var(--race-positive);
}

.rr-return.negative,
.run-return.negative,
.rank-arrow.down {
	color: var(--race-negative);
}

.run-cta,
#reg-verify,
#reg-submit {
	background: #eceff0;
	color: #090a0b;
	border-radius: 3px;
	text-transform: uppercase;
	font-family: var(--race-mono);
	font-size: 11px;
	letter-spacing: 0.08em;
}

.run-cta:hover,
#reg-verify:hover,
#reg-submit:hover {
	background: #fff;
}

.ladder-dot {
	background: #1a1c1e;
	border-color: #303437;
	color: #747b7f;
}

.ladder-dot.reached,
.ladder-dot.current {
	background: #edf0f1;
	border-color: #fff;
	color: #090a0b;
}

#trade-tape,
#footer-strip {
	background: rgba(10,11,12,0.88);
	border-color: var(--race-border-soft);
	color: var(--race-muted);
}

#tape-items {
	color: #aeb4b7;
}

.tape-item .tape-name {
	color: #edf0f1;
}

.tape-item .tape-type,
.tape-item .tape-pnl.pos {
	color: var(--race-positive);
}

.tape-item .tape-pnl.neg {
	color: var(--race-negative);
}

@media (max-width: 820px) {
	#app {
		padding: 10px 14px 24px;
	}

	#race-stage {
		min-height: 0;
	}

	#hero-strip {
		grid-template-columns: 1fr 1px 1.2fr;
		min-height: 190px;
	}

	.hero-beat,
	#hero-strip > .hero-divider:nth-of-type(4) {
		display: none;
	}

	.hero-cell {
		padding: 18px;
	}

	.hero-number {
		font-size: clamp(31px, 6vw, 46px);
	}

	.hero-flagship .hero-number {
		font-size: clamp(42px, 8vw, 60px);
	}
}

@media (max-width: 720px) {
	#header {
		flex-direction: row;
		gap: 8px;
	}

	.brand-range {
		display: none;
	}

	.header-right {
		gap: 8px;
	}

	#sol-price {
		display: none;
	}

	.product-nav-link {
		padding: 5px 6px;
		font-size: 8px;
	}

	.stage-kicker span:last-child {
		display: none;
	}

	#hero-strip {
		display: block;
	}

	.hero-divider,
	.hero-beat {
		display: none !important;
	}

	.hero-cell {
		padding: 15px 16px;
	}

	.hero-market {
		min-height: 115px;
		border-bottom: 1px solid var(--race-border-soft);
	}

	.hero-flagship {
		min-height: 170px;
	}

	.hero-number,
	.hero-flagship .hero-number {
		font-size: clamp(43px, 14vw, 62px);
	}

	.flight-key {
		display: none;
	}

	.main-grid,
	.bottom-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.table-header,
	.racer-row {
		grid-template-columns: 28px 14px minmax(88px, 1fr) 76px 67px;
	}

	.th-equity,
	.rr-equity {
		display: none;
	}

	.table-header,
	.racer-row {
		padding-left: 10px;
		padding-right: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#tape-items,
	.h-flash.flash-win,
	.h-flash.flash-loss {
		animation: none;
	}
}

/* Market masthead: priority telemetry + official contract rail */
#race-stage {
	display: flex;
	flex-direction: column;
}

#hero-strip {
	flex: 1;
	min-height: 198px;
}

.hero-market,
.hero-flagship {
	isolation: isolate;
}

.hero-market::after,
.hero-flagship::after {
	content: "";
	position: absolute;
	inset: 12% 8%;
	z-index: -1;
	pointer-events: none;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.07), transparent 66%);
	filter: blur(18px);
	opacity: 0.7;
}

.hero-number,
.hero-beat .hero-number {
	text-wrap: nowrap;
	filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
}

.hero-market .hero-number {
	font-size: clamp(46px, 5.4vw, 74px);
}

.hero-flagship .hero-number {
	font-size: clamp(58px, 7vw, 92px);
}

.hero-label {
	display: flex;
	align-items: center;
	gap: 8px;
}

.hero-label::before {
	content: "";
	width: 16px;
	height: 1px;
	background: #d8dcde;
	box-shadow: 0 0 8px rgba(255, 255, 255, 0.28);
}

.contract-rail {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 18px;
	min-height: 56px;
	padding: 9px 12px 9px 16px;
	background: rgba(7, 8, 9, 0.84);
	border-top: 1px solid rgba(255, 255, 255, 0.09);
	box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.18);
}

.contract-ident {
	display: flex;
	align-items: center;
	gap: 11px;
	white-space: nowrap;
}

.contract-label,
.contract-state,
#contract-copy {
	font-family: var(--race-mono);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.11em;
	text-transform: uppercase;
}

.contract-label {
	color: #dfe3e5;
}

.contract-state {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #676e72;
}

.contract-state i {
	width: 5px;
	height: 5px;
	background: #62686b;
	border-radius: 50%;
}

.contract-rail.is-live .contract-state {
	color: var(--race-positive);
}

.contract-rail.is-live .contract-state i {
	background: var(--race-positive);
	box-shadow: 0 0 9px rgba(130, 214, 160, 0.75);
}

#contract-address {
	min-width: 0;
	overflow: hidden;
	color: #8e969a;
	font-family: var(--race-mono);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.025em;
	text-align: center;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.contract-rail.is-live #contract-address {
	color: #f0f2f3;
}

#contract-copy {
	min-width: 84px;
	padding: 9px 12px;
	color: #0a0b0c;
	background: #edf0f1;
	border: 1px solid #fff;
	border-radius: 2px;
	cursor: pointer;
}

#contract-copy:hover:not(:disabled),
#contract-copy:focus-visible:not(:disabled) {
	background: #fff;
	box-shadow: 0 0 20px rgba(255, 255, 255, 0.13);
}

#contract-copy:disabled {
	color: #62686c;
	background: #151719;
	border-color: #292d30;
	cursor: not-allowed;
}

@media (max-width: 720px) {
	.contract-rail {
		grid-template-columns: 1fr auto;
		gap: 7px 12px;
		padding: 11px 12px;
	}

	.contract-ident {
		grid-column: 1;
	}

	#contract-address {
		grid-column: 1;
		text-align: left;
		font-size: 11px;
	}

	#contract-copy {
		grid-column: 2;
		grid-row: 1 / span 2;
	}
}

/* Final launch polish: human-facing labels, restrained telemetry texture. */
#war-bg { opacity: 0.48; }
#war-bg-overlay {
	background:
		linear-gradient(180deg, rgba(8, 9, 10, 0.32), rgba(8, 9, 10, 0.82)),
		radial-gradient(circle at 50% 0%, transparent, rgba(8, 9, 10, 0.42) 72%);
}
#race-stage::before { opacity: 0.28; }
#race-stage, .card { border-radius: 10px; }
.product-nav { border-radius: 4px; padding: 2px; }
.product-nav-link { border-radius: 2px; }
.stage-kicker,
.hero-label,
.flight-key,
.card-title,
.tab,
.table-header,
.run-stat span,
.ladder-title,
.contract-label,
.contract-state,
#contract-copy,
.run-cta,
#reg-submit {
	font-family: var(--race-display);
	letter-spacing: 0.055em;
}
.rr-name,
.card-sub,
.rankings-empty,
.activity-empty,
.achievement-empty { font-family: var(--race-display); }
.product-nav-link,
.stage-kicker,
.hero-label,
.hero-sub,
.flight-key,
.tab,
.table-header,
.contract-label,
.contract-state,
#contract-copy,
.card-sub,
.run-stat span,
.ladder-title {
	font-size: 11px;
}
.tab-count,
.ladder-dot,
#race-details > summary small {
	font-size: 11px;
}
.hero-label::before { width: 10px; box-shadow: none; }
.hero-cell { padding-top: 24px; padding-bottom: 22px; }

@media (max-width: 900px) {
	.table-header,
	.racer-row {
		grid-template-columns: 28px 14px minmax(90px, 1fr) 76px 68px;
	}
	.th-equity,
	.rr-equity {
		display: none;
	}
}
