/* ChunkBlazer — shared styles for the landing, leaderboards, and top-25 pages.
   Deep navy + ember orange theme. Page-specific layout lives inline per page. */
:root {
	color-scheme: dark;
	--bg: #0b0e17;
	--panel: #141a28;
	--panel2: #1b2233;
	--line: #262d44;
	--text: #ecedf4;
	--muted: #888fa6;
	--flame: #ff9d3c;
	--flame2: #ff8a1a;
	--gold: #ffd34d;
	--silver: #cdd2dc;
	--bronze: #d8975a;
	--online: #4ade80;
	/* Fire-themed page backdrop + panel depth (ember glow over dark). */
	--page-bg:
		radial-gradient(78% 55% at 50% 0%, rgba(255,125,45,.14), transparent 60%),
		radial-gradient(95% 75% at 100% 100%, rgba(185,62,18,.11), transparent 55%),
		linear-gradient(175deg, #170f09 0%, #0b0e17 42%, #080a12 100%);
	--panel-grad:
		radial-gradient(125% 120% at 0% 0%, rgba(255,135,55,.10), transparent 46%),
		radial-gradient(120% 120% at 100% 100%, rgba(165,58,20,.15), transparent 55%),
		linear-gradient(160deg, #1a1623 0%, #10121b 100%);
}
* { box-sizing: border-box; }
body {
	margin: 0; min-height: 100vh; color: var(--text);
	background: var(--page-bg) var(--bg) fixed;
	font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
a { color: var(--flame); }

/* --- compact top bar (leaderboards / top25 / inner pages) --- */
.topbar {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--line);
	background: rgba(12,16,26,.85);
}
.topbar .brand { display: inline-flex; align-items: center; }
.topbar .brand img { height: 30px; width: auto; vertical-align: middle; }
.topbar nav { display: flex; gap: 1.2rem; align-items: center; font-size: .9rem; }
.topbar nav a { color: var(--text); text-decoration: none; }
.topbar nav a:hover, .topbar nav a.active { color: var(--flame); }
.topbar .soon { color: var(--muted); cursor: default; }
/* Discreet icon link (e.g. Discord) in the topbar nav. */
.topbar nav a.ico { display: inline-flex; align-items: center; color: var(--muted); }
.topbar nav a.ico svg { width: 19px; height: 19px; }
.topbar nav a.ico:hover { color: #5865F2; }
/* Patreon "Support" link in the topbar nav. */
.topbar nav a.support { display: inline-flex; align-items: center; gap: .35rem; color: #F96854; font-weight: 700; }
.topbar nav a.support svg { width: 16px; height: 16px; }
.topbar nav a.support:hover { color: #ff7a6b; }

/* Patreon support button (footers). */
.patreon {
	display: inline-flex; align-items: center; gap: .45rem;
	color: #F96854; border: 1px solid #F96854; border-radius: 9px;
	padding: .45rem .9rem; font-weight: 700; font-size: .86rem; text-decoration: none;
	transition: background .15s, color .15s;
}
.patreon svg { width: 16px; height: 16px; }
.patreon:hover { background: #F96854; color: #fff; }
.support-line { text-align: center; margin-bottom: 1.1rem; }

/* --- player search box --- */
.search { position: relative; }
.search input {
	width: 100%; padding: .85rem 1rem; font-size: 1.05rem;
	background: var(--panel); color: var(--text);
	border: 1px solid var(--line); border-radius: 10px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--flame2); box-shadow: 0 0 0 2px rgba(255,138,26,.25); }
.suggest {
	position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 20;
	list-style: none; margin: 0; padding: .25rem;
	background: var(--panel2); border: 1px solid var(--line); border-radius: 10px;
	box-shadow: 0 10px 28px rgba(0,0,0,.45); max-height: 320px; overflow: auto;
}
.suggest li { padding: .55rem .7rem; border-radius: 7px; cursor: pointer; font-weight: 600; }
.suggest li.active { background: rgba(255,157,60,.14); color: var(--flame); }
.suggest li.none { color: var(--muted); font-weight: 400; cursor: default; }

/* --- panels / section cards --- */
.section { background: var(--panel-grad); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.section > h2 {
	margin: 0; font-size: .92rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line);
	background: var(--panel2); display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.section > h2 .more { font-size: .78rem; font-weight: 600; }

/* --- tables / boards --- */
.board { background: var(--panel-grad); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead th {
	text-align: left; font-size: .72rem; text-transform: uppercase;
	letter-spacing: .05em; color: var(--muted);
	padding: .7rem .8rem; border-bottom: 1px solid var(--line);
	background: var(--panel2); white-space: nowrap;
}
thead th.num, tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); font-size: .95rem; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,157,60,.06); }
td.rank { font-variant-numeric: tabular-nums; color: var(--muted); width: 3.2rem; }
tr.top1 td.rank { color: var(--gold); font-weight: 700; }
tr.top2 td.rank { color: var(--silver); font-weight: 700; }
tr.top3 td.rank { color: var(--bronze); font-weight: 700; }
td.rsn { font-weight: 600; }
td.rsn .plink { color: var(--text); text-decoration: none; }
td.rsn .plink:hover { color: var(--flame); text-decoration: underline; }
/* "Dev" recognition: ChunkBlazer developer accounts get an orange name + a
   "Dev" badge on every board (leaderboards, top25, landing widget). */
/* High enough specificity to beat `td.rsn .plink` (the default --text name). */
td.rsn .plink.dev, .plink.dev, .name.dev, a.dev { color: var(--flame); font-weight: 700; }
/* The hidden attribute is only a UA-default display:none — any author display
   (like the badge chips' inline-block) silently overrides it. Make hidden
   always win, everywhere. */
[hidden] { display: none !important; }

.dev-tag {
	display: inline-block; vertical-align: middle; margin-left: .35rem;
	padding: .05rem .36rem; border-radius: 5px;
	font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
	color: #1a1205; background: var(--flame);
}
/* "Tester" badge — trusted outside players who QA builds. Cool teal so it
   reads as distinct from (and humbler than) the flame-orange Dev badge. */
.tester-tag {
	display: inline-block; vertical-align: middle; margin-left: .35rem;
	padding: .05rem .36rem; border-radius: 5px;
	font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
	color: #06211c; background: #45b09a;
}
td.rsn .dot, .dot {
	display: inline-block; width: .5rem; height: .5rem; border-radius: 50%;
	background: var(--online); margin-right: .45rem; vertical-align: middle;
	box-shadow: 0 0 6px var(--online);
}
td.value { color: var(--flame); font-weight: 700; }

/* --- account-type badges --- */
.acct {
	display: inline-block; font-size: .6rem; text-transform: uppercase; letter-spacing: .04em;
	font-weight: 700; padding: .12rem .4rem; border-radius: 5px; border: 1px solid var(--line);
	color: var(--muted); vertical-align: middle;
}
.acct.iron     { color: #c8ccd6; border-color: #565d72; }
.acct.hcim     { color: #ff7a7a; border-color: #7a3030; }
.acct.uim      { color: #e9ecf3; border-color: #6b7184; }
.acct.skiller  { color: #7ee0a0; border-color: #2f6b46; }
.acct.standard { color: #9aa3bd; border-color: #3b425c; }

/* --- buttons --- */
.btn {
	display: inline-block; background: rgba(255,255,255,.03); color: var(--text);
	border: 1px solid var(--line); border-radius: 9px;
	padding: .5rem 1.15rem; font-size: .86rem; font-weight: 500; letter-spacing: .01em;
	cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: rgba(255,157,60,.08); border-color: var(--flame); color: var(--flame); }
.btn.primary { background: var(--flame); border-color: var(--flame); color: #1a1205; font-weight: 700; }
.btn.primary:hover { background: var(--flame2); border-color: var(--flame2); color: #1a1205; }

/* --- states / footer --- */
.state { padding: 2.2rem 1rem; text-align: center; color: var(--muted); }
.state.error { color: #ff8c7a; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem 3rem; }
footer .disclaimer { margin-top: .4rem; opacity: .7; }
footer a { color: var(--muted); }
footer a:hover { color: var(--flame); }

/* --- Shared multi-column site footer (landing + leaderboards) ---
   Scoped to .site-footer so the simple centered footer above still serves
   top25 / compare / faq / privacy. Kept deliberately compact + discreet. */
.site-footer {
	margin-top: 2.25rem; padding: 1.4rem 1rem 1.6rem; text-align: left;
	border-top: 1px solid var(--line); background: rgba(0,0,0,.22);
}
.site-footer .foot-cols {
	max-width: 1080px; margin: 0 auto;
	display: flex; flex-wrap: wrap; gap: 1.1rem 3rem; justify-content: center;
}
.site-footer .foot-col { display: flex; flex-direction: column; gap: .38rem; min-width: 138px; }
.site-footer .foot-col h4 {
	margin: 0 0 .2rem; font-size: .64rem; text-transform: uppercase; letter-spacing: .09em;
	color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: .32rem;
}
.site-footer .foot-col > a { color: var(--text); text-decoration: none; font-size: .82rem; }
.site-footer .foot-col > a:hover { color: var(--flame); }
.site-footer .ds-row { display: flex; align-items: center; gap: .5rem; }
.site-footer .ds-row .ds-name { font-weight: 600; color: var(--text); font-size: .82rem; min-width: 5.8rem; }
.site-footer .ds-row a { display: inline-flex; transition: filter .15s, transform .15s; }
.site-footer .ds-row a.yt { color: #ff0000; }
.site-footer .ds-row a.x { color: #ffffff; }
.site-footer .ds-row a:hover { transform: translateY(-1px); filter: brightness(1.18); }
.site-footer .ds-row svg { width: 16px; height: 16px; }
/* Compact the shared Patreon button when it sits in this footer. */
.site-footer .patreon { align-self: flex-start; padding: .38rem .8rem; font-size: .82rem; border-radius: 8px; }
.site-footer .patreon svg { width: 15px; height: 15px; }
.site-footer .disclaimer {
	max-width: 1080px; margin: 1.2rem auto 0; text-align: center;
	color: var(--muted); font-size: .72rem; opacity: .68;
}

/* --- shared mobile pass (≤640px) ---
   Applies to every page that links site.css (leaderboards, top25, compare,
   faq, privacy, 404). Landing + player pages add their own inline @media on
   top of this for their bespoke grids. */
@media (max-width: 640px) {
	/* Top bar: let the nav wrap under the brand instead of squashing/overflowing. */
	.topbar { flex-wrap: wrap; gap: .55rem .9rem; padding: .6rem .8rem; }
	.topbar .brand img { height: 26px; }
	.topbar nav { gap: .85rem; font-size: .82rem; flex-wrap: wrap; row-gap: .4rem; }

	/* Wide boards (leaderboards, compare, player stats) would otherwise force a
	   full-page horizontal scroll. Let the board itself scroll instead, so the
	   page chrome stays put and the table can be swiped. */
	.board { overflow-x: auto; -webkit-overflow-scrolling: touch; }
	thead th { padding: .55rem .55rem; font-size: .66rem; }
	tbody td { padding: .5rem .55rem; font-size: .86rem; }
	td.rank { width: 2.4rem; }

	/* Section headers + search shrink a touch for narrow viewports. */
	.section > h2 { font-size: .85rem; padding: .7rem .8rem; }
	.search input { padding: .7rem .85rem; font-size: .98rem; }

	/* Buttons stay tappable but tighten horizontally. */
	.btn { padding: .5rem .9rem; }

	/* Shared footer: let columns stack and center on narrow screens. */
	.site-footer { text-align: center; }
	.site-footer .foot-cols { gap: 1.2rem 2rem; }
	.site-footer .foot-col { align-items: center; min-width: 0; }
	.site-footer .ds-row .ds-name { min-width: 0; }
	.site-footer .patreon { align-self: center; }
}
