:root {
	--bg: #0f1724;
	--panel: #0b1220;
	--muted: #B2B2B2;
	--accent: #7dd3fc;
	--accent-darker: #6CB8D8;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	margin: 0;
	color: #B7B7B7;
	text-shadow: 1px 1px 1px black;
	font-size: 13px;
}

body {
	font-family: monospace;
	user-select: none;
}

main {
  display: flex;
  overflow: hidden;
}

main > * {
  min-width: 0;
  min-height: 0;
}

label option {
	color: black !important;
}

#right {
	display: flex;
	height: 100vh;
	min-width: 314px;
	z-index: 1000;
	//border-left: 3.5px solid #171717
}

#left {
	flex: 1;
	width: 100%;
	display: flex;
	flex-direction: column;
	height: 100vh;
	background-image: url("images/page-bg.png");
	background-repeat: repeat;
	background-size: 64px 64px;
}

#scrolable-view {
	flex: 1;
	max-width: 320px;
	min-height: 320px;
	width: 100%;
	padding: 12px;
	transform-origin: top left;
	background-image: url("images/page-bg.png");
	background-size: 64px 64px;
	border: 6px solid;
	border-left: 0px solid;
    border-image: url("images/border2.png") 19 fill repeat;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
	position: relative;

	overflow-y: auto;
	overflow-x: hidden;
}

details {
	padding-top: 6px;
}

.overlay-container {
	//position: absolute;
	bottom: 16px;
	width: 100%;
	height: 128px;
	padding-left: 16px;
	padding-right: 16px;
	//z-index: 20;
}

key-label {
	border-radius: 4px;
	padding-left: 4px;
	padding-right: 4px;
	font-size: 0.8em;
	background: rgba(0, 0, 0, 0.3);
}

.controls {
	display: flex;
	gap: 10px;
	margin-top: 10px;
	width: 100%;
	justify-content: center;
}

.quad-controls {
	display: flex;
	gap: 10px;
	width: 100%;
	height: 36px;
}

.quad-controls label {
	gap: 16px;
	width: 100%;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 5px solid;
	border-image: url("images/button.png") 32 fill repeat;
}

.quad-controls-child {
	display: flex;
	gap: 4px;
	height: 38px;
	width: 100%;
	justify-content: center;
}

button {
	flex: 1;
	padding-top: 0;
	//padding-bottom: 0;
	cursor: pointer;
	color: #B7B7B7;
	font-family: inherit;
	text-shadow: 1px 1px 1px black;
	box-shadow: 0 0 8px rgba(0, 0, 0, 1);
	border: 5px solid;
	border-image: url("images/button.png") 32 fill repeat;
	transition: 0.3s ease;
	font-size: inherit;
	max-height: 28px;
}

button:hover {
	//letter-spacing: 0.5px;
	filter: brightness(1.2);
}

.logo {
  	text-align: center;
	font-size: 14px;
}

.logo-large {
  	text-align: center;
	margin-top: 2px;
	filter: drop-shadow(0 0 6px rgb(0, 17, 43));
	animation: hueShift 10s linear infinite;
	transform-origin: center;
}

@keyframes hueShift {
  from {
    filter: drop-shadow(0 0 6px rgb(0, 17, 43)) hue-rotate(0deg);
  }
  to {
    filter: drop-shadow(0 0 6px rgb(0, 17, 43)) hue-rotate(360deg);
  }
}

.right-navbar {
	margin-top: 12px;
}

.main-link {
	display: inline;

}

.secondary-links {
	
}

#export-btn {
	max-width: 148px;
}

#export-all-btn {
	max-width: 148px;
}

#export-atlas-btn {
	max-width: 148px;
}

#link-btn {
	width: 100%;
	margin-bottom: 6px;
}

.top-navbar {
	display: inline;
	padding-left: 10px;
	padding-right: 10px;
	padding-bottom: 10px;
	background-image: url("images/page-bg.png");
	background-repeat: repeat;
	background-size: 64px 64px;
	border: 6px solid;
	border-image: url("images/border2.png") 19 fill repeat;
	box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
	z-index: 100;
}

.bottom-navbar {
  padding-top: 4px;
  padding-bottom: 4px;
  background-image: url("images/page-bg.png");
  background-repeat: repeat;
  background-size: 64px 64px;
  border: 6px solid;
  border-image: url("images/border2.png") 19 fill repeat;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6);
  z-index: 100;
}

#add-quad-btn,
#delete-quad-btn {
	width: 28px;
	height: 36px;
	padding-left: 0;
	padding-right: 0;
}

#add-quad-btn:hover,
#delete-quad-btn:hover {
	letter-spacing: normal;
}

#actions-container {
	display: flex;
}

.hint {
	color: var(--muted);
	text-align: center;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 5px solid;
	border-image: url("images/button2.png") 32 fill repeat;
	padding-bottom: 12px;


	//position: absolute;
	//bottom: 0;
	//left: 0;
	//right: 0;
	margin: 0;
}

.hint label {
	display: block;
	min-width: 100%;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 5px solid;
	border-image: url("images/button.png") 32 fill repeat;
	padding-bottom: 1px;
}

p {
	text-align: center;
}

#viewer-wrap {
	display: flex;
	flex: 1;
	min-height: 0;
	//gap: 8px;
	//margin: 12px;
	box-sizing: border-box;
	position: relative;
	background-image: url("images/transparency_tiles.png");
	background-repeat: repeat;
	background-size: 64px 64px;
	border-left: 6px solid;
	border-right: 6px solid;
	border-image: url("images/border.png") 19 fill repeat;
}

.zoom-label {
	position: absolute;
	top: 10px;
	left: 10px;
	color: white;
	font-family: inherit;
	pointer-events: none;
	padding-left: 0px;
	padding-right: 4px;
	padding-bottom: 2px;
	z-index: 100;
	//display: none;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 5px solid;
	border-image: url("images/button2.png") 32 fill repeat;
}

.navigation-info {
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: 10px;
	left: 20px;
	width: fit-content;
	margin: 0 auto;
	//gap: 8px;
	max-width: calc(100% - 40px);
	color: white;
	font-family: inherit;
	padding: 2px;
	z-index: 100;
}

.viewer-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	bottom: 10px;
	left: 10px;
	right: 10px;
	width: fit-content;
	margin: 0 auto;
	gap: 8px;
	max-width: calc(100% - 20px);
	color: white;
	font-family: inherit;
	padding: 2px;
	z-index: 100;
	max-height: 32px;
}

.viewer-controls.vc-stacked {
	flex-wrap: wrap-reverse;
}

.viewer-controls.vc-stacked > label {
	order: -1;
	flex-basis: 100%;
	display: flex;
	justify-content: center;
}

.viewer-controls.vc-stacked #quad-select {
	width: 100%;
}

.viewer-controls > label {
	align-self: stretch;
	display: flex;
	align-items: stretch;
	cursor: pointer;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
	border: none;
	background-image: url("images/page-bg-darker.png");
	background-size: 48px 48px;
	border-radius: 4px;
	background-color: white;
}

.viewer-controls #quad-select {
	height: 100%;
}

#viewer,
#preview-wrap {
	box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.6);
}

#viewer-panel {
	flex: 1;
	min-width: 128px;
	position: relative;
	overflow: hidden;
}

#viewer {
	display: block;
	width: 100%;
	height: 100%;
}

#preview-wrap {
	flex: 1;
	position: relative;
	overflow: hidden;
}

#preview-wrap .zoom-label {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 100;
}

#leftZoomLabel {
	top: 8px;
	left: 8px;
	z-index: 100;
}

#preview-wrap canvas {
	position: absolute;
	top: 0;
	left: 0;
	transform-origin: 0 0;
	max-width: none;
	max-height: none;
}

#splitter {
	width: 16px;
	cursor: col-resize;
	position: relative;
	border: 5px solid;
	border-image: url("images/splitter.png") 32 fill repeat;
}

#out-preview {
	display: block;
	/* Atlas boundary outline — drawn on overlay canvas, always uniform size.
     Edit these custom properties to change the look: */
	--atlas-outline-color: rgba(255, 255, 255, 1);
	--atlas-outline-width: 1;
	/* px */
	--atlas-outline-dash: 8;
	/* dash length px */
	--atlas-outline-gap: 6;
	/* gap length px */
}

#image-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 8px;
	padding-bottom: 8px;
	justify-content: center;
	//background-image: url("images/page-bg-darker.png");
	//background-size: 64px 64px;
	margin-top: 10px;
}

.img-slot {
	position: relative;
	width: 48px;
	height: 48px;
	cursor: pointer;
	overflow: hidden;
	flex-shrink: 0;
	outline: 2px solid transparent;
	transition: outline-color 0.15s;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.img-slot.active {
	outline-color: var(--accent);
}

.img-slot:hover:not(.active) {
	outline-color: rgba(255, 255, 255, 0.4);
}

.img-slot-thumb {
	width: 100%;
	height: 100%;
	object-fit: fill;
	display: block;
	pointer-events: none;
}

.img-slot-remove {
	position: absolute;
	top: 0px;
	right: 0px;
	width: 12px;
	height: 12px;
	background: rgba(0, 0, 0, 0.75);
	color: white;
	font-size: 6px;
	line-height: 11px;
	text-align: center;
	border-radius: 50%;
	cursor: pointer;
	display: none;
	user-select: none;
}

.img-slot:hover .img-slot-remove {
	display: block;
}

.img-slot-remove:hover {
	background: rgba(200, 0, 0, 0.75);
}

#preview-bottom-bar {
	position: absolute;
	bottom: 12px;
	left: 10px;
	right: 10px;
	width: fit-content;
	margin: 0 auto;
	max-width: calc(100% - 20px);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	z-index: 100;
	pointer-events: none;
}

#preview-bottom-bar > * {
	pointer-events: auto;
}

#spacing-label {
	display: inline-flex;
	gap: 4px;
	font-weight: normal;
	white-space: nowrap;
	cursor: pointer;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
	border: none;
	background-image: url("images/page-bg-darker.png");
	background-size: 48px 48px;
	padding: 4px 4px 4px 8px;
	max-height: 28px;
	border-radius: 4px;
	background-color: white;
}

#square-controls {
	display: flex;
	flex-wrap: wrap-reverse;
	justify-content: center;
	max-width: 100%;
	gap: 8px;
	align-items: center;
	pointer-events: auto;
}

#square-mode {
	cursor: pointer;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
	border: none;
	background-image: url("images/page-bg-darker.png");
	background-size: 48px 48px;
	max-width: 84px;
	height: 24px;
	border-radius: 4px;
	padding-left: 8px;
}

#square-btn {
	flex: none;
	white-space: nowrap;
	width: 112px;
	height: 32px;
}

#gridSize {
	cursor: pointer;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
	border: none;
	background-image: url("images/page-bg-darker.png");
	background-size: 48px 48px;
	padding: 3px 4px 4px 8px;
	height: 100%;
	border-radius: 4px;

}

#spacing-label {
	flex-shrink: 0;
}

#spacing-wrap {
	display: inline-flex;
	align-items: stretch;
	background-color: transparent;
	cursor: pointer;
}

#atlas-spacing {
	cursor: pointer;
	background: transparent;
	border: none;
	outline: none;
	color: #B7B7B7;
	font-family: inherit;
	font-size: inherit;
	font-weight: normal;
	text-align: center;
	-webkit-appearance: textfield;
	appearance: textfield;
	padding: 0;
}

#atlas-spacing::-webkit-inner-spin-button,
#atlas-spacing::-webkit-outer-spin-button {
	-webkit-appearance: none;
}

#spacing-arrows {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding-left: 4px;
	padding-right: 6px;
	cursor: pointer;
	transform: scaleX(220%);
}

#spacing-up,
#spacing-down {
	display: block;
	width: 0;
	height: 0;
	user-select: none;
	cursor: pointer;
}

#spacing-up {
	border-left: 3px solid transparent;
	border-right: 3px solid transparent;
	border-bottom: 4px solid rgba(255, 255, 255, 0.75);
}

#spacing-down {
	border-left: 3px solid transparent;
	border-right: 3px solid transparent;
	border-top: 4px solid rgba(255, 255, 255, 0.75);
}

#spacing-up:hover {
	border-bottom-color: white;
}

#spacing-down:hover {
	border-top-color: white;
}

#export-format,
#export-resolution {
	cursor: pointer;
	color: inherit;
	font-family: inherit;
	font-size: inherit;
	box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
	border: none;
	background-image: url("images/page-bg-darker.png");
	background-size: 48px 48px;
	padding: 4px 4px 4px 8px;
	border-radius: 4px;
}

#export-format option,
#export-resolution option,
#square-mode option,
#gridSize option,
#quad-select option,
#atlas-spacing option {
	color: black !important;
	background: white;
}

#quad-select {
	cursor: pointer;
	width: 128px;
	text-align: center;
	background-color: transparent;
	border-color: transparent;
	color: #B7B7B7;
}

#sliders {
	display: contents;
	min-width: 100%;
	margin-top: 10px;
	font-size: inherit;
	color: var(--muted);
	text-align: center;
	padding-bottom: 12px;
	padding-bottom: 8px;
}

#sliders label {
	display: block;
	min-width: 100%;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 5px solid;
	border-image: url("images/button.png") 32 fill repeat;
	padding-bottom: 1px;
}

#sliders summary {
	cursor: pointer;
}

.dropdown-header {
	display: block;
	min-width: 100%;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 5px solid;
	border-image: url("images/button.png") 32 fill repeat;
	padding-bottom: 1px;
	font-size: inherit;
}

.horizontal-spacer {
	width: 2px;
	height: 48px;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	background-image: url("images/button.png");
}

.dropdown-body {
	display: block;
	min-width: 100%;
	margin-top: 10px;
	font-size: inherit;
	color: var(--muted);
	text-align: center;
	//background-image: url("images/page-bg-darker.png");
	//background-size: 64px 64px;
	padding: 12px;
}

.dropdown-body label {
	display: block;
	min-width: 100%;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
	border: 5px solid;
	border-image: url("images/button.png") 32 fill repeat;
	padding-bottom: 1px;
}


#sharpness-control,
#contrast-control {
	width: 100%;
	display: grid;
	text-align: center;
	margin-bottom: 12px;
}

#contrast-control {
	margin-bottom: -8px;
}

#sharpness-control label,
#contrast-control label {
	font-size: inherit;
}

#sharpness-slider,
#contrast-slider {
  -webkit-appearance: none;
  width: auto;
  height: 6px;
  background: #0e0e0e;
  outline: none;
  margin-top: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}

#sharpness-slider::-webkit-slider-thumb,
#contrast-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 6px;
  height: 14px;
  background: #04AA6D;
  border-radius: 4px;
  cursor: pointer;
}

#sharpness-slider::-moz-range-thumb,
#contrast-slider::-moz-range-thumb {
  width: 6px;
  height: 14px;
  border-radius: 4px;
  cursor: pointer;
}

.custom-scroll {
  scrollbar-width: thin;
  scrollbar-color: #444 #0f0f0f;
}

.custom-scroll::-webkit-scrollbar {
  width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background-color: #2a2a2a;
  border-radius: 999px;
}

html {
  scrollbar-width: thin;
  scrollbar-color: #444 #0f0f0f;
  background: #0f0f0f;
}

#gridOverlay {
  display: none;
  pointer-events: none;
}