/*
 * Oasis.tf style for HLstatsX:CE
 * Matches the oasis.tf site (wp-content/themes/oasis-tf): daytime desert sky, logo drawn in
 * deep "oasis water" blue, blue ghost-pill buttons, Fredoka type.
 * Install: styles/oasis.css + styles/oasis/oasis-logo.webp
 */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

/* Gurun by wepfont (same display font as the oasis.tf nav). Freeware, commercial use requires a
   donation: see oasis/gurun-LICENSE.txt. It is an OTF file named .ttf because the stats nginx
   config only serves .ttf/.woff font extensions; browsers detect the format from the data. */
@font-face {
	font-family: 'Gurun';
	src: url('oasis/gurun-otf.ttf') format('opentype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	/* Daytime desert palette (same as :root in the WP theme style.css) */
	--ox-water: #1e3d58;          /* deep "oasis water" blue: logo, header text, headings */
	--ox-water-line: rgba(30, 61, 88, .35);
	--ox-sky: #2f78a8;
	--ox-sky-light: #7cc0e6;
	--ox-clay: #a34a23;           /* terracotta accent */
	--ox-clay-light: #d07a45;
	--ox-sand: #e2bd7f;
	--ox-sand-light: #f3dca6;
	--ox-cream: #fdfcf5;

	/* Surfaces & text inside the content card */
	--ox-card: rgba(253, 252, 245, .97);
	--ox-row: #ffffff;
	--ox-row-alt: #faf4e6;
	--ox-row-hover: #eaf4fa;
	--ox-line: #ecdcb8;
	--ox-ink: #22323f;
	--ox-muted: #5f6b73;
	--ox-link: #2f78a8;
	--ox-link-hover: #a34a23;

	--ox-radius: 16px;
	--ox-shadow: 0 10px 34px rgba(120, 84, 40, .22);
	--ox-font: 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--ox-display: 'Gurun', 'Fredoka', system-ui, sans-serif;   /* nav + section headings */
}

/* ---------- Page background: fixed daytime desert (sky, sun upper right, sand) ----------
   Previous warm sunset: #141b3a 0, #2c2d66 25, #5a3f84 48, #a6507f 66, #e8806b 82, #f6b06a 93, #fad98f 100. */
html { background: #d3a565; }
body {
	margin: 0;
	min-height: 100vh;
	color: var(--ox-water);
	background: transparent;
	font: 400 14px/1.45 var(--ox-font);
}
body::before {
	content: '';
	position: fixed; inset: 0; z-index: -1;
	background:
		radial-gradient(circle at 82% 10%, rgba(255, 251, 230, .95) 0, rgba(255, 246, 205, .55) 5%, rgba(255, 246, 205, 0) 20%),
		linear-gradient(to bottom,
			#4fa3d9 0%,
			#7cc0e6 22%,
			#a9d8ef 42%,
			#d4ecf2 56%,
			#f1e6c8 61%,
			#ecd3a0 67%,
			#e2bd7f 84%,
			#d3a565 100%);
}

/* Override hlstats.css / legacy Verdana 8pt rules */
tr, td, th, div, span, p, li, body, input, select, textarea, button, tt {
	font-family: var(--ox-font);
}
td, div, span { font-size: inherit; }
td { font-size: 14px; }
h1, h2, h3 { font-family: var(--ox-font); font-weight: 600; color: var(--ox-water); }
h1 { font-size: 1.6rem; }
h2, h3 { font-size: 1.1rem; }

img { vertical-align: middle; border: none; }
ul { margin-left: 6px; padding-left: 6px; }
li { margin-bottom: 6px; }

a:link, a:visited { color: var(--ox-link); text-decoration: none; }
a:hover, a:active { color: var(--ox-link-hover); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--ox-sky); outline-offset: 2px; border-radius: 4px; }

.fSmall   { font-size: 12px; }
.fNormal  { font-size: 13px; font-weight: 500; }
.fHeading { font-size: 14px; font-weight: 600; }
.fTitle   { font-size: 1.15rem; font-weight: 600; color: var(--ox-water); }

/* ======================================================================
   Header (sits on the sky)
   ====================================================================== */
body > .block:first-of-type { padding-top: clamp(1.25rem, 4vh, 2.5rem); }

.headerblock {
	height: auto;
	background: none;
	text-align: center;
	position: relative;
}

/* Replace the HLstatsX title image with the Oasis.tf logo */
.headerblock .title { margin: 0; padding: 0; }
.headerblock .title a {
	display: block;
	width: min(60vw, 240px);
	aspect-ratio: 2000 / 1541;
	margin: 0 auto;
	background: var(--ox-water);   /* cream logo file used as a mask, drawn in water blue */
	-webkit-mask: url('oasis/oasis-logo.webp') center / contain no-repeat;
	mask: url('oasis/oasis-logo.webp') center / contain no-repeat;
	text-indent: -9999px; overflow: hidden;
}
.headerblock .title img { display: none; }

/* Top tabs: image buttons become water-blue ghost pills, like the home page buttons */
.headertabs { position: static; margin: clamp(1rem, 3vh, 1.75rem) 0 0; padding: 0; }
.headertabs ul {
	display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem;
	margin: 0; padding: 0; list-style: none;
}
.headertabs li { display: block; margin: 0; }
.headertabs img { display: none; }
.headertabs a,
.headertabs a:link,
.headertabs a:visited {
	display: inline-block;
	min-width: 7rem;
	padding: .5rem 1.6rem;
	border: 2px solid var(--ox-water);
	border-radius: 999px;
	color: var(--ox-water);
	font-family: var(--ox-display);
	font-size: 1.3rem; font-weight: 400; line-height: 1.2;
	text-transform: lowercase;   /* matches the oasis.tf nav */
	text-align: center; text-decoration: none;
	transition: background .2s, color .2s;
}
.headertabs a:hover,
.headertabs a:focus-visible {
	background: var(--ox-water);
	color: var(--ox-cream);
	text-decoration: none;
	outline: none;
}
/* Labels for the (now hidden) tab images, matched by link target */
.headertabs a::after                        { content: 'Link'; }
.headertabs a[href$="hlstats.php"]::after   { content: 'Home'; }
.headertabs a[href*="mode=search"]::after   { content: 'Search'; }
.headertabs a[href*="mode=help"]::after     { content: 'Help'; }
.headertabs a[href*="bans"]::after          { content: 'Bans'; }
.headertabs a[target="_blank"]:not([href*="bans"])::after { content: 'Forum'; }

.header_gameslist { position: static; float: none; padding: .75rem 0 0; text-align: center; }
.header_gameslist img { padding: 0 3px; }

/* Breadcrumb */
.location {
	height: auto;
	background: none;
	color: rgba(30, 61, 88, .8);
	text-align: center;
	margin-top: 1rem;
}
.location ul {
	float: none !important;
	display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .1rem .35rem;
	list-style: none; margin: 0; padding: 0;
}
.location li { display: inline; margin: 0; }
.location a:link, .location a:visited { color: var(--ox-water); }
.location a:hover { color: var(--ox-clay); text-decoration: none; }
.location strong { color: var(--ox-water); font-weight: 600; }
.location .arrow { color: var(--ox-water-line); font-size: 1em; }
.location form { float: none !important; margin-top: .5rem; color: rgba(30, 61, 88, .8); }
.location_under { display: none; }

/* ======================================================================
   Content card
   ====================================================================== */
.content {
	box-sizing: border-box;
	width: min(1500px, calc(100% - 2rem));
	margin: .5rem auto 2.5rem;
	padding: clamp(1rem, 2.5vw, 2rem);
	background: var(--ox-card);
	color: var(--ox-ink);
	border-radius: var(--ox-radius);
	box-shadow: var(--ox-shadow);
	overflow-x: auto;
}
.block { margin: 0 auto; }
.subblock { margin: 0 auto; width: 100%; }

/* Section headings ("Player Rankings", "Server Overview", ...) */
.content .block > .fHeading:first-child,
.content .block > span.fHeading {
	display: inline-block;
	font-family: var(--ox-display);
	font-size: 1.6rem;
	font-weight: 400;
	color: var(--ox-water);
	margin-bottom: .25rem;
}
.content img[src*="downarrow.gif"],
.content img[src*="rightarrow.gif"] { display: none; }

/* ---------- Game nav (Servers, Players, ...) ---------- */
nav { display: block; text-align: center; margin: 0 0 1.75rem; }
.fancyNav {
	display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .4rem;
	overflow: visible;
	margin: 0; padding: .4rem;
	border-radius: 999px;
	background: #fff;
	border: 2px solid var(--ox-sky);
	box-shadow: 0 4px 16px rgba(30, 61, 88, .12);
}
.fancyNav li,
.fancyNav li:first-child,
.fancyNav li:last-child {
	float: none;
	margin: 0;
	background: none;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
}
.fancyNav li::after { display: none; }
.fancyNav li a,
.fancyNav li a:link,
.fancyNav li a:visited {
	display: inline-block;
	padding: .45rem 1.1rem;
	border-radius: 999px;
	font: 400 17px/1.2 var(--ox-display);
	text-transform: lowercase;
	color: var(--ox-ink);
	text-shadow: none;
	transition: background .15s, color .15s;
}
/* Hover: sky blue to water blue */
.fancyNav li a:hover {
	background: linear-gradient(to bottom, var(--ox-sky), var(--ox-water));
	color: var(--ox-cream);
}

/* ---------- Data tables ---------- */
.data-table,
.livestats-table {
	width: 100%;
	border: 1px solid var(--ox-line);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 12px;
	overflow: hidden;
	background: var(--ox-row);
}
.data-table td,
.livestats-table td {
	padding: .45rem .6rem;
	border: 0;
	border-bottom: 1px solid var(--ox-line);
}
.data-table tr:last-child td { border-bottom: 0; }

.data-table-head,
.data-table-head td {
	background: linear-gradient(to bottom, var(--ox-water), var(--ox-sky));
	color: var(--ox-cream);
	font-weight: 600;
	vertical-align: bottom;
	border-bottom: 0;
}
.data-table-head td { font-size: 12px; letter-spacing: .03em; }
.data-table-head a:link,
.data-table-head a:visited { color: var(--ox-cream); }
.data-table-head a:hover,
.data-table-head a:active { color: var(--ox-sand-light); text-decoration: none; }

.data-table-row { background: var(--ox-row); color: var(--ox-ink); }

.bg1 { background-color: var(--ox-row); }
.bg2 { background-color: var(--ox-row-alt); }
.data-table tr.bg1:hover,
.data-table tr.bg2:hover { background-color: var(--ox-row-hover); }

/* Server list rows */
.game-table-row { background: var(--ox-row); }
.game-table-row-hover { background: var(--ox-row-hover); }
.game-table-cell {
	color: var(--ox-ink);
	vertical-align: middle;
	padding: .55rem .6rem;
	border: 0;
	border-bottom: 1px solid var(--ox-line);
}
.game-table-cell a { color: var(--ox-link); font-weight: 600; }

/* Bar graphs / meters: sky blue, sand, terracotta */
.bargraph { height: 10px; border-radius: 5px; }
meter, meter::-webkit-meter-bar { background: var(--ox-row-alt); border-radius: 6px; box-shadow: inset 0 1px 2px rgba(30, 61, 88, .15); }
meter::-webkit-meter-optimum-value       { background: linear-gradient(to right, var(--ox-sky-light), var(--ox-sky)); border-radius: 6px; }
meter::-webkit-meter-suboptimum-value    { background: var(--ox-sand); border-radius: 6px; }
meter::-webkit-meter-even-less-good-value { background: var(--ox-clay); border-radius: 6px; }
meter:-moz-meter-optimum::-moz-meter-bar        { background: linear-gradient(to right, var(--ox-sky-light), var(--ox-sky)); }
meter:-moz-meter-sub-optimum::-moz-meter-bar    { background: var(--ox-sand); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--ox-clay); }

/* ---------- Player page tabs ---------- */
#main ul.subsection_tabs {
	display: flex; flex-wrap: wrap; gap: .4rem;
	height: auto;
	list-style: none;
	margin: 0 0 1rem; padding: 0 0 .75rem;
	border-bottom: 2px solid var(--ox-line);
}
#main ul.subsection_tabs li { float: none; margin: 0; padding: 0; }
#main ul.subsection_tabs li a {
	display: block;
	width: auto; height: auto;
	padding: .4rem 1.1rem;
	border: 2px solid var(--ox-sky);
	border-radius: 999px;
	background: transparent;
	color: var(--ox-sky);
	font: 400 16px/1.2 var(--ox-display);
	text-transform: lowercase;
	text-decoration: none;
}
#main ul.subsection_tabs li a:hover { background: var(--ox-row-hover); }
#main ul.subsection_tabs li a.active,
#main ul.register_tabs li a.active {
	background: linear-gradient(to bottom, var(--ox-sky), var(--ox-water));
	border-color: transparent;
	color: var(--ox-cream);
}

/* ---------- Forms ---------- */
input.textbox, input[type="text"], input[type="password"], select, textarea {
	font: 400 14px var(--ox-font);
	color: var(--ox-ink);
	background: #fff;
	border: 1.5px solid var(--ox-line);
	border-radius: 999px;
	padding: .3rem .8rem;
}
textarea { border-radius: 12px; }
input.textbox:focus, input[type="text"]:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--ox-sky);
	box-shadow: 0 0 0 3px rgba(47, 120, 168, .2);
}
input.submit, input.smallsubmit, input[type="submit"], button {
	height: auto;
	font: 600 14px var(--ox-font);
	color: var(--ox-ink);
	padding: .35rem 1.1rem;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(to bottom, var(--ox-sand-light), var(--ox-sand));
	cursor: pointer;
	transition: filter .15s, transform .1s;
}
input.submit:hover, input.smallsubmit:hover, input[type="submit"]:hover, button:hover {
	filter: brightness(1.05);
	transform: translateY(-1px);
}

/* ---------- Misc legacy bits ---------- */
.gmapstab a { color: var(--ox-link); }
.gmapstabtitle { color: var(--ox-water); }
.errorhead { background: var(--ox-clay); color: var(--ox-cream); font-family: var(--ox-font); padding: .4rem .6rem; }
.errortext { background: #fff; color: var(--ox-ink); font-family: var(--ox-font); }
.warning { border: 2px solid var(--ox-clay-light); border-radius: 12px; background: #fff4ec; }
.helpwindow { border: 2px solid var(--ox-sky); border-radius: 12px; background: var(--ox-cream); color: var(--ox-ink); }

/* ---------- Footer (inside the card) ---------- */
#footer { display: none; } /* HLstatsX image badge; the text credit below is kept */
.content > div.fSmall {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid var(--ox-line);
	color: var(--ox-muted);
	text-align: center;
}

/* ---------- In-game MOTD pages (different markup, no .content card) ---------- */
body#ingame { color: var(--ox-ink); }
body#ingame::before { background: var(--ox-cream); }
body#ingame .headerblock {
	height: 50px !important;
	background: linear-gradient(to right, var(--ox-water), var(--ox-sky));
	text-align: left;
}
body#ingame .headerblock a:link,
body#ingame .headerblock a:visited { color: var(--ox-cream); }

@media (max-width: 700px) {
	.headertabs a, .headertabs a:link, .headertabs a:visited { min-width: 0; padding: .4rem 1.1rem; font-size: .95rem; }
	.content { width: calc(100% - 1rem); border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
