/* Carbon Mile website styles */

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--bg: #0b0d11;
	--bg2: #11151b;
	--panel: #161b23;
	--line: rgba(255, 255, 255, 0.08);
	--text: #e8edf4;
	--muted: #96a2b3;
	--accent: #37c0ff;
	--accentDeep: #22448e;
	--ok: #5ee6a0;
	--bad: #ff6b81;
	--gold: #ffd469;
	--radius: 14px;
	/* Noto Color Emoji covers newer emoji (like the 2021 wheel) that Windows 10's own emoji font lacks */
	--display: 'Chakra Petch', 'Noto Color Emoji', 'Segoe UI', sans-serif;
	--body: 'Inter', 'Noto Color Emoji', 'Segoe UI', system-ui, sans-serif;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 72px;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--accent);
	text-decoration: none;
}

img {
	display: block;
	max-width: 100%;
}

[hidden] {
	display: none !important;
}

kbd {
	font-family: var(--display);
	font-size: 0.85em;
	padding: 1px 7px;
	border: 1px solid var(--line);
	border-bottom-width: 2px;
	border-radius: 6px;
	background: var(--panel);
}

.wrap {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 16px;
}

/* Nav */
.nav {
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 50;
	background: rgba(11, 13, 17, 0.72);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}

.navInner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 64px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--text);
	font-family: var(--display);
	font-weight: 700;
	letter-spacing: 2px;
}

.brand img {
	border-radius: 8px;
}

.navLinks {
	display: flex;
	align-items: center;
	gap: 24px;
}

.navLinks a {
	color: var(--muted);
	font-weight: 500;
	transition: color 0.2s;
}

.navLinks a:hover {
	color: var(--text);
}

.navLinks .navCta {
	color: var(--bg);
	background: var(--accent);
	padding: 7px 16px;
	border-radius: 999px;
	font-weight: 600;
}

.navLinks .navCta:hover {
	color: var(--bg);
	filter: brightness(1.1);
}

/* Hero */
.hero {
	position: relative;
	min-height: min(92vh, 820px);
	display: flex;
	align-items: center;
	overflow: hidden;
	/* Carbon weave shows until the video loads */
	background:
		linear-gradient(45deg, #15181d 25%, transparent 25%, transparent 75%, #15181d 75%) 0 0 / 8px 8px,
		linear-gradient(45deg, #15181d 25%, transparent 25%, transparent 75%, #15181d 75%) 4px 4px / 8px 8px,
		#0e1014;
}

.heroVideo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* The clip has its own logo, so keep it as a dim backdrop behind the headline */
	opacity: 0.35;
}

.heroShade {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(11, 13, 17, 0.35) 0%, rgba(11, 13, 17, 0.55) 60%, var(--bg) 100%),
		radial-gradient(ellipse at 20% 50%, rgba(11, 13, 17, 0.7), transparent 70%);
}

.heroBody {
	position: relative;
	padding-top: 64px;
}

.eyebrow {
	font-family: var(--display);
	color: var(--accent);
	text-transform: uppercase;
	letter-spacing: 4px;
	font-weight: 600;
	margin-bottom: 8px;
}

.chrome {
	font-family: var(--display);
	font-weight: 700;
	font-size: clamp(48px, 11vw, 128px);
	line-height: 0.95;
	letter-spacing: 2px;
	font-style: italic;
	background: linear-gradient(180deg, #ffffff 0%, #d9dee6 38%, #7d8794 52%, #e9edf2 64%, #aab3be 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6));
}

.heroLead {
	max-width: 560px;
	margin: 20px 0 32px;
	font-size: 18px;
	color: #cfd6e0;
}

.heroCtas {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--display);
	font-weight: 600;
	font-size: 16px;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 12px 24px;
	border-radius: 10px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.15s, filter 0.2s, background 0.2s;
}

.btn:hover {
	transform: translateY(-1px);
}

.btnPrimary {
	background: var(--accent);
	color: var(--bg);
}

.btnPrimary:hover {
	filter: brightness(1.1);
}

.btnGhost {
	background: rgba(255, 255, 255, 0.04);
	color: var(--text);
	border-color: rgba(255, 255, 255, 0.18);
}

.btnGhost:hover {
	background: rgba(255, 255, 255, 0.09);
}

/* Sections */
.section {
	padding: 88px 0;
}

.sectionAlt {
	background: var(--bg2);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.sectionTitle {
	font-family: var(--display);
	font-size: clamp(30px, 5vw, 42px);
	letter-spacing: 1px;
	text-transform: uppercase;
}

.sectionTitle::after {
	content: '';
	display: block;
	width: 56px;
	height: 3px;
	margin-top: 8px;
	background: var(--accent);
	transform: skewX(-20deg);
}

.sectionLead {
	max-width: 640px;
	color: var(--muted);
	margin: 16px 0 36px;
}

.subTitle {
	font-family: var(--display);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 22px;
	margin: 56px 0 20px;
}

/* Server cards */
.serverGrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
}

.server {
	background: linear-gradient(180deg, var(--panel), #10151c);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.serverHead {
	display: flex;
	align-items: center;
	gap: 14px;
}

.serverHead h3 {
	font-family: var(--display);
	font-size: 20px;
}

.serverWhere {
	color: var(--muted);
	font-size: 14px;
}

.region {
	flex: none;
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	font-family: var(--display);
	font-weight: 700;
	font-size: 18px;
	border-radius: 12px;
	background: var(--accentDeep);
	color: #fff;
}

.status {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: var(--muted);
	white-space: nowrap;
}

.status i {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--muted);
}

.status[data-state="online"] i {
	background: var(--ok);
	box-shadow: 0 0 0 0 rgba(94, 230, 160, 0.6);
	animation: pulse 2s infinite;
}

.status[data-state="offline"] i {
	background: var(--bad);
}

@keyframes pulse {
	70% { box-shadow: 0 0 0 8px rgba(94, 230, 160, 0); }
	100% { box-shadow: 0 0 0 0 rgba(94, 230, 160, 0); }
}

.serverStats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.serverStats > div {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 12px 14px;
	min-width: 0;
}

.statValue {
	display: block;
	font-family: var(--display);
	font-size: 22px;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.statLabel {
	font-size: 12px;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 1px;
}

.serverActions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.serverActions .btn {
	flex: 1 1 140px;
}

/* Race formats */
.formatGrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.format {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
}

.format h3 {
	font-family: var(--display);
	font-size: 22px;
	text-transform: uppercase;
	margin-bottom: 6px;
}

.format p {
	color: var(--muted);
}

.formatFeature {
	border-color: rgba(55, 192, 255, 0.45);
	background: linear-gradient(160deg, rgba(55, 192, 255, 0.12), var(--panel) 60%);
}

.formatTag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--bg);
	background: var(--accent);
	padding: 2px 8px;
	border-radius: 999px;
	margin-bottom: 10px;
}

.featureGrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
}

.feature {
	border-left: 3px solid var(--accent);
	padding: 4px 0 4px 16px;
}

.feature h4 {
	font-family: var(--display);
	font-size: 17px;
}

.feature p {
	color: var(--muted);
	font-size: 15px;
}

/* Join steps */
.steps {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 16px;
	margin-top: 36px;
}

.steps li {
	display: flex;
	gap: 14px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
}

.stepNum {
	flex: none;
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	font-family: var(--display);
	font-weight: 700;
	color: var(--bg);
	background: var(--accent);
}

.steps h4 {
	font-family: var(--display);
	font-size: 17px;
}

.steps p {
	color: var(--muted);
	font-size: 15px;
}

/* Supporter tiers */
.tierGrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
}

.tier {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
}

.tier h4 {
	font-family: var(--display);
	font-size: 18px;
	margin: 6px 0 4px;
}

.tier p {
	color: var(--muted);
	font-size: 15px;
}

.tierPrice {
	font-family: var(--display);
	font-size: 30px;
	font-weight: 700;
}

.tierPrice small {
	font-size: 14px;
	color: var(--muted);
	font-weight: 500;
}

.tierBest {
	border-color: rgba(255, 212, 105, 0.5);
	background: linear-gradient(160deg, rgba(255, 212, 105, 0.1), var(--panel) 60%);
}

.tierBest .tierPrice {
	color: var(--gold);
}

.fine {
	color: var(--muted);
	font-size: 13px;
	margin-bottom: 24px;
}

/* Footer */
.footer {
	padding: 48px 0;
	border-top: 1px solid var(--line);
}

.footerInner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.footerBrand {
	display: flex;
	align-items: center;
	gap: 14px;
	color: var(--muted);
	font-size: 14px;
}

.footerBrand img {
	border-radius: 8px;
}

.footerLinks {
	display: flex;
	gap: 20px;
}

.footerLinks a {
	color: var(--muted);
}

.footerLinks a:hover {
	color: var(--text);
}

.legal {
	flex-basis: 100%;
	color: #5f6b7b;
	font-size: 12px;
}

/* Toast */
#toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 20px);
	background: var(--panel);
	border: 1px solid var(--line);
	color: var(--text);
	padding: 10px 18px;
	border-radius: 10px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s, transform 0.25s;
	z-index: 60;
}

#toast.show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* Nav: active page and mobile menu */
.navLinks a.active {
	color: var(--text);
}

/* Nav submenus */
.navGroup {
	position: relative;
}

.navGroupBtn {
	font: inherit;
	font-weight: 500;
	color: var(--muted);
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: color 0.2s;
}

.navGroupBtn::after {
	content: '';
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}

.navGroup:hover .navGroupBtn,
.navGroup.open .navGroupBtn,
.navGroup.active .navGroupBtn {
	color: var(--text);
}

.navMenu {
	display: none;
	position: absolute;
	top: 100%;
	left: -14px;
	min-width: 180px;
	flex-direction: column;
	padding: 6px;
	margin-top: 10px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* Click-only: hover or focus would keep a menu open after a click tried to close it */
.navGroup.open .navMenu {
	display: flex;
}

.navMenu a {
	padding: 8px 12px;
	border-radius: 8px;
}

.navMenu a:hover,
.navMenu a.active {
	background: rgba(255, 255, 255, 0.05);
}

.menuToggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 0 9px;
	background: none;
	border: 1px solid var(--line);
	border-radius: 10px;
	cursor: pointer;
}

.menuToggle span {
	display: block;
	height: 2px;
	background: var(--text);
	border-radius: 2px;
}

/* Inner pages */
.page {
	padding: 104px 0 72px;
	min-height: 70vh;
}

.pageHead {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 28px;
}

.pageHead .sectionLead {
	margin-bottom: 0;
}

.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	margin-bottom: 20px;
}

.filters input,
.filters select {
	font: inherit;
	font-size: 15px;
	color: var(--text);
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 9px 12px;
	min-width: 0;
}

.filters input[type="search"] {
	flex: 1 1 220px;
}

.filters select {
	flex: 0 1 220px;
}

.filters label {
	display: flex;
	align-items: center;
	gap: 7px;
	color: var(--muted);
	font-size: 14px;
	cursor: pointer;
}

.filters input:focus,
.filters select:focus {
	outline: 2px solid rgba(55, 192, 255, 0.5);
	outline-offset: 1px;
}

.segmented {
	display: inline-flex;
	border: 1px solid var(--line);
	border-radius: 10px;
	overflow: hidden;
}

.segmented button {
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--muted);
	background: var(--panel);
	border: 0;
	padding: 9px 14px;
	cursor: pointer;
}

.segmented button + button {
	border-left: 1px solid var(--line);
}

.segmented button.on {
	color: var(--bg);
	background: var(--accent);
}

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

.emptyNote {
	color: var(--muted);
	padding: 32px 0;
	text-align: center;
}

.tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 1px 7px;
	border-radius: 999px;
	border: 1px solid var(--line);
	color: var(--muted);
	white-space: nowrap;
}

.tag.legacy {
	color: var(--gold);
	border-color: rgba(255, 212, 105, 0.35);
}

.tag.accent {
	color: var(--accent);
	border-color: rgba(55, 192, 255, 0.35);
}

/* Card grids */
.cardGrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
}

.mediaCard {
	display: flex;
	flex-direction: column;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	color: var(--text);
	transition: transform 0.15s, border-color 0.2s;
	text-align: left;
	font: inherit;
	cursor: pointer;
	padding: 0;
}

.mediaCard:hover {
	transform: translateY(-2px);
	border-color: rgba(55, 192, 255, 0.4);
}

.mediaCard .thumb {
	aspect-ratio: 16 / 9;
	background: #0e1014;
	overflow: hidden;
}

.mediaCard .thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mediaCard .thumb.square {
	aspect-ratio: 1 / 1;
}

.mediaCard .cardBody {
	flex: 1;
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.mediaCard h3 {
	font-family: var(--display);
	font-size: 18px;
	line-height: 1.25;
}

.cardMeta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	color: var(--muted);
	font-size: 13px;
}

.cardSplit {
	justify-content: space-between;
	flex-wrap: nowrap;
}

.cardSplit span:last-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-align: right;
}

.cardTags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	min-height: 20px;
}

.cardRecord {
	margin-top: auto;
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 14px;
	border-top: 1px solid var(--line);
	padding-top: 8px;
}

.cardRecord b {
	font-family: var(--display);
	color: var(--accent);
}

.cardRecord span {
	color: var(--muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.groupTitle {
	font-family: var(--display);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 18px;
	color: var(--muted);
	margin: 32px 0 14px;
}

/* Data tables */
.tableWrap {
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--panel);
}

.dataTable {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
}

.dataTable th {
	text-align: left;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--muted);
	font-weight: 600;
	padding: 12px 14px;
	border-bottom: 1px solid var(--line);
	white-space: nowrap;
}

.dataTable td {
	padding: 10px 14px;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}

.dataTable tr:last-child td {
	border-bottom: 0;
}

.dataTable tbody tr:hover {
	background: rgba(255, 255, 255, 0.025);
}

.dataTable .rank {
	font-family: var(--display);
	font-weight: 700;
	color: var(--muted);
	width: 48px;
}

.dataTable tr:nth-child(1) .rank { color: var(--gold); }
.dataTable tr:nth-child(2) .rank { color: #c9d1dc; }
.dataTable tr:nth-child(3) .rank { color: #d99a6c; }

.dataTable .time {
	font-family: var(--display);
	font-weight: 700;
	white-space: nowrap;
}

.dataTable .muted {
	color: var(--muted);
	font-size: 14px;
	white-space: nowrap;
}

.vehicleCell {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 180px;
}

/* Cars sit low in their square pictures, so the crop is centred on the car, not the frame */
.vehicleCell img {
	width: 56px;
	height: 32px;
	object-fit: cover;
	object-position: 50% 62%;
	border-radius: 6px;
	background: #0e1014;
	flex: none;
}

.vehicleCell .noImage {
	width: 56px;
	height: 32px;
	flex: none;
	display: grid;
	place-items: center;
	border-radius: 6px;
	border: 1px dashed var(--line);
	color: #4a5463;
}

.vehicleCell .noImage svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Track detail */
.trackHero {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
	gap: 24px;
	margin-bottom: 40px;
}

/* Fixed frame (aerial proportions) so the smaller route and minimap images never resize the page */
.trackHero img {
	width: 100%;
	aspect-ratio: 2560 / 1104;
	object-fit: contain;
	background: #0e1014;
	border-radius: var(--radius);
	border: 1px solid var(--line);
}

#trackImage {
	cursor: zoom-in;
}

.lightbox {
	cursor: zoom-out;
}

/* Fills the screen, scaling small images up, so the enlarged view is never smaller than the page */
.lightbox img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.lightbox .modalClose {
	position: fixed;
	top: 16px;
	right: 16px;
}

.trackFacts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin: 18px 0;
}

.trackFacts div {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 10px 14px;
}

.imageTabs {
	display: inline-flex;
	margin-top: 10px;
}

.recentList {
	display: grid;
	gap: 10px;
}

.recentRace {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 16px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 12px 16px;
	font-size: 14px;
}

a.recentRace {
	color: var(--text);
	transition: border-color 0.2s;
}

a.recentRace:hover {
	border-color: rgba(55, 192, 255, 0.4);
}

.podium {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
}

.podium .p1 { color: var(--gold); }
.podium .p2 { color: #c9d1dc; }
.podium .p3 { color: #d99a6c; }

/* Player stat card on the records page */
.profileCard {
	background: linear-gradient(160deg, rgba(55, 192, 255, 0.1), var(--panel) 60%);
	border: 1px solid rgba(55, 192, 255, 0.3);
	border-radius: var(--radius);
	padding: 18px 20px;
	margin-bottom: 24px;
}

.profileHead {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 16px;
}

.profileHead h2 {
	font-family: var(--display);
	font-size: 26px;
}

.profileHead .resultCount {
	margin: 0;
}

/* Results list */
.raceList {
	display: grid;
	gap: 10px;
}

.raceRow {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr) minmax(0, 300px);
	gap: 16px;
	align-items: center;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 14px 18px;
	color: var(--text);
	transition: border-color 0.2s, transform 0.15s;
}

.raceRow:hover {
	border-color: rgba(55, 192, 255, 0.4);
	transform: translateY(-1px);
}

.raceWhen {
	display: flex;
	flex-direction: column;
	font-size: 14px;
}

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

.raceMain {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.raceMain h3 {
	font-family: var(--display);
	font-size: 18px;
	line-height: 1.25;
}

.podiumList {
	flex-direction: column;
	gap: 2px;
	font-size: 14px;
}

.podiumList span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.podiumList em {
	font-style: normal;
	font-family: var(--display);
	color: var(--muted);
	margin-left: 4px;
}

.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 24px;
	color: var(--muted);
	font-size: 14px;
}

.pager .btn:disabled {
	opacity: 0.35;
	cursor: default;
	transform: none;
}

/* Result detail */
.resultTitle {
	margin-bottom: 14px;
}

.resultTitle a {
	color: var(--text);
}

.resultFacts {
	margin: 12px 0 10px;
	font-size: 15px;
}

.modeTags {
	margin-bottom: 8px;
}

.dataTable .dnf {
	color: var(--bad);
	font-size: 13px;
}

.resultTable tbody tr.on {
	background: rgba(55, 192, 255, 0.08);
}

.chartWrap {
	overflow-x: auto;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 12px 8px;
}

.bumpChart {
	display: block;
	width: 100%;
	min-width: 640px;
	height: auto;
}

.bumpChart .grid {
	stroke: rgba(255, 255, 255, 0.05);
	stroke-width: 1;
}

.bumpChart .axis {
	fill: var(--muted);
	font-size: 12px;
	font-family: var(--body);
}

.bumpLine .hit {
	fill: none;
	stroke: transparent;
	stroke-width: 14;
	pointer-events: stroke;
}

.bumpLine .line {
	fill: none;
	stroke: #4a5566;
	stroke-width: 2;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.bumpLine circle {
	fill: #4a5566;
}

.bumpLine .name {
	fill: var(--muted);
	font-size: 12px;
	font-family: var(--body);
}

.bumpChart.focused .bumpLine:not(.on) {
	opacity: 0.3;
}

.bumpLine.on .line {
	stroke: var(--accent);
	stroke-width: 3;
}

.bumpLine.on circle {
	fill: var(--accent);
	r: 4.5;
}

.bumpLine.on .name {
	fill: var(--text);
	font-weight: 600;
}

@media (max-width: 720px) {
	.raceRow {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.raceWhen {
		flex-direction: row;
		gap: 8px;
	}
}

/* Home: stat strip, right-now cards, latest results and fresh records */
.statStrip {
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	background: var(--bg2);
}

.statStripInner {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	padding-top: 22px;
	padding-bottom: 22px;
	text-align: center;
}

.statBig {
	display: block;
	font-family: var(--display);
	font-size: clamp(24px, 4vw, 34px);
	font-weight: 700;
	color: var(--text);
}

.sectionTight {
	padding: 56px 0 8px;
}

.nowGrid {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	gap: 16px;
	margin-top: 24px;
}

.nowCard {
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px 20px;
	color: var(--text);
	transition: border-color 0.2s;
}

.nowCard:hover {
	border-color: rgba(55, 192, 255, 0.4);
}

.nowCard .eyebrow {
	margin: 0;
	font-size: 13px;
}

.nowCard h3 {
	font-family: var(--display);
	font-size: 20px;
}

.nowLine {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 0;
}

.nowLine + .nowLine {
	border-top: 1px solid var(--line);
}

.region.small {
	width: 34px;
	height: 34px;
	font-size: 13px;
	border-radius: 8px;
}

.nowCount {
	margin-left: auto;
	color: var(--muted);
	font-size: 14px;
	white-space: nowrap;
}

.nowWhen {
	color: var(--muted);
}

.homeColumns {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 32px;
}

.homeColumnHead {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
}

.homeColumnHead .sectionTitle {
	font-size: clamp(24px, 3.5vw, 30px);
}

.recordTime {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-size: 13px;
	color: var(--muted);
}

.recordTime b {
	font-family: var(--display);
	font-size: 17px;
	color: var(--accent);
}

@media (max-width: 860px) {
	.nowGrid,
	.homeColumns {
		grid-template-columns: 1fr;
	}

	.statStripInner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Live */
.liveServer {
	background: var(--bg2);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 24px;
}

.liveServerHead {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 16px;
}

.liveServerHead h2 {
	font-family: var(--display);
	font-size: 22px;
}

.liveServerHead .status {
	margin: 2px 0 0;
}

.liveConnect {
	margin-left: auto;
	padding: 9px 18px;
}

.liveRace {
	margin-bottom: 16px;
}

.liveRaceHead {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-bottom: 10px;
}

.liveRaceHead h3 {
	font-family: var(--display);
	font-size: 19px;
}

.liveClock {
	margin-left: auto;
	font-family: var(--display);
	font-weight: 700;
	color: var(--accent);
}

.liveOnlineTitle {
	font-size: 16px;
	margin: 18px 0 10px;
}

.liveChips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.liveChip {
	font-size: 13px;
	padding: 3px 10px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--panel);
}

/* Classes */
.classDesc {
	color: var(--muted);
	font-size: 14px;
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 1.45em;
}

.classModalBox {
	max-width: 900px;
}

.classModalMeta {
	align-items: center;
	margin: 10px 0 18px;
}

.classVehicles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 10px;
}

.classVehicle {
	display: flex;
	flex-direction: column;
	gap: 6px;
	color: var(--text);
	font-size: 13px;
	line-height: 1.3;
}

.classVehicle img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--line);
	background: #0e1014;
}

.classVehicle:hover span {
	color: var(--accent);
}

/* Calendar */
.calEvent {
	display: grid;
	grid-template-columns: 150px minmax(0, 1fr);
	gap: 16px;
	align-items: center;
	width: 100%;
	text-align: left;
	font: inherit;
	color: var(--text);
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 12px 16px;
	cursor: pointer;
	transition: border-color 0.2s;
}

.calEvent:hover {
	border-color: rgba(55, 192, 255, 0.4);
}

.calWhen {
	display: flex;
	flex-direction: column;
	font-size: 14px;
}

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

.calInfo h3 {
	font-family: var(--display);
	font-size: 17px;
	margin-bottom: 2px;
}

.calMonthHead {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 48px 0 16px;
}

.calMonthHead .subTitle {
	margin: 0;
	min-width: 220px;
	text-align: center;
}

.calMonthHead .btn {
	padding: 8px 14px;
}

.calGrid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

.calWeekday {
	text-align: center;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--muted);
	padding: 4px 0;
}

.calDay {
	min-height: 110px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 6px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.calDay.outside {
	opacity: 0.35;
}

.calDay.past .calChip {
	opacity: 0.55;
}

.calDay.today {
	border-color: var(--accent);
}

.calDate {
	font-family: var(--display);
	font-size: 13px;
	color: var(--muted);
}

.calDay.today .calDate {
	color: var(--accent);
}

.calChip {
	display: block;
	width: 100%;
	text-align: left;
	font: inherit;
	font-size: 12px;
	line-height: 1.35;
	color: var(--text);
	background: rgba(55, 192, 255, 0.12);
	border: 1px solid rgba(55, 192, 255, 0.3);
	border-radius: 6px;
	padding: 3px 6px;
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.calChip.open {
	background: rgba(255, 212, 105, 0.1);
	border-color: rgba(255, 212, 105, 0.35);
}

.calModalBox {
	max-width: 540px;
}

.calTitle {
	font-size: 28px;
	margin-bottom: 4px;
}

.calNotes {
	margin: 14px 0 0;
	white-space: pre-line;
}

@media (max-width: 720px) {
	.calEvent {
		grid-template-columns: 1fr;
		gap: 6px;
	}

	.calDay {
		min-height: 54px;
		padding: 4px;
	}

	/* Chips shrink to dots on phones; tapping still opens the event */
	.calChip {
		font-size: 0;
		padding: 0;
		width: 10px;
		height: 10px;
		border-radius: 50%;
		background: var(--accent);
	}

	.calChip.open {
		background: var(--gold);
	}
}

/* Vehicle modal */
.modal {
	position: fixed;
	inset: 0;
	z-index: 80;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(5, 7, 10, 0.75);
	backdrop-filter: blur(4px);
}

.modal.open {
	display: flex;
}

.modalBox {
	position: relative;
	width: 100%;
	max-width: 760px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	background: linear-gradient(180deg, var(--panel), #10151c);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

/* Full square vehicle picture, uncropped and centred */
#vehicleModalBody > img {
	width: 100%;
	max-height: 440px;
	object-fit: contain;
	background: #0e1014;
}

.modalBody {
	padding: 20px 24px 24px;
}

.modalClose {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--line);
	background: rgba(11, 13, 17, 0.8);
	color: var(--text);
	font-size: 18px;
	cursor: pointer;
}

.statRow {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	gap: 10px;
	margin: 16px 0;
}

.statRow div {
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 10px 12px;
}

.loadMore {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

/* Phones and narrow windows: collapse the nav into a menu */
@media (max-width: 860px) {
	.menuToggle {
		display: flex;
	}

	.navLinks {
		display: none;
		position: absolute;
		top: 64px;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 8px 16px 16px;
		background: rgba(11, 13, 17, 0.97);
		border-bottom: 1px solid var(--line);
	}

	.menuOpen .navLinks {
		display: flex;
	}

	.navLinks a {
		padding: 12px 4px;
		border-bottom: 1px solid var(--line);
	}

	/* Phone menu: groups become labelled sections, always expanded */
	.navGroupBtn {
		pointer-events: none;
		padding: 14px 4px 4px;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 1px;
	}

	.navGroupBtn::after {
		display: none;
	}

	.navMenu {
		display: flex;
		position: static;
		margin: 0;
		padding: 0 0 0 12px;
		background: none;
		border: 0;
		box-shadow: none;
		min-width: 0;
	}

	.navMenu a {
		border-radius: 0;
	}

	.navLinks .navCta {
		margin-top: 12px;
		text-align: center;
		border-bottom: 0;
	}

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

@media (max-width: 720px) {
	.section {
		padding: 64px 0;
	}

	.hero {
		min-height: min(84vh, 720px);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.status[data-state="online"] i {
		animation: none;
	}
}
