*{
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
:root{
  --gradientStart:#89253e;
  --gradientEnd:#3a6186;
  --boxColor:#f0f0f0;
  --borderCanvas:#cccccc;
  --lineGrid:#99999945;
  --borderPicker:#8a8a8a;
  --buttonActive:#3a6186;
}
@font-face {
    font-family: 'depixel';
    src: url(./font/DePixelHalbfett.otf);
    font-display: swap;
}

body{
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  width: 100%;
  font-family: 'depixel';
  background: var(--gradientEnd);
  background: linear-gradient(to right, var(--gradientStart), var(--gradientEnd));
}
.flex-center {display: flex; align-items: center;justify-content: center;}
.wrap {flex-wrap: wrap;}
main{
  width: 768px;
  padding: 20px;
  border-radius: 10px;
  flex-direction: column;
  gap: 20px;
  background-color: var(--boxColor);
  box-shadow: 0px 0px 20px 0px black;
  user-select: none;
}
.title {font-weight: bold; font-size: 18px;}
.menu {gap: 10px; position: relative;}
.menu__button--draw { background: url('img/pencil.svg'); background-size: 70%;}
.menu__button--erase { background: url('img/eraser.svg'); background-size: 80%;}
.menu__button--trash { background: url('img/trash.svg'); background-size: 90%; }
.menu__button--save { background: url('img/save.svg'); background-size: 75%;}
.menu__button--grid { background: url('img/grid.svg'); background-size: 80%; }
.menu__button{
  height: 50px;
  width: 50px;
  border: 2px solid black;
  border-radius: 5px;
  cursor: pointer;
  background-position: center;
  background-repeat: no-repeat;
}
.active {
  outline: 2px solid var(--buttonActive);
  outline-offset: 1px;
  box-shadow: inset 0px 0px 15px 1px var(--buttonActive)
}
.picker{
  width: 50px;
  height: 50px;
  position: relative;
  border: 2px solid black;
  border-radius: 5px;
  cursor: pointer;
}
.picker__color{
  display: block;
  width: 38px;
  height: 35px;
  border: 1px solid black;
  background-color: black;
}
.picker__overlay{
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  visibility: hidden;
  border-radius: 5px;
  z-index: 2;
}
.canvas{
  border-radius: 3px;
  outline: 2px solid var(--borderCanvas);
  position: relative;
  display: flex;
  overflow: hidden;
}
.grid{
  pointer-events: none;
  position: absolute;
  inset: 0;
}
.grid--active{
  background-image: linear-gradient(var(--lineGrid) 1px, transparent 0px), linear-gradient(to right, var(--lineGrid) 1px, transparent 0px);
  background-size: 8px 8px;
  background-origin: border-box;
  background-position: left -0.5px top -0.5px;
}
.cursorEraser {cursor: url('data:image/svg+xml;utf8,<svg width="18" height="18" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m 16.2,3.56 5,4.94 c 0.8,0.79 0.8,2.1 0,2.8 L 12,20.5 c -1.6,1.6 -4.09,1.6 -5.66,0 L 2.81,17 c -0.78,-0.8 -0.78,-2 0,-2.8 L 13.4,3.56 c 0.8,-0.78 2.1,-0.78 2.8,0" /><path d="m 4.22,15.6 3.54,3.5 c 0.78,0.8 2.04,0.8 2.84,0 l 3.5,-3.5 -4.93,-5 z" fill="%23ffffff" /></svg>')4 16, auto;}

/*::::::: Styles for colorpicker :::::::*/

.color-picker {
  width: 300px;
  background-color: var(--boxColor);
  position: absolute;
  left: 50%;
  transform: translate(-50%, 0%);
  padding-bottom: 20px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px #00000066;
  display: flex;
  flex-direction: column;
  gap: 10px;
  visibility: hidden;
}
.overlay{
  position: absolute;
  inset: 0;
  visibility: hidden;
}
.overlay--confirm {background-color: #000000b9;}
.panel-spectrum {
  height: 140px;
  position: relative;
  overflow: hidden;
}
.panel-spectrum__canvas {cursor: crosshair;}
.cursor {
  width: 20px;
  height: 20px;
  border-radius: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}
.cursor--spectrum {
  margin-left:-10px;
  margin-top: -10px;
  border: 1px solid #ffffff4d;
  outline: 2px solid #217ae0;
  outline-offset: -5px;
  background-color: transparent;
  box-shadow: 0px 3px 5px 1px #00000073;
  cursor: move;
}
.panel-options {height: 30px;gap: 10px;}
.icon{
  stroke: currentColor;
  fill: currentColor;
  width:20px;
  height:20px;
}
.panel-options__eyedropper {flex-basis: 20px;cursor: pointer;}
.panel-options__hue-map {
  flex-basis: 220px;
  height: 14px;
  margin-left: 10px;
  position: relative;
  font-family: none;
}
.hue-canvas {border-radius: 8px;cursor: crosshair;}
.cursor--color {
  margin-top: -3px;
  margin-left: -10px;
  background-color: #ececec;
  border: 1px solid #747474;
  cursor:e-resize;
}
.button-copy{
  height: 35px;
  width: 35px;
  padding: 4px;
  border: 2px solid var(--borderPicker);
  border-radius: 0 4px 4px 0;
  outline: none;
  color: var(--borderPicker);
  cursor: pointer;
}
.icon--copy {width:25px;height:25px;}
.panel-code__hex{
  height: 35px;
  border: 2px solid var(--borderPicker);
  border-radius: 0;
  border-right: none;
  font-family: monospace;
  font-size: 15px;
  background-color: transparent;
  color: black;
  text-align: center;
}
.panel-code__hex:focus-visible {outline: 0;}
.panel-code__hex:focus-visible.hex--succes {box-shadow: inset 0px 0px 10px 0px green;}
.hex--error {box-shadow: inset 0px 0px 10px 0px red;}
.bodyMove {cursor: move;}
.bodyEresize {cursor: e-resize;}

/*::::::::::::::::: styles for clear confirmation:::::::::::::::::::*/

.confirm{
  width: 320px;
  position: absolute;
  top: 30%;
  padding: 30px;
  border-radius: 5px;
  gap: 20px;
  background-color: var(--boxColor);
  visibility: hidden;
}
.confirm__message{
  flex-basis: 100%;
  text-align: center;
}
.confirm__button{
  font-family: inherit;
  padding: 5px 10px;
  border: 2px solid black;
  border-radius: 3px;
  cursor: pointer;
}
.show {visibility: visible;}

/*:::::::::::::::: Media queries :::::::::::::::::*/

@media screen and (max-width:768px) {
  main {width: 576px;}
  .canvas {grid-template-columns: repeat(53,10px);}
  .cell {height: 10px;}
  .grid--active{background-size: 10px 10px;}
}
@media screen and (max-width:576px) {
  main {width: 320px;}
  .canvas {grid-template-columns: repeat(26,10px);}
  .menu{ gap: 8px;}
  .menu__button,.picker {height: 37px; width: 37px;}
  .picker__color {width: 25px; height: 25px;}
}