/* Canvas and pixels */
.canvas {
  background-color: #757575;
  border: 2px solid black;
  padding: 20px;
  position: relative;
}

.pixel {
  background-color: #f9fffb;
  box-shadow: 1px 1px 0.5px #000;
  width: 1.5vw;
  height: 1.5vw;
  margin: 2px;
}

.pixelRow {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: nowrap;
  flex-wrap: nowrap;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.canvas-menu {
  border: 2px solid #000;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 0.5em;
}

/* Canvas name editing */
input {
  border: 2px solid #000;
  border-radius: 5px;
  padding: 0.4em;
  font-family: "VT323", monospace;
  font-size: 1.2rem;
  margin: 0.6em 0 0.6em 0;
}

.art-name-icon {
  font-size: 1.2em;
}

#name-edit {
  display: none;
}

#name-set {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.fa-edit,
.fa-check {
  border-radius: 50%;
  border: 2px solid #000;
  padding: 6px;
}

/* Reusable CSS color variables */
:root {
  --red: #d62828;
  --green: #9fd356;
  --blue: #3c91e6;
  --yellow: #ffca3a;
  --purple: #5b507a;
  --orange: #f4681d;
  --white: #ffffff;
  --black: #000000;
}

/* Palette and each color */

.box-wrap {
  margin: 1em;
  box-shadow: 4px 4px 0.1px #000;
}

.box-header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 0 1em 0 1em;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  border: 2px solid black;
  background: #fff;
  position: relative;
  z-index: 10;
}

.palette {
  background-color: #cfcbca;
  border: 2px solid black;
  border-top: none;
  padding: 1em;
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: auto auto auto;
  grid-template-columns: auto auto auto;
  justify-items: center;
}

#current-color {
  height: 30px;
  width: 30px;
}

#current-color .line {
  top: 1px;
  right: 5px;
  width: 31px;
  display: none;
}

.color {
  border-radius: 50%;
  border: 2px solid black;
  width: 40px;
  height: 40px;
  margin: 0.3em;
}

#color1,
.red {
  background-color: var(--red);
}
#color2,
.green {
  background-color: var(--green);
}
#color3,
.blue {
  background-color: var(--blue);
}
#color4,
.yellow {
  background-color: var(--yellow);
}
#color5,
.purple {
  background-color: var(--purple);
}
#color6,
.orange {
  background-color: var(--orange);
}
#color7,
.black {
  background-color: var(--black);
}
#color8,
.white {
  background-color: var(--white);
}

.line {
  width: 41px;
  height: 15px;
  border-bottom: 3px solid var(--red);
  transform: rotate(-45deg);
  position: relative;
  top: 6px;
  right: 6px;
}

/* Output */
.output {
  background-color: #cfcbca;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 2em;
  border: 2px solid #000;
  border-top: none;
}

.output-container {
  height: 16px;
  width: 16px;
  box-shadow: 1px 1px 0.5px #000;
}

.fa-save {
  font-size: 25px;
}

#save-button {
  background-color: #f9fffb;
  padding: 6px;
  border-radius: 50%;
  border: 2px solid #000;
  color: #000;
}

#save-button:hover,
button:hover,
.fa-check:hover,
.fa-edit:hover {
  background-color: #cfcbca;
}

/* UI */
button {
  border: 2px solid #000;
  background-color: #fff;
  font-size: 1.3rem;
  border-radius: 10px;
  font-family: "VT323", monospace;
}

/* Skeleton */
body {
  margin: 0;
  font-family: "Dosis", sans-serif;
}

.site {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  min-height: calc(100vh - 3.1em);
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
}

.container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: start;
  -ms-flex-align: start;
  align-items: flex-start;
}

header,
footer {
  background-color: #cfcbca;
}

header {
  border-bottom: 2px solid #000;
  text-align: center;
}

footer {
  height: 3em;
  border-top: 2px solid #000;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  padding: 0 1em 0 1em;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.fa-github,
.fa-github a {
  font-size: 25px;
  color: #000;
}

@keyframes rotate {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
.fa-github:hover {
  animation: rotate 3s infinite;
}

/* Fonts and links */
h1,
h2 {
  font-family: "VT323", monospace;
}

h1 {
  color: #000;
  font-size: 3rem;
}

a,
a:visited {
  color: var(--red);
  text-decoration: underline;
}
a:hover {
  text-decoration: none;
}

/* Media queries */
@media (max-width: 768px) {
  .right-col {
    width: 100%;
  }

  .pixel {
    width: 4.5vw;
    height: 4.5vw;
  }

  .palette {
    -webkit-box-pack: space-evenly;
    -ms-flex-pack: space-evenly;
    justify-content: space-evenly;
    -ms-grid-columns: auto auto auto auto auto;
    grid-template-columns: auto auto auto auto auto;
  }

  .box-wrap {
    width: 100%;
    margin: 1em 0;
    box-shadow: none;
  }

  .canvas {
    border: none;
  }

  .color {
    width: 50px;
    height: 50px;
    margin: 0.3em;
  }

  .line {
    width: 51px;
    height: 15px;
    top: 12px;
    right: 6px;
  }

  .box-header,
  .palette,
  .output,
  .canvas-menu {
    border-right: none;
    border-left: none;
  }

  button {
    font-size: 1.8em;
  }

  .fa-save {
    font-size: 35px;
  }

  .fa-check,
  .fa-edit {
    font-size: 25px;
  }

  footer {
    height: 4em;
  }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .pixel {
    width: 2.5vw;
    height: 2.5vw;
  }
}
