:root {
	--bg: #333333;
	--panel: #2a2a2a;
	--btn: #444444;
	--btn-hover: #555555;
	--accent: #e0a030;
	--text: #ffffff;
	--muted: #aaaaaa;
	--name: #cccccc;
	/* Mid-tone stand-in for the game world behind the chat, so dark
	   colors like {black} stay as readable as light ones. */
	--preview: linear-gradient(160deg, #6a7681, #3e454b);
}

* {
	box-sizing: border-box;
}

body {
	font-family: Arial, sans-serif;
	margin: 0;
	background-color: var(--bg);
	color: var(--text);
}

.header {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 12px 20px;
	background-color: var(--panel);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tabs {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.tab {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	padding: 10px 18px;
	font-size: 16px;
	background-color: var(--btn);
	color: var(--text);
	border: 2px solid transparent;
	border-radius: 5px;
	cursor: pointer;
}

.tab:hover {
	background-color: var(--btn-hover);
}

.tab.active {
	border-color: var(--accent);
}

.tab small {
	font-size: 12px;
	color: var(--muted);
}

/* Equal side columns keep the search centered; sort and count go right. */
.toolbar {
	display: grid;
	grid-template-columns: 1fr minmax(0, 400px) 1fr;
	align-items: center;
	gap: 12px;
	margin-top: 12px;
}

.search {
	grid-column: 2;
	width: 100%;
	padding: 8px 12px;
	font-size: 16px;
	background-color: var(--bg);
	color: var(--text);
	border: 1px solid var(--btn-hover);
	border-radius: 5px;
}

.search:focus,
.sort:focus {
	outline: none;
	border-color: var(--accent);
}

.tools {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.sort {
	padding: 8px;
	font-size: 14px;
	background-color: var(--bg);
	color: var(--text);
	border: 1px solid var(--btn-hover);
	border-radius: 5px;
}

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

.content {
	padding: 0 20px 20px;
}

.message {
	margin: 50px 0;
	text-align: center;
	font-size: 18px;
	color: var(--muted);
}

/* ---- sections and cards ---- */

.section-title {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 28px 0 14px;
	font-size: 20px;
	font-weight: normal;
	color: var(--name);
}

.section-title small {
	font-size: 13px;
	color: var(--muted);
}

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

.card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 10px;
	background-color: var(--panel);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.preview {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 110px;
	padding: 10px 12px;
	overflow: hidden;
	background: var(--preview);
}

.preview img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.preview.tall {
	height: 180px;
}

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

.info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
	padding: 10px 12px 12px;
}

.info-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.name {
	margin: 0;
	font-size: 15px;
	color: var(--name);
	overflow-wrap: anywhere;
}

.price {
	flex: none;
	font-size: 14px;
	font-weight: bold;
	color: var(--accent);
	white-space: nowrap;
}

.price small {
	font-weight: normal;
	color: var(--muted);
}

.desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--muted);
}

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

.badge {
	padding: 2px 8px;
	font-size: 12px;
	color: var(--muted);
	background-color: var(--btn);
	border-radius: 10px;
}

/* ---- previews ---- */

.chat {
	width: 100%;
	font: bold 13px Verdana, Tahoma, sans-serif;
	line-height: 1.5;
	color: #ffffff;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
	overflow-wrap: anywhere;
}

.chat + .chat {
	margin-top: 4px;
}

/* {random} picks a new color per message in game; cycle to show that. */
.random {
	animation: random 3.5s steps(1) infinite;
}

@keyframes random {
	0% { color: #FF0000; }
	14% { color: #FF8C00; }
	28% { color: #FFD700; }
	42% { color: #32CD32; }
	57% { color: #0000FF; }
	71% { color: #8A2BE2; }
	85% { color: #A50F79; }
}

.swatches {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	height: 8px;
}

.swatches span {
	flex: 1;
}

.clantag {
	font: bold 15px Verdana, Tahoma, sans-serif;
	color: #ffffff;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
	white-space: pre;
}

.clantag .player {
	margin-left: 10px;
	color: #99CCFF;
}

.emoticon {
	font-size: 22px;
	text-align: center;
	color: #ffffff;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
	overflow-wrap: anywhere;
}

/* Laser trails and tracers: a bright core with a glow in the item color. */
.beam {
	width: 85%;
	height: var(--width, 8px);
	border-radius: 999px;
	background: linear-gradient(var(--color), #ffffff 45%, #ffffff 55%, var(--color));
	box-shadow: 0 0 10px 2px var(--color);
}

.beam.tracer {
	height: 3px;
	transform: rotate(-12deg);
	background: linear-gradient(90deg, transparent, var(--color) 30%, #ffffff);
	box-shadow: 0 0 6px 1px var(--color);
}

.splat {
	width: 64px;
	height: 64px;
	border-radius: 46% 54% 42% 58% / 55% 45% 55% 45%;
	background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.45), transparent 45%), var(--color);
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.booster {
	text-align: center;
	font-family: Verdana, Tahoma, sans-serif;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}

.booster strong {
	display: block;
	font-size: 30px;
	color: var(--accent);
}

.booster span {
	font-size: 14px;
	color: #ffffff;
}

/* Sort and count no longer fit a side column: search takes the space left. */
@media (max-width: 760px) {
	.toolbar {
		grid-template-columns: 1fr auto;
	}

	.search {
		grid-column: 1;
	}
}

@media (max-width: 480px) {
	/* No room for both on one row: search fills it, tools go below. */
	.toolbar {
		grid-template-columns: 1fr;
	}

	.search {
		grid-column: 1;
	}

	.tools {
		justify-content: space-between;
	}

	/* Tabs wrap to several rows here, too tall to keep pinned. */
	.header {
		position: static;
		padding: 10px 16px;
	}

	.tab {
		padding: 8px 12px;
		font-size: 14px;
	}

	.content {
		padding: 0 16px 16px;
	}

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

@media (prefers-reduced-motion: reduce) {
	.random {
		animation: none;
	}
}
