.drawcenter {
  width: 100%;
}

.drawBar {
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-top-color: var(--lineBright);
  border-left-color: var(--lineBright);
  background: var(--headerBar);
  color: var(--title);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow:
    inset -1px -1px 0 var(--panelDeep),
    inset 1px 1px 0 rgba(231, 230, 204, 0.08);
}

.drawBar span:last-child {
  color: var(--lunarViolet);
}

.drawBar i {
  width: 1.25rem;
  height: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.18rem;
  border: 1px solid var(--line);
  border-top-color: var(--boneText);
  border-left-color: var(--boneText);
  border-right-color: var(--panelDeep);
  border-bottom-color: var(--panelDeep);
  border-radius: 1px;
  background: var(--headerBar);
  color: var(--text);
  font-style: normal;
  line-height: 1;
  box-shadow:
    inset 1px 1px 0 rgba(231, 230, 204, 0.12),
    inset -1px -1px 0 rgba(0, 0, 0, 0.48),
    1px 1px 0 rgba(0, 0, 0, 0.28);
}

.drawcenter > menu {
  min-height: 1.55rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: -1px 0 0;
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--line);
  border-top-color: var(--panelDeep);
  background: var(--bar);
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  list-style: none;
}

.drawcenter > menu li {
  margin: 0;
  padding: 0;
}

.drawWork {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  gap: 0.6rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-top: 0;
  background: var(--panelDeep);
}

.drawTools {
  align-self: start;
  display: grid;
  grid-template-columns: repeat(4, 2rem);
  justify-content: center;
  gap: 0.3rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-top-color: var(--lineBright);
  border-left-color: var(--lineBright);
  border-radius: 2px;
  background: var(--panel);
  box-shadow:
    inset 1px 1px 0 rgba(231, 230, 204, 0.08),
    inset -1px -1px 0 var(--panelDeep),
    2px 2px 0 var(--void);
}

.drawTools > p {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px dotted var(--line);
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-align: left;
}

.drawTools > p:first-child {
  margin-top: 0;
}

.drawTools output {
  grid-column: 1 / -1;
  min-height: 1.45rem;
  display: flex;
  align-items: center;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--line);
  border-top-color: var(--panelDeep);
  border-left-color: var(--panelDeep);
  border-right-color: var(--lineBright);
  border-bottom-color: var(--lineBright);
  border-radius: 1px;
  background: var(--panelDeep);
  color: var(--lunarViolet);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
}

.stroke-color,
#color-picker-wrapper {
  width: 1.7rem;
  height: 1.7rem;
  display: block;
  margin: 0;
  border: 1px solid var(--line);
  border-top-color: var(--boneText);
  border-left-color: var(--boneText);
  border-right-color: var(--panelDeep);
  border-bottom-color: var(--panelDeep);
  border-radius: 1px;
  box-shadow:
    inset 1px 1px 0 rgba(231, 230, 204, 0.14),
    inset -1px -1px 0 var(--panelDeep),
    2px 2px 0 var(--void);
  cursor: pointer;
}

.stroke-color:hover,
#color-picker-wrapper:hover {
  border-color: var(--lunarViolet);
}

#color-picker-wrapper {
  position: relative;
  width: 100%;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 1px;
  background: var(--bar) !important;
}

#color-picker-wrapper::before {
  position: absolute;
  left: 0.45rem;
  content: "CUSTOM";
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  pointer-events: none;
}

#color-picker {
  width: 2.2rem;
  height: 100%;
  display: block;
  padding: 0.12rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.slider {
  width: 100%;
  grid-column: 1 / -1;
  margin: 0.1rem 0 0.25rem;
  accent-color: var(--lunarViolet);
}

.slider {
  height: 1.15rem;
  appearance: none;
  background: transparent;
}

.slider::-webkit-slider-runnable-track {
  height: 0.34rem;
  border: 1px solid var(--line);
  border-top-color: var(--panelDeep);
  border-left-color: var(--panelDeep);
  border-radius: 1px;
  background: var(--bar);
  box-shadow: inset 1px 1px 0 rgba(0, 0, 0, 0.45);
}

.slider::-webkit-slider-thumb {
  width: 0.78rem;
  height: 1rem;
  margin-top: -0.4rem;
  appearance: none;
  border: 1px solid var(--line);
  border-top-color: var(--boneText);
  border-left-color: var(--boneText);
  border-right-color: var(--panelDeep);
  border-bottom-color: var(--panelDeep);
  border-radius: 1px;
  background: var(--headerBar);
  box-shadow: 1px 1px 0 var(--void);
}

.slider::-moz-range-track {
  height: 0.34rem;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--bar);
}

.slider::-moz-range-thumb {
  width: 0.78rem;
  height: 1rem;
  border: 1px solid var(--line);
  border-radius: 1px;
  background: var(--headerBar);
}

.drawTools button {
  grid-column: span 2;
  min-height: 1.9rem;
  margin: 0;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line);
  border-top-color: var(--boneText);
  border-left-color: var(--boneText);
  border-right-color: var(--panelDeep);
  border-bottom-color: var(--panelDeep);
  border-width: 2px;
  border-radius: 2px;
  background: var(--headerBar);
  color: var(--text);
  box-shadow: 2px 2px 0 var(--void);
  cursor: pointer;
}

.drawTools .drawToolButton {
  grid-column: span 1;
  width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.drawToolButton img {
  width: 1.5625rem;
  height: 1.5625rem;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.drawToolButton[aria-pressed="true"] {
  border-top-color: var(--panelDeep);
  border-left-color: var(--panelDeep);
  border-right-color: var(--lunarViolet);
  border-bottom-color: var(--lunarViolet);
  background: var(--container);
  box-shadow:
    inset 2px 2px 0 var(--void),
    inset -1px -1px 0 var(--lineBright),
    1px 1px 0 var(--void);
}

#drawboxcanvas[data-tool="fill"] {
  cursor: cell;
}

#drawboxcanvas[data-tool="eyedropper"] {
  cursor: copy;
}

.drawTools button:hover {
  border-top-color: var(--phosphor);
  border-left-color: var(--phosphor);
  border-right-color: var(--lunarViolet);
  border-bottom-color: var(--lunarViolet);
  background: var(--headerBar);
  color: var(--title);
}

.drawTools button:active {
  border-top-color: var(--panelDeep);
  border-left-color: var(--panelDeep);
  border-right-color: var(--lineBright);
  border-bottom-color: var(--lineBright);
  background: var(--panelDeep);
  box-shadow:
    inset 2px 2px 0 rgba(0, 0, 0, 0.62),
    inset -1px -1px 0 rgba(231, 230, 204, 0.06);
}

.drawTools button:disabled {
  opacity: 0.5;
  cursor: wait;
}

#submit {
  grid-column: 1 / -1;
  border-top-color: var(--phosphor);
  border-left-color: var(--phosphor);
  border-right-color: var(--panelDeep);
  border-bottom-color: var(--panelDeep);
  background: var(--lunarViolet);
  color: #000000;
  box-shadow: 2px 2px 0 var(--void);
}

#submit:hover {
  border-top-color: var(--phosphor);
  border-left-color: var(--phosphor);
  border-right-color: var(--panelDeep);
  border-bottom-color: var(--panelDeep);
  background: var(--lunarViolet);
  color: #000000;
}

#submit:active {
  border-top-color: var(--panelDeep);
  border-left-color: var(--panelDeep);
  border-right-color: var(--phosphor);
  border-bottom-color: var(--phosphor);
  background: var(--lunarViolet);
  color: #000000;
}

.drawTools > .mediaFx {
  width: 6.75rem;
  aspect-ratio: 1;
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 0.35rem;
  border: 1px solid var(--line);
  background: var(--panelDeep);
}

.drawTools > .mediaFx > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.drawCanvas {
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-top-color: var(--panelDeep);
  border-left-color: var(--panelDeep);
  background: var(--void);
  box-shadow:
    inset 1px 1px 0 rgba(0, 0, 0, 0.45),
    inset -1px -1px 0 rgba(231, 230, 204, 0.08),
    inset 0 0 0 2px rgba(154, 132, 152, 0.14);
}

#drawboxcanvas {
  width: min(100%, 31.25rem);
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--lineBright);
  background: #ffffff;
  cursor: crosshair;
  image-rendering: auto;
  touch-action: none;
}

.drawCanvas > p {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.panelBody > h2 {
  margin: 1rem 0 0;
  padding: 0.45rem 0.6rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panelDeep);
  color: var(--title);
  font-family: var(--fontTitle);
  font-size: 1.15rem;
  font-weight: 400;
}

.drawcenter + p {
  min-height: 1.4rem;
  margin: 0.65rem 0 0;
  color: var(--muted);
  text-align: center;
}

#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  padding: 0.75rem 0 0;
  color: var(--muted);
}

.image-container {
  min-width: 0;
  padding: 0.4rem;
  border: 1px solid var(--line);
  background: var(--panelDeep);
  text-align: center;
}

.image-container img {
  width: 100%;
  max-width: 12rem;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--lineBright);
  background: #ffffff;
  image-rendering: auto;
}

.image-container p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.panelBody > #gallery + p {
  margin: 0.8rem 0 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 56rem) {
  .drawWork {
    grid-template-columns: 1fr;
  }

  .drawTools {
    grid-template-columns: repeat(7, 2rem);
  }

  .drawTools > p,
  .drawTools output,
  .slider,
  #submit {
    grid-column: 1 / -1;
  }

  .drawTools button:not(#submit) {
    grid-column: span 2;
  }

  .drawToolButton {
    grid-column: span 1 !important;
  }
}

@media (max-width: 41.6rem) {
  .drawBar {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
  }

  .drawTools {
    grid-template-columns: repeat(4, 2rem);
  }

  .drawTools button:not(#submit) {
    grid-column: span 2;
  }

  #drawboxcanvas {
    max-height: 87.5vh;
  }

  #gallery {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  }
}
