:root {
  --app-bg-color: #F80; // #d5eae5;
  --app-color-canvas: #FFFFFF;
  --app-color-ink: #000000;
  --app-padding-unit: 10px;
  --app-pixel-size: 2;
  --app-canvas-width-resolution: 180px;
  --app-canvas-height-resolution: 180px;
  --app-canvas-width: calc( var(--app-canvas-width-resolution) * var(--app-pixel-size) );
  --app-canvas-height: calc( var(--app-canvas-height-resolution) * var(--app-pixel-size) );
  --app-modal-width: calc( var(--app-canvas-width) + calc( var(--app-padding-unit) * 2 ) );
  --app-modal-height: calc( 76px + calc( var(--app-canvas-height) + calc( var(--app-padding-unit) * 2 ) ) );
  --app-modal-marginleft: calc( 0px - ( var(--app-canvas-width-resolution) + var(--app-padding-unit) ) );
}

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
  display: block;
}
body {
  line-height: 1;
  #imgSource{
	  margin-right: 10px;
	  margin-top:4px;
	  float:right;
  }
  *, img, canvas {
	  user-select: none;	
  }
  canvas{
	  image-rendering: pixelated;
	  image-rendering: crisp-edges;
  }
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}


html, body{
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  touch-action: manipulation;
}
html {
  _max-width:767px;
}
body {
	image-rendering: optimizeSpeed;             /* STOP SMOOTHING, GIVE ME SPEED  */
	image-rendering: -moz-crisp-edges;          /* Firefox                        */
	image-rendering: -o-crisp-edges;            /* Opera                          */
	image-rendering: -webkit-optimize-contrast; /* Chrome (and eventually Safari) */
	image-rendering: pixelated;                 /* Universal support since 2021   */
	image-rendering: optimize-contrast;         /* CSS3 Proposed                  */
	-ms-interpolation-mode: nearest-neighbor;
	
  -webkit-font-smoothing:antialiased;
  background: var(--app-bg-color);
 background-image: url("../img/icon_glyph_bg.png");
 background-repeat: no-repeat;
 background-attachment: fixed;
 background-position: center bottom;
 background-size: 120px 120px;
 
  color: #ffffff;
  font-family: sans-serif;
  text-align: center;
  _align-items: center;
  justify-content: center;
  font-family: Helvetica, Arial, Trebuchet, Sans, Verdana, sans-serif;
}
html, body, #pagewrap {
  width:   100%;
}
#CANVASDATA {
	display: none;
	position: absolute;
	top: 10px;
	left: 10px;
	min-width: 360px;
	min-height: 360px;
	background: #FCF;
}
#pagewrap {
  position: fixed;
  text-align: center;
  _align-items: center;
  justify-content: center;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0);

  #canvas-wrap {
		margin: var(--app-padding-unit) auto;
		width: var(--app-canvas-width);
		height: var(--app-canvas-height);
		background: var(--app-color-canvas);
		&.watermark {
			background: var(--app-color-canvas) url("../img/water.png") no-repeat right top;
		}
	    #main-canvas {
			background-color: transparent;
			width: var(--app-canvas-width);
			height: var(--app-canvas-height);
			image-rendering: pixelated;
			image-rendering: optimizeSpeed;             /* Older versions of FF          */
			image-rendering: -moz-crisp-edges;          /* FF 6.0+                       */
			image-rendering: -webkit-optimize-contrast; /* Safari                        */
			image-rendering: -o-crisp-edges;            /* OS X & Windows Opera (12.02+) */
			image-rendering: pixelated;                 /* Awesome future-browsers       */
			-ms-interpolation-mode: nearest-neighbor;   /* IE                            */

	  }
  }



#modal-wrap {
	background: #000000CF;
  	min-width: var(--app-modal-width);
	min-height: var(--app-modal-height);

	&.splash{
		background: #00000099 url("../img/splash.png") no-repeat center 20%;
		min-height: 606px;
		#start {
			margin-top: 360px;
		}
		#uploader {
			display:none;
		}
		button {
			position: relative;
			margin: 20px auto;
			display: block;
			border-radius: 8px;
			padding: 1rem 2rem;
			background: #0006;
			color: white;
			border-color: var(--app-bg-color);
			font-weight: bold;
			font-size: 20px;
			min-width: 15rem;
			input {
				position: absolute;
				color: #f80;
				width: 100%;
				height: 3.5rem;
				top: 0;
				left: 0;
				opacity: 0.01;
			}
		}
	}
  position: absolute;
  top: 0;
  width: var(--app-modal-width);
  height: var(--app-modal-height);
  margin: 0 auto;
  left: 50%;
  margin-left: var(--app-modal-marginleft);
  vertical-align: bottom;
	div {
	  &#ui-paint{
		display:block;
  }
  ul {
		padding: 0 10px;
		text-align: left;
		li {
		  padding: 10px 0;
		  &.sub {
			padding-top:0;
		  }
		  label {
				padding-left: 10px;
				&:first-child {
				  padding-left: 0;
				  display: inline-block;
				  min-width: 5rem;
				}
				select {
					    margin-left: 5px;
				}
				a, a:visited {
					color: white;
					text-decoration: underline;
					cursor: pointer;
				}
				a:hover {
					text-decoration: dashed;
				}
		  }
		}
		#patterncanvas {
			position: relative;
			margin: 0 auto;
		}
		#pattern-canvas-guide {
			z-index: 2;
			top: -1px;
			left: -1px;
			display: grid;
			pointer-events: none;
			position: absolute;
			border: 1px solid rgba(0, 191, 255, 0.2);
		}
  	  }
  h5 {
		cursor: pointer;
		font-weight: bold;
		margin-top: 10px;
		border-top: dashed 2px white;
		padding: 10px 10px;
		text-align: right;
		small{
		  float:left;
		}
		&:hover{
			background: rgba(0,0,0,0.3);
		}
	}
	  h6{
		display: inline;
		padding-right: 8px;
	  }
	  position: absolute;
	  bottom: 0;
	  left: 0;
	  width: 100%;
	  
	}
}


section.content {
flex-direction: column;
  width: auto;
  _align-items: center;
  _text-align: center;
  justify-content: center;
}

button {
  background-color:#FFF;
  color:black;
  //text-shadow: #fff 1px 2px 2px;
}

#app-wrap{
	justify-content: center;

	text-align: center;
  align-items: center;
  fieldset {
	display: inline-block;
	border: 0;
		padding: 0;
	legend {
	  color: white;
	}
	label{
	  cursor: pointer;
	  color: black;
	  input {
			  cursor: pointer;

	  }
	}
  }

  #palette-wrap {
	clear: both;
	width: var(--app-canvas-width);
	margin: 0 auto;
	display: grid;
	grid-gap: var(--app-padding-unit);
	grid-template-columns: repeat(7, 43px 1fr);
	grid-template-rows: repeat(3, auto) ;
	grid-auto-flow: column;
	padding-top: 10px;
	padding-bottom: 10px;
	* {
		image-rendering: crisp-edges;/// pixelated;
		aspect-ratio: 1 / 1;
		///border: 2px inset #c1fbed;
		background-size: 100%;
		background-repeat: no-repeat;
		&.active{
			border-color: #f80;
		}
		&.fill {
			_image-rendering: pixelated;
			-background-size: 100%;
			_background-repeat: repeat;
		}
		&.nib {
			color:white;
		}
		min-width: 43px;
		min-height: 44px;
		border-style: inset;
		border-color: #c1fbed;
		border-width:5px;
		border-radius: 5px;
		padding: 1px;
		font-size: 100%;
		cursor: pointer;
		color: black;
		//text-shadow: #fff 1px 2px 2px;
		image-rendering: pixelated; /* Webkit (non-standard naming)*/
		-ms-interpolation-mode: nearest-neighbor;
   }
 }
 #activity-btn {
	width: var(--app-canvas-width);
	margin: 0 auto;

	display: flex;
	justify-content: space-between;
	
	#uileft-wrap, #uiright-wrap {
		display: flex;
		gap: var(--app-padding-unit);
		a, a:visited {
			user-select: none;
			color: white;
			text-decoration: none;
			cursor: pointer;
			text-shadow: #317a6a 1px 2px 2px;
			padding: 0;
			border-radius: 6px;
			border: 2px dashed #fff;
			background: #FFF7 url("../img/tool_icons.png?werwer") no-repeat center 20%;
			image-rendering: pixelated;
			background-size: 800%;
			background-position-x: 0px;
			min-width: 45px;
			min-height: 37px;			
		}
		a:hover {
			text-decoration: underline;
		}
		a#text {
			background-position-x: -52px;
		}
		a#allpix {
			background-position-x: -100px;
		}
		a#undo {
			background-position-x: -151px;
		}
		a#redo {
			background-position-x: -193px;
		}
		a#savecanvas {
			background-position-x: -239px;
		}
		a#settings {
			background-position-x: -282px;
		}
	    button {
			user-select: none;
			font-size: 12px;
			padding: 8px 6px;
			cursor: pointer;
			background: #EEE;
			color: #333;
			border-color: rgba(233,233,233,0.5);
			border-width: 1px;
			border-radius: 5px;
			&#strokeButton_ {
			background-image: url('./phantom_bg.png');
			background-size: 22%;
			background-repeat: no-repeat;
		}
		&.active{
		  border-color: #f80;
		}
		&:hover {
		  background: #DDD;
		  color: black;
		}
		span.phantom-check {
		  visibility: hidden;
		  color: #f80;
		  font-weight: bold;
		  display: inline-block;
		  width: 19px;
		  line-height: 12px;
		  vertical-align: middle;
		}
		&.active {
		  span.phantom-check {
			visibility: visible;
		  }
		}
	  }
  	}

   }
 }
 }
}

.hidden {
  visibility:hidden;
}



@media screen and (max-width:768px) {
  html, body {
	overflow: hidden;
  }
}