@keyframes gradientAnimation {
	0% {
		background-position: 0% 50%;
	}

	50% {
		background-position: 100% 50%;
	}

	100% {
		background-position: 0% 50%;
	}
}

@font-face {
	font-family: 'PixelFont';
	src: url('pixel-inet.ttf') format('truetype');
	font-display: swap;
}

body {
	background-color: black;
	font-family: 'PixelFont', 'Courier New', monospace;
	display: flex;
	flex-direction: column;
	height: 100dvh;
	margin: 0;
	padding: 20px 40px;
	box-sizing: border-box;
	overflow: hidden;
}

.title-header {
	color: transparent;
	text-align: left;
	font-family: monospace;
	font-size: clamp(4px, 1vw, 14px);
	background: linear-gradient(to right, #5bc0de, #d9534f, #5cb85c, #f0ad4e, #5bc0de);
	background-size: 200% 100%;
	-webkit-background-clip: text;
	background-clip: text;
	white-space: pre;
	pointer-events: none;
	animation: gradientAnimation 15s ease infinite;
	align-self: flex-end;
	margin: 0;
	max-width: 100%;
	overflow-x: auto;
}

@media (max-width: 768px) {
	body {
		padding: 20px;
	}
	.title-header {
		align-self: center;
		text-align: center;
	}
}

.key {
	font-size: x-large;
	color: rgb(2, 246, 2);
}

.value {
	color: lightgreen;
}

.quote {
	font-weight: bold;
	font-size: x-large;
	color: white;
}

.colon,
.comma {
	color: #d9534f;
}

.link {
	color: rgb(0, 159, 255);
	text-decoration: underline;
}

pre {
	white-space: pre-wrap;
	/* Ensures that the formatting of the JSON is preserved */
	word-wrap: break-word;
	/* Ensures long lines wrap within the container */
}

#json-container {
	font-family: 'PixelFont', 'Courier New', monospace;
	padding: 0;
	border-radius: 5px;
	/* The block carries the sites list as well as the company card, and body is
	   height:100dvh with overflow:hidden — on a phone, where it stacks above the
	   widget row instead of sitting beside it, a fixed 20px clips the last
	   lines. Scaling down below 768px keeps the whole block on screen; desktop
	   still lands on 20px. */
	font-size: clamp(14px, 2.6vw, 20px);
	max-width: 100%;
	margin-top: auto;
	align-self: flex-start;
}

.json-brace,
.json-bracket {
	color: #aaaaaa;
}

.json-key {
	color: #d9534f;
}

.json-colon,
.json-comma {
	color: #aaaaaa;
}

.json-value {
	color: #5bc0de;
}

.json-quote {
	color: #5bc0de;
}

.json-number {
	color: #f0ad4e;
}

.json-boolean,
.json-null {
	color: #9b59b6;
}

.json-link {
	color: #5cb85c;
	text-decoration: none;
}

.json-link:hover {
	text-decoration: underline;
}

/* Bottom content layout */
.bottom-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	gap: 40px;
	width: 100%;
}

.bottom-content #json-container {
	margin-top: 0;
	/* Let the JSON rewrap when space is tight so the widget row, which cannot
	   reflow without dropping an app onto a second line, keeps its row. */
	min-width: 0;
}

/* App widgets container */
/*
 * One row, always — the apps are meant to read as a single menu. The labels are
 * full names without tracking, which is what makes four of them fit; nowrap
 * keeps them on one line each so a long name cannot break the row's rhythm.
 */
.app-widgets {
	display: flex;
	flex-wrap: nowrap;
	justify-content: flex-end;
	gap: 24px;
	align-items: flex-start;
	padding-right: 40px;
}

/* App widget — one block for every app, accent supplied per app below */
.app-widget {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	opacity: 0.5;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.app-widget.oldgold {
	--accent: #CFB53B;
}

.app-widget.quiverbooks {
	--accent: #5cb85c;
}

.app-widget.psydex {
	--accent: #e6b800;
}

.app-widget.tallystick {
	--accent: #4FBF87;
}

.app-widget:hover,
.app-widget:focus-visible {
	opacity: 0.85;
}

.app-widget:hover .app-icon,
.app-widget:focus-visible .app-icon {
	filter: grayscale(0.6) brightness(0.8);
}

.app-icon {
	width: 80px;
	height: 80px;
	object-fit: contain;
	image-rendering: pixelated;
	filter: grayscale(1) brightness(0.6);
}

.app-label {
	color: #888;
	font-family: monospace;
	font-size: clamp(9px, 1.2vw, 16px);
	text-align: center;
	white-space: nowrap;
}

.app-version {
	color: #666;
	font-family: monospace;
	font-size: clamp(8px, 1vw, 13px);
}

/*
 * The menu cursor. It always occupies its line so that hovering one widget
 * never nudges the row; only its visibility changes. steps(1) makes it snap
 * on and off the way a game menu does, rather than fading.
 */
.app-select {
	color: var(--accent);
	font-family: monospace;
	font-size: clamp(8px, 1vw, 13px);
	letter-spacing: 2px;
	visibility: hidden;
}

.app-widget:hover .app-select,
.app-widget:focus-visible .app-select {
	visibility: visible;
	animation: blink 0.8s steps(1, end) infinite;
}

@keyframes blink {
	50% {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.app-widget:hover .app-select,
	.app-widget:focus-visible .app-select {
		animation: none;
	}
}

@media (max-width: 768px) {
	.bottom-content {
		flex-direction: column;
		align-items: flex-start;
		gap: 30px;
	}

	.app-widgets {
		align-self: center;
		justify-content: center;
		max-width: 100%;
		gap: 20px;
		padding-right: 0;
	}
}

/*
 * Phones. The row still may not wrap, so the icons give up the space instead —
 * the widest label ("OLD GOLD CLASSIC") sets the floor for how narrow a widget
 * can get, and shrinking the art is what keeps all four on the line.
 */
@media (max-width: 480px) {
	.app-widgets {
		gap: 10px;
	}

	.app-icon {
		width: 64px;
		height: 64px;
	}
}

@media (max-width: 360px) {
	.app-widgets {
		gap: 6px;
	}

	.app-icon {
		width: 52px;
		height: 52px;
	}
}

.error-banner {
	position: fixed;
	top: -50px;
	/* Start off-screen */
	left: 0;
	right: 0;
	background-color: #f44336;
	color: white;
	text-align: center;
	padding: 10px;
	font-size: 16px;
	z-index: 1000;
	transition: top 0.5s ease;
}

.error-banner.show {
	top: 0;
	/* Slide down to top of the screen */
}