:root {
	--fixed-top: 0px;
	--fixed-height: 43px;
	--btn-font-size: 18px;
	--btn-font-color: black;
	--btn-bg-hover-color: yellow;
	--btn-bg-active-color: yellow;
	--btn-bg-normal-color: lightgray;
	--btn-outline: none;
	--btn-outline-offset: none;
}

html,
body {
	height: 100%;
	margin: 0;
	background: gray;
	color: #eee;
	font-family: sans-serif;
	overscroll-behavior-y: contain;
	touch-action: none;
}

.side-by-side {
	display: flex;
	align-items: center;
	gap: 5px;
}


#content {

	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 100;
}

.nav-tools {
	width: 100%;
}

.nav-tools button {
	width: 32px;
	height: 32px;
	color: var(--btn-font-color);
	background-color: var(--btn-bg-normal-color);
	outline: var(--btn-outline);
	outline-offset: var(--btn-outline-offset);
	cursor: pointer;
	text-align: center;
}

.nav-tools button:hover {
	background: var(--btn-bg-normal-color);
}

.panel-bottom button {

	width: 32px;
	height: 32px;
	flex: 0 0 auto;
	color: var(--btn-font-color);
	background-color: var(--btn-bg-normal-color);
	outline: var(--btn-outline);
	outline-offset: var(--btn-outline-offset);
	cursor: pointer;
	text-align: center;
}

.panel-bottom button:hover {
	background: var(--btn-bg-hover-color);
}

/* Grouped color tools */
.group {
	display: flex;
	justify-content: center;
}

.group button,
.group label {
	flex: 0 0 auto;
}

#url {
	width: 100px;
}

label {
	display: flex;
	flex-direction: column;
}

input[type=color] {
	width: 32px;
	padding: 0;
	border: none;
}

#stage {
	z-index: -1;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;

}

#stack {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(1);
	background-color: white;
}

#checkerboard {
	/* Transparent checkerboard background */
	background-image:
		linear-gradient(45deg, #ddd 25%, transparent 25%),
		linear-gradient(-45deg, #ddd 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #ddd 75%),
		linear-gradient(-45deg, transparent 75%, #ddd 75%);
	background-size: 20px 20px;
	background-position: 0 0, 0 10px, 10px -10px, -10px 0px;

	/* Make sure canvas itself stays transparent */
	background-color: transparent;
}

canvas {
	position: absolute;
	top: 0;
	left: 0;
	cursor: crosshair;
}

#stack canvas {
	position: absolute;
	top: 0;
	left: 0;
}

#overlay {
	pointer-events: none;
}


#bg {
	z-index: 0;
}

#draw {
	z-index: 0;
	image-rendering: pixelated;
	image-rendering: crisp-edges;
}


.sliders {
	flex-direction: column;
	display: flex;
	position: fixed;
	z-index: 100;
	top: 50%;
	left: 10px;
	transform: translateY(-50%);

}

.sliders button {
	width: 32px;
	height: 32px;
	color: var(--btn-font-color);
	background-color: var(--btn-bg-normal-color);
	outline: var(--btn-outline);
	outline-offset: var(--btn-outline-offset);

	flex: 0 0 auto;
	cursor: pointer;
	text-align: center;

}

.sliders button:hover {
	background: var(--btn-bg-hover-color);
}

#timeline-wrapper {
	z-index: 100;
}

.panel-bottom {
	position: fixed;
	left: 0px;
	color: black;
	cursor: pointer;
}

.timeline-background {
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	background-color: lightgray;

}

#timeline_v2 {
	user-select: none;
	position: fixed;
	top: var(--fixed-top);
	left: 0;
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	overflow-x: none;
	overflow-y: none;
	width: 100%;
	max-height: 40vh;
	text-align: center;
	color: var(--btn-font-color);
}

#timeline_v2 table {
	border-collapse: collapse;
	width: auto;
}

#timeline_v2 table tr td {}

.f {
	min-width: 20px;
	background: #f0f0f0;
	cursor: pointer;
}

.f.active {
	background: orange;
}


.control {
	display: flex;
	flex-direction: column;
	width: 40px;
	width: 100%;
	align-items: center;
	margin: 5px 0;
	gap: 5px;
}

.control-label {
	min-width: 80px;
}

.drag-btn {
	color: var(--btn-font-color);
	background-color: var(--btn-bg-normal-color);
	outline: var(--btn-outline);
	outline-offset: var(--btn-outline-offset);
	border:none;
	appearance: none;
	border-radius: 50%;
	user-select: none;
	touch-action: none;
	width: 48px;
	text-align: center;
	position: relative;
}

.drag-btn.dragging {
	background: var(--btn-bg-active-color);
}

.value-display {
	font-size: var(--btn-font-size);
	pointer-events: none;
}

.value-input {
	display: none;
	width: 60px;
	padding: 2px;
	text-align: center;
	font-size: var(--btn-font-size);
}

.editing .value-display {
	display: none;
}

.editing .value-input {
	display: inline-block;
}


.nav-toggle {
	position: fixed;
	bottom: 10px;
	left: 10px;
	z-index: 100;
	user-select: none;
}

.nav-toggle button {
	display: inline;
	width:32px;height:32px;
	font-size: var(--btn-font-size);
	cursor: pointer;
	color: var(--btn-font-color);
	background-color: var(--btn-bg-normal-color);
	outline: var(--btn-outline);
	outline-offset: var(--btn-outline-offset);
}

.nav-toggle button:hover {
	background: var(--btn-bg-hover-color);
}

.overlay-controls {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	gap: 12px;
	z-index: 1000;

}

.overlay-btn {
	color: var(--btn-font-color);
	background-color: var(--btn-bg-normal-color);
	outline: var(--btn-outline);
	outline-offset: var(--btn-outline-offset);
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	cursor: grab;
	font-size: var(--btn-font-size);
}

.overlay-btn:hover {
	background: var(--btn-bg-normal-color);
}


#settings {
	margin-right: 10px;
	text-align: center;
	width: auto;
	position: fixed;
	z-index: 100;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: lightgray;
	color: black;
	padding: 10px;
	font-size: var(--btn-font-size);
}


#settings button {
	width: auto;
	margin-top: 5px;
	color: var(--btn-font-color);
	background-color: var(--btn-bg-normal-color);
	outline: var(--btn-outline);
	outline-offset: var(--btn-outline-offset);
}

input[type=number] {
	appearance: textfield;
	width: 100%;
	font-size: var(--btn-font-size);
}

.anchor-controls {
	display: grid;
	grid-template-columns: auto auto auto;
	grid-template-rows: auto auto auto;
	gap: 0px;
	align-items: center;
	margin-top: 10px;
}

.anchor-controls button {
	width: 32px;
	height: 32px;
	font-size: var(--btn-font-size);
	cursor: pointer;
}

.anchor-controls button:hover {
	background: var(--btn-bg-normal-color);
}

/* Place buttons in grid like CSP anchor */
#resizeTop {
	grid-column: 2;
	grid-row: 1;
}

#resizeLeft {
	grid-column: 1;
	grid-row: 2;
}

#resizeCenter {
	grid-column: 2;
	grid-row: 2;
}

#resizeRight {
	grid-column: 3;
	grid-row: 2;
}

#resizeBottom {
	grid-column: 2;
	grid-row: 3;
}


@media (orientation: landscape) {}
}
