::-webkit-scrollbar {
	width: 0.625rem;
	height: 0.625rem;
}

::-webkit-scrollbar-thumb {
	background: #111;
	border-radius: 0.3125rem;
	box-shadow: inset 0.125rem 0.125rem 0.125rem rgba(255, 255, 255, 0.25),
		inset -0.125rem -0.125rem 0.125rem rgba(0, 0, 0, 0.25);
	cursor: default;
}

::-webkit-scrollbar-track {
	background: #333;
}

::selection {
	background: #fff;
	color: #333;
}

html,
body {
	height: 100vh;
	height: 100dvh;
	margin: 0;
	overflow: hidden;
}

body {
	display: grid;
	grid-template-rows: calc(100dvh - 4rem) 4rem;
	font-family: system-ui, sans-serif;
}

canvas,
.editor,
#controls {
	grid-row: 1;
	grid-column: 1;
}

canvas {
	--canvas-z-index: -1;
	width: 100%;
	height: auto;
	object-fit: contain;
	background: black;
	touch-action: none;
	z-index: var(--canvas-z-index);
}

.editor,
.overlay,
#error {
	font-family: "Courier New", Courier, monospace;
	background: repeating-linear-gradient(0deg, #000a, #1119, #000a 0.25rem);
	padding: 1em;
}

.editor {
	color: #fefefe;
	tab-size: 2;
	border: none;
	resize: none;
}

.editor:focus {
	outline: none;
}

#error {
	grid-row: 2;
	grid-column: 1;
	margin: 0;
	padding-block: 0;
	padding-top: 0.5em;
	color: firebrick;
	overflow: auto;
	text-wrap: pretty;
}

#indicator {
	visibility: hidden;
	position: absolute;
	top: calc(var(--top, 0px) - var(--scroll-top, 0px));
	width: 0;
	height: 0;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 10px solid firebrick;
	transform: translateY(-25%);
}

.overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	margin: 0;
}

.editor,
.overlay {
	font-size: 1rem;
	line-height: 1.2;
	white-space: pre;
}

#ticker-info {
	position: fixed;
	top: 1em;
	left: 2em;
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	z-index: 10;
}

.ticker {
	font-size: 2.5rem;
	font-weight: bold;
	color: #aef;
	text-shadow: 0 0 10px #aef, 0 0 20px #aef, 0 0 30px #aef;
	animation: glow 2s ease-in-out infinite;
	font-family: system-ui, sans-serif;
}

.tagline {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	font-size: 0.9rem;
	font-weight: 600;
	color: #fefefe;
	opacity: 0.8;
	font-family: system-ui, sans-serif;
	letter-spacing: 0.05em;
	padding-left: 0.2em;
}

.tagline div {
	animation: fadeSlideIn 0.5s ease-out forwards;
	opacity: 0;
}

.tagline div:nth-child(1) { animation-delay: 0.1s; }
.tagline div:nth-child(2) { animation-delay: 0.2s; }
.tagline div:nth-child(3) { animation-delay: 0.3s; }
.tagline div:nth-child(4) { animation-delay: 0.4s; }
.tagline div:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeSlideIn {
	from {
		opacity: 0;
		transform: translateX(-10px);
	}
	to {
		opacity: 0.8;
		transform: translateX(0);
	}
}

@keyframes glow {
	0%, 100% {
		text-shadow: 0 0 10px #aef, 0 0 20px #aef, 0 0 30px #aef;
	}
	50% {
		text-shadow: 0 0 15px #aef, 0 0 30px #aef, 0 0 45px #aef, 0 0 60px #aef;
	}
}

.ca-container {
	display: flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.5em 1em;
	background: #1111;
	border-radius: 4px;
	font-family: "Courier New", Courier, monospace;
	font-size: 0.85rem;
	backdrop-filter: blur(10px);
}

.ca-label {
	color: #aef;
	font-weight: bold;
}

.ca-address {
	color: #fefefe;
	user-select: all;
	cursor: text;
}

.copy-btn {
	all: unset;
	cursor: pointer;
	padding: 0.25em 0.5em;
	opacity: 0.6;
	transition: all 200ms ease-in-out;
	font-size: 1.1rem;
}

.copy-btn:hover {
	opacity: 1;
	transform: scale(1.1);
}

.copy-btn:active {
	transform: scale(0.95);
}

.copy-btn.copied {
	opacity: 1;
}

#controls {
	position: fixed;
	top: 1em;
	right: 2em;
}

.controls {
	position: relative;
	display: flex;
	gap: 1.5em;
	padding: 0.5em 1.25em;
	background: #1111;
	border-radius: 4px;
}

.controls::before,
.controls::after {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0;
	transform: scale(0.95);
	border-radius: inherit;
	opacity: 0;
}

.controls::before {
	background: #aef;
	animation: pulse 2s infinite;
}

.controls::after {
	background: #fefefe66;
	transition: transform 200ms ease-in-out;
}

.controls:hover::before,
.controls:hover::after {
	opacity: 1;
}

.controls:hover::before {
	transform: scale(0.98);
	filter: blur(2px);
}

.controls:hover::after {
	transform: scale(1.025, 1.1);
}

.controls:hover {
	background: #111f;
}

@keyframes pulse {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.0125);
	}

	100% {
		transform: scale(1);
	}
}

.hidden {
	display: none !important;
}

.opaque {
	opacity: 1 !important;
	background: #111 !important;
}

input {
	all: unset;
	opacity: 0.2;
	filter: saturate(0) invert(1);
	cursor: pointer;
	transition: opacity 200ms ease-in-out;
	padding: 0.25em 0.5em;
}

input:hover {
	opacity: 1;
}

.icon {
	text-align: center;
	line-height: 1;
}

#btnToggleView {
	width: 1.25em;
}

#btnToggleView::after {
	content: "👁";
}

#btnToggleView:checked::after {
	content: "✏️";
}

#btnToggleResolution::after {
	content: "1️⃣";
}

#btnToggleResolution:checked::after {
	content: "2️⃣";
}

#btnReset::after {
	content: "⏮️";
}