/* sprites/index.css */

html {
  --tile-zoom-scale: 3;
  --scale: 16px;
  --transparent-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><rect stroke='black' stroke-width='0.2' stroke-opacity='100%' fill='%23eee' width='32' height='32' x='0' y='0' /><rect fill='white' width='16' height='16' x='1' y='1' /><rect fill='white' width='15' height='15' x='16' y='16' /></svg>");
  --transparent-image-8: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='64'><rect stroke='black' stroke-width='0.2' stroke-opacity='100%' fill='%23eee' width='64' height='64' x='0' y='0' /><rect fill='white' width='32' height='32' x='1' y='1' /><rect fill='white' width='31' height='31' x='32' y='32' /></svg>");
  --size: calc(16 * var(--scale) * 2);
  --c-fg: #fff;
  --c-bg: #373737;
  --c-focus: #262626;
  --c-light-text: rgba(255, 255, 255, 0.3);
}

body {
  --data-scale: 16px;
}

body[data-scale='8'] {
  --data-scale: 8px;
}

html[data-transparency='black'] {
  --transparent-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><rect fill='black' width='32' height='32' x='0' y='0' /></svg>");
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 20px;
}

a {
  color: white;
  font-weight: 400;
}

main {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin: 20px 0px;
  flex-wrap: no-wrap;
  align-items: flex-start;
  justify-content: space-evenly;
}

input {
  background: #373737;
  color: #fff;
}

input[type='text'],
input[type='number'] {
  /* border: 1px solid; */
  border: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

select,
option {
  color: black;
}

#sprite-editor > div {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
}

main :not(input, textarea) {
  user-select: none !important;
}

section {
  /* width: var(--size);
  text-align: center; */
  margin: 0 auto;
}

*,
*:before,
*:after {
  color: var(--c-fg);
  font-family: 'source code pro', 'ubuntu Mono', monospace;
}

.sprite {
  display: flex;
  flex-wrap: wrap;
  width: var(--block-size);
  height: var(--block-size);
}

.sprite > div {
  height: var(--scale);
  width: var(--scale);
}

.tools h1 {
  background: black;
  color: white;
}

.tools input[type='number'] {
  font-size: 12px;
}

h2 {
  /* display: none; */
  margin: 0;
}

#sprite-editor .palette {
  --scale: 12px;
  width: calc(17 * var(--scale));
  height: calc(16 * var(--scale));
  position: relative;
  order: 3;
  display: flex;
}

[data-bit='8'] #sprite-editor .palette {
  --scale: 12px;
  width: calc(16 * var(--scale));
}

.pickerColour {
  order: 2;
  display: flex;
  flex-direction: row;
  flex-grow: 1;
  margin-bottom: 16px;
  position: relative;
}

#sprite-editor .pickerColour {
  padding-bottom: 28px;
  margin-top: 0;
}

#sprite-editor .pickerColour:after {
  content: 'alt+click to pick from sprite';
  font-size: 9px;
  position: absolute;
  bottom: 0;
  text-align: center;
  width: 100%;
}

.pickerColour[data-selected='1'] div:nth-child(1),
.pickerColour[data-selected='2'] div:nth-child(2),
.pickerColour[data-selected='3'] div:nth-child(3),
.pickerColour[data-selected='4'] div:nth-child(4),
.pickerColour[data-selected='5'] div:nth-child(5),
.pickerColour[data-selected='6'] div:nth-child(6),
.pickerColour[data-selected='7'] div:nth-child(7),
.pickerColour[data-selected='8'] div:nth-child(8) {
  outline: 2px dashed yellow;
  z-index: 10;
}

.pickerColour div {
  --scale: 24px;
  cursor: pointer;
  /*! width: calc(16 * var(--scale) / 12); */
  width: calc(16 * var(--scale) / 16);
  height: 40px;
  position: relative;
}

#picker {
  display: flex;
  flex-direction: column;
}

#picker:before {
  text-align: center;
  width: 100%;
  content: 'Colour Picker';
  display: block;
  color: white;
  padding: 8px 4px;
  background: black;
  font-size: 80%;
  /* position: absolute; */
  top: 0;
}

.picker div {
  cursor: crosshair;
}

.picker div:hover {
  cursor: crosshair;
  outline: 1px dashed yellow;
  z-index: 11;
}

.pickerColour div[title~='transparent'],
.picker div[title~='transparent'],
.picker div.transparent {
  background: none;
}

#palette .picker.sprite > div.lock {
  outline: 2px dashed yellow;
  z-index: 10;
}

canvas {
  background: var(--transparent-image);
}

[data-scale='8'] canvas#container {
  background: var(--transparent-image-8);
}

#container {
  cursor: crosshair;
  border-radius: 2px;
  --block-size: calc(var(--size));
}

[data-tool='pan'] #container {
  cursor: move;
}

#container div:hover {
  cursor: crosshair;
  outline: 1px dashed yellow;
  z-index: 10;
}

#container div {
  margin: 0px;
  cursor: crosshair;
}

#sprites {
  display: flex;
  flex-direction: column;
  margin-right: 20px;
}

#sprites .container {
  --block-size: 32px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0 20px;
  width: calc(4 * var(--block-size));
  cursor: pointer;
  order: 4;
}

#sprites .container > div {
  --scale: 32px;
  margin: 0;
}

#sprites .container > .focus {
  outline: 1px dashed rgb(255, 255, 0);
  z-index: 1;
}

#sprites .container > div > div {
  height: calc(var(--scale) / 16);
  width: calc(var(--scale) / 16);
}

button,
.button {
  margin: 0;
  display: block;
  width: 100%;
  margin-bottom: 8px;
  background: #111;
  border: 2px solid #111;
  border-radius: 3px;
}

button:hover,
.button:hover {
  background: #212121;
  outline: none;
  border-color: #000;
}

.button:focus,
button:focus {
  background: #212121;
  border-color: #000;
}

button:active,
.button:active {
  background: #333;
}

.button-group {
  display: flex;
  flex-direction: row;
  margin-bottom: 8px;
}

.button-group button,
.button-group .button {
  width: auto;
  flex: 1;
  margin: 0;
  margin-right: 8px;
}

.button-spacer {
  margin-top: 24px;
}

.button-group > :last-child {
  margin-right: 0;
}

button img,
button svg {
  pointer-events: none;
  display: block;
  margin: 0 auto;
}

#tools {
  flex-direction: column;
}

.tools {
  display: flex;
  /* flex-wrap: wrap; */
  /* background: #303030; */
  padding: 20px;
  margin-left: 20px;
}

.tools h2 {
  width: 100%;
  margin-top: 0;
}

.tools h3 {
  width: 100%;
  margin-bottom: 0;
}

.tools > div {
  margin-bottom: 8px;
}

.tools > div + div {
  margin: 8px auto;
}

.input-button {
  display: flex;
  position: relative;
  cursor: pointer !important;
  justify-content: center;
  overflow: hidden;
}

.input-button input {
  z-index: 10;
  width: 100%;
  cursor: pointer !important;
  opacity: 0;
  display: block;
  position: absolute;
  margin: 0 !important;
  padding-left: 100%;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
}

#debug {
  text-align: center;
}

#tiles {
  display: flex;
  flex-direction: row-reverse;
  overflow: scroll;
  justify-content: center;
  width: 100%;
}

#tiles .container {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}

.tile-controls {
  min-width: 300px;
  flex: 0;
  margin-right: auto;
  padding: 20px;
  margin-left: 20px;
  display: block;
}

.tile-controls.tools a:last-child {
  margin-top: 16px;
  display: block;
}

.tile-controls.tools span.input-button,
.tile-controls.tools button.download-btn {
  margin-bottom: 8px;
}

.tile-controls > div + div {
  margin-bottom: 16px;
}

.tile-controls label {
  display: block;
}

.tile-controls input {
  font-size: inherit;
  /* border: 1px solid #fff; */
}

.tile-controls input[type='file'] {
  font-size: 12px;
  width: 80px;
  border: 0;
}

.tile-controls .button > input[type='file'] {
  width: 100%;
}

.tile-controls input[type='number'] {
  width: 50px;
}

#tiles canvas {
  display: block;
  margin: 0 auto;
  /* width: 512px;
  height: 384px; */
  background: var(--transparent-image);
  cursor: crosshair;
}

.tile-controls > div {
  margin-bottom: 12px;
}

strong {
  font-weight: 600;
}

#tile-map-container {
  position: relative;
  min-width: 140px;
  overflow: scroll;
}

#tile-map-container canvas {
  background-color: white;
  background-image: var(--bg-image);
}

[data-scale='8'] #tile-map-container canvas {
  --bg-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'><rect stroke='black' stroke-width='0.2' stroke-opacity='100%' fill='rgba(0,0,0,.1)' width='24' height='24' x='0' y='0' /><rect fill='rgba(255,255,255,0.4)' width='12' height='12' x='1' y='1' /><rect fill='rgba(255,255,255,0.4)' width='11' height='11' x='12' y='12' /></svg>");
}

#tile-map-container canvas {
  --bg-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48'><rect stroke='black' stroke-width='0.2' stroke-opacity='100%' fill='rgba(0,0,0,.1)' width='48' height='48' x='0' y='0' /><rect fill='rgba(255,255,255,0.5)' width='24' height='24' x='1' y='1' /><rect fill='rgba(255,255,255,0.5)' width='23' height='23' x='24' y='24' /></svg>");
}

#tile-map-container canvas {
  /* width: 100%; */
  margin-right: auto;
  margin-left: 0;
  display: block;
  position: relative;
}

details summary {
  font-weight: bold;
  font-size: 120%;
}

details {
  margin-bottom: 20px;
}

details {
  font-size: 90%;
}

.columns {
  columns: 2;
}

.columns div {
  break-inside: avoid;
}

.columns dt {
  break-inside: avoid;
}

.tabbed {
  max-width: 100%;
  min-width: 75%;
  flex-grow: 1;
}

.tabbed > section {
  border: 2px solid black;
  border-radius: 4px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: 16px;
}

.tab-navigation ul {
  background: none;
  padding: 0;
  margin: 0;
}

.tab-navigation li {
  padding: 0;
}

.tab-navigation a {
  display: block;
  padding: 8px 16px;
  background: linear-gradient(#222, #222);
  margin-right: 16px;
  border-top-left-radius: 2px;
  border-top-right-radius: 2px;
}

.tab-navigation a.selected {
  background: linear-gradient(#111, black);
}

#importer > div {
  display: flex;
  flex-wrap: wrap;
}

#png-container {
  position: relative;
}

#png-container .focus {
  position: absolute;
  top: 0;
  left: 0;
  border: 0 solid rgba(127, 127, 127, 0.5);
  background: none;
  pointer-events: none;
  width: 512px;
  height: 512px;
  --i-base: 248px;
  --i-dim: 2;
  --i-scale: 8;

  --i-factor: calc(var(--i-dim) / var(--i-scale) - 1px);

  border-width: calc(var(--i-base) - 8 * var(--i-factor));
}

#png-container[data-dimensions='8'] .focus {
  --i-dim: 8px;
}

#png-container[data-dimensions='16'] .focus {
  --i-dim: 16px;
}

#png-container[data-dimensions='32'] .focus {
  --i-dim: 32px;
}

#png-container[data-dimensions='64'] .focus {
  --i-dim: 64px;
}

#png-container[data-dimensions='128'] .focus {
  --i-dim: 128px;
}

#png-container[data-dimensions='256'] .focus {
  --i-dim: 256px;
}

#png-container[data-zoom='4'] .focus {
  --i-scale: 1;
}

#png-container[data-zoom='3'] .focus {
  --i-scale: 2;
}

#png-container[data-zoom='2'] .focus {
  --i-scale: 4;
}

#png-container[data-zoom='1'] .focus {
  --i-scale: 8;
}

#png-container[data-zoom='0'] .focus {
  --i-scale: 16;
}

.fixed-label {
  display: flex;
  align-items: center;
}

.fixed-label > label:first-child,
.fixed-label > span:first-child {
  width: 60px;
  min-width: min-content;
}

.range label {
  display: flex;
  align-items: center;
}

.range input[type='range'] {
  flex: 1;
  margin-left: 20px;
}

#png-import-tools p {
  max-width: 240px;
  font-size: 90%;
  line-height: 1.4;
}

#png-container canvas {
  cursor: grab;
}

#png-container canvas {
  cursor: grab;
}

#png-container[data-dragging='true'] canvas {
  cursor: grabbing;
}

.tools > .button:last-of-type,
.tools > button:last-of-type {
  margin-bottom: 0;
}

.button--download {
  margin: 8px auto;
  width: auto;
  font-size: 90%;
}

.col2 {
  columns: 2;
}

.col2 dl {
  break-inside: avoid;
}

#change-log {
  margin-top: 32px;
  padding-top: 32px;
  font-size: 90%;
  border-top: 1px solid #ccc;
}

#usage > div {
  max-width: 960px;
}

#usage h2:before {
  content: '# ';
}

#current-sprite {
  white-space: nowrap;
  text-align: center;
  width: 80px;
  font-size: 80%;
  margin: 8px auto;
  order: 2;
}

code {
  background: #222;
  border-color: #222;
}

small {
  font-size: 60%;
}

.tile-controls.tools {
  padding-top: 0;
}

#preview-8x8 {
  display: none;
  justify-content: space-between;
  background-color: transparent;
  order: 4;
}

[data-scale='8'] #preview-8x8 {
  display: flex;
  flex-wrap: wrap;
  max-width: 104px;
  margin: 10px auto;
}

.current-scale:after {
  content: '16';
}

[data-scale='8'] .current-scale:after {
  content: '8';
}

#preview-8x8 canvas {
  background: var(--transparent-image);
  width: 48px;
  height: 48px;
  padding: 0;
  transition: scale 100ms ease-in;
  margin: 4px 0;
  flex: 0;
}

#preview-8x8 canvas:hover {
  outline: 0;
  transform: scale(1.05);
}

[data-sub-sprite='0'] #preview-8x8 canvas[data-index='0'],
[data-sub-sprite='1'] #preview-8x8 canvas[data-index='1'],
[data-sub-sprite='2'] #preview-8x8 canvas[data-index='2'],
[data-sub-sprite='3'] #preview-8x8 canvas[data-index='3'] {
  outline: 2px dashed yellow;
}

nav ul li:last-child {
  flex-grow: 0;
}

.zoom-button {
  flex-grow: 1;
  text-align: right;
}

.zoom-button span {
  cursor: pointer;
}

.zoom-button span:hover {
  text-decoration: underline;
}

main:fullscreen {
  padding: 40px 20px 40px 0;
  margin: 0 auto;
  background: #373737;
  overflow: scroll;
}

main:fullscreen > :last-child {
  padding-bottom: 40px;
}

.pickerColour > div:after {
  content: attr(data-hex);
  font-size: 9px;
  text-align: center;
  display: block;
  position: absolute;
  bottom: -13px;
  letter-spacing: -1px;
  width: 24px;
}

.picker.sprite > div:hover:after {
  font-size: 80%;
  content: attr(title);
  position: absolute;
  width: 192px;
  text-align: center;
  pointer-events: none;
  left: 0;
  bottom: -24px;
}

#current-tile {
  text-align: center;
  margin: 0;
}

[data-scale='8'] button[data-action='toggle-scale'] {
  background: white;
  color: black;
  outline: none;
  border: 2px solid black;
}

[data-animate='true'] button[data-action='toggle-animate'] {
  background: white;
  outline: none;
  border: 2px solid black;
}

[data-animate='true'] button[data-action='toggle-animate'] path {
  fill: black;
}

#index-map {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
}

#index-map * {
  outline: 1px solid rgba(0, 0, 0, 0.5);
  font-size: var(--data-scale);
  text-align: center;
  height: calc(var(--tile-zoom-scale) * var(--data-scale));
  width: calc(var(--tile-zoom-scale) * var(--data-scale));
  line-height: calc(var(--tile-zoom-scale) * var(--data-scale));
  text-shadow: 1px 1px 1px black;
}

#map-settings h2 {
  display: inline;
}

#map-settings > summary::marker {
  font-size: 14px;
}

#map-settings:not([open]) {
  min-width: auto;
  margin-right: 0;
  padding: 0px;
}

#map-settings:not([open]) > summary {
  font-size: 0px;
  white-space: nowrap;
}

#map-settings:not([open]) > summary span {
  display: none;
}

#map-settings:not([open]) > summary h2 {
  font-size: 16px;
}

#map-settings:not([open]) > summary h2:before {
  content: 'S';
}

#palette .tools {
  padding: 0 20px;
  margin-left: 0;
}

.palette-count {
  display: none;
}

.numeric-map * {
  font-family: monospace;
}

#palette .palette-count {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-wrap: wrap;
}

.palette-count * {
  z-index: 100;
  /* outline: 1px solid rgba(0, 0, 0, 0.5); */
  font-size: 9px;
  overflow: hidden;
  text-align: center;
  height: var(--scale);
  width: var(--scale);
  line-height: var(--scale);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

#palette .pickerColour div {
  outline: none;
}

#palette .zoom {
  /* width: 144px; */
  height: 192px;
}

#palette #complete {
  --scale: 12px;
  height: calc(32 * var(--scale));
  width: calc(16 * var(--scale));
}

#palette .pal-tools {
  margin-top: 32px;
}

#palette .pal-tools > div {
  display: flex;
  align-items: center;
}

#palette .pal-tools > div > span {
  margin-right: 8px;
}

#palette .pal-shift button {
  flex: 0;
  padding: 0 8px;
}

#palette .current-palette {
  display: flex;
  flex-direction: column;
}

#palette > div:first-child {
  margin-bottom: 32px;
}

#palette select,
#palette input {
  background: white;
  color: black;
  border: 1px solid #ccc;
  margin: 8px 0;
  font-size: 16px;
}

#palette #find-colour {
  width: 100%;
}

#palette .picker {
  position: relative;
  order: initial;
}

#palette .active-palette .picker {
  --scale: 24px;
  width: 384px;
  position: relative;
}

#palette .active-palette .sprite > div:hover::after {
  width: 384px;
}

@media screen and (max-width: 1104px) {
  main {
    flex-direction: column;
  }

  #sprites {
    margin-bottom: 16px;
    flex-direction: row;
    margin-right: 0;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
  }

  #tools,
  .tools {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
  }

  #sprites > :first-child {
    order: 4;
  }

  #sprites .button--download {
    margin-top: 0;
  }

  [data-scale='8'] #preview-8x8 {
    order: 2;
    margin: 0;
  }

  #current-sprite {
    order: 9;
    margin: 0px;
    margin: 0;
    display: block;
    width: 100%;
  }

  #sprites .container {
    width: calc(16 * 16px);
    order: 3;
    flex-grow: 1;
    margin-bottom: 4px;
  }

  #sprites button {
    /* margin: 16px; */
    padding: 16px 32px;
  }

  #sprites button br {
    white-space: nowrap;
  }

  .tabbed {
    width: 100%;
  }
}

label[for='has-priority'] {
  margin-top: 16px;
}

.priority {
  -webkit-clip-path: polygon(
    16px -21px,
    -371px -79.16%,
    -372px 1908.32%,
    497px 1891.67%,
    2095.83% -179.17%,
    100% 25%,
    75% 0px
  );
  clip-path: polygon(
    16px -21px,
    -371px -79.16%,
    -372px 1908.32%,
    497px 1891.67%,
    2095.83% -179.17%,
    100% 25%,
    75% 0px
  );
}

._priority:before {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  height: calc(var(--scale));
  width: calc(var(--scale));
  background: black;
  transform: rotate(45deg) translateX(50%) translateY(50%);
  transform-origin: 100% 125%;
}

#animate {
  margin-top: 20px;
}

#animate .tools {
  margin-left: 0;
}

#animate .tools label,
#animate .tools span,
.smaller {
  font-size: 80%;
}

#animate-container canvas {
  display: block;
  margin: 0 auto;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: var(--block-size-w);
  height: var(--block-size-h);
}

input[type='color'] {
  border: 0;
}

::-webkit-color-swatch,
::-moz-color-swatch {
  border-color: transparent;
}

#bit-size {
  order: 4;
  justify-content: center;
  margin: 0 10px;
}

.button-radio {
  text-align: center;
  display: block;
  font-size: 12px;
}

.button-radio-group .button {
  padding: 4px 8px;
  margin: 8px;
  width: auto;
}

.button-radio-group input {
  opacity: 0;
  position: absolute;
}

input:checked + .button-radio {
  background: white;
  color: black;
  border: 2px solid black;
  outline: none;
}

#sprite-editor [data-pal] button {
  border: none;
}

#sprite-editor [data-pal='0'] button:nth-child(1) {
  opacity: 1;
}
#sprite-editor [data-pal='1'] button:nth-child(2) {
  opacity: 1;
}
#sprite-editor [data-pal='2'] button:nth-child(3) {
  opacity: 1;
}
#sprite-editor [data-pal='3'] button:nth-child(4) {
  opacity: 1;
}
#sprite-editor [data-pal='4'] button:nth-child(5) {
  opacity: 1;
}
#sprite-editor [data-pal='5'] button:nth-child(6) {
  opacity: 1;
}
#sprite-editor [data-pal='6'] button:nth-child(7) {
  opacity: 1;
}
#sprite-editor [data-pal='7'] button:nth-child(8) {
  opacity: 1;
}
#sprite-editor [data-pal='8'] button:nth-child(9) {
  opacity: 1;
}
#sprite-editor [data-pal='9'] button:nth-child(10) {
  opacity: 1;
}
#sprite-editor [data-pal='10'] button:nth-child(11) {
  opacity: 1;
}
#sprite-editor [data-pal='11'] button:nth-child(12) {
  opacity: 1;
}
#sprite-editor [data-pal='12'] button:nth-child(13) {
  opacity: 1;
}
#sprite-editor [data-pal='13'] button:nth-child(14) {
  opacity: 1;
}
#sprite-editor [data-pal='14'] button:nth-child(15) {
  opacity: 1;
}
#sprite-editor [data-pal='15'] button:nth-child(16) {
  opacity: 1;
}

.four-bit-pal {
  font-size: 14px;
  padding-top: 8px;
  order: 4;
}

#four-bit-pal-picker:hover button {
  opacity: 1;
}

#four-bit-pal-picker button {
  width: 12px;
  height: 12px;
  padding: 0;
  margin: 0;
  text-align: center;
  background: none;
  font-size: 8px;
  opacity: 0;
  border: none;
}

#four-bit-pal-picker button:hover {
  background: black;
  outline: 0;
}

[data-bit='8'] #four-bit-pal-picker,
[data-bit='8'] .four-bit-pal {
  display: none;
}

h4 {
  margin-bottom: 0;
}

h4 + p {
  margin-top: 0;
}

h4 > label {
  display: flex;
  align-items: center;
}

h4 > label > :first-child {
  margin-right: 8px;
}

#export {
  font-size: 90%;
}

#export h3 {
  margin-top: 32px;
}

#export h3:first-of-type {
  margin-top: 0;
}

#export input,
#export label {
  font-size: inherit;
}

.multi-input input {
  border: 0;
  background: rgba(0, 0, 0, 0.5);
}

.export-options {
  margin-left: 20px;
}

#export button {
  font-size: 80%;
}

#export-output {
  max-width: 100%;
  min-width: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 0;
  font-size: 90%;
  margin: 20px 0;
}

#export .flex-row > div {
  width: 45%;
}

#export > div {
  max-width: 800px;
}

#export h4 {
  margin-top: 8px;
}

#export h4:first-of-type {
  margin-top: 0;
}

#export-format div > label:first-child,
#export-format div > span:first-child {
  min-width: 100px;
  display: inline-block;
}

#export-format div {
  margin: 4px 0;
}

#export-output {
  margin-bottom: 0;
}

#export-output + div {
  margin-bottom: 16px;
  font-size: 11px;
  max-width: 600px;
}

button[data-action='download'].has-copy {
  position: relative;
  z-index: 10;
}

button[data-action='download'].has-copy:after {
  content: ' ';
  transition: transform 100ms ease-out;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24'><path fill='white' d='M10 17l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9m-6-6a1 1 0 011 1 1 1 0 01-1 1 1 1 0 01-1-1 1 1 0 011-1m7 0h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z'/></svg>");
  display: block;
  position: absolute;
  right: 0;
  width: 24px;
  height: 24px;
  top: 50%;
  z-index: -1;
  opacity: 0;
}

button[data-action='download'].copied:after {
  animation: bounce 1s 1 ease-in-out;
}

@keyframes bounce {
  10% {
    opacity: 1;
    transform: translateX(25px);
  }
  80% {
    opacity: 1;
    transform: translateX(25px);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}

h4 label {
  display: inline-block;
}

button[disabled] {
  background: #222;
  color: #444;
  border: #222;
  cursor: not-allowed;
  pointer-events: none;
}

#export label:not(:first-of-type) > input {
  margin-left: 8px;
}

#export label > input {
  margin-right: 4px;
}

label[for='export-sprite-asm-bytes'] .export-value-size,
label[for='export-sprite-asm-byte-type'] .export-value-size {
  text-transform: capitalize;
}

#palette-editor {
  max-width: 100%;
  min-width: 100%;
  width: 100%;
  border: 0;
  font-size: 90%;
  margin: 0;
  padding: 8px;
  background: none;
  z-index: 10;
  position: relative;
  line-height: 1.4;
  height: 100%;
  min-height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);

  /* padding-left: 20px; */
}

#palette-editor-shadow {
  min-height: 310px;
  position: relative;
}

#editor-shadow {
  border-radius: 2px;
  line-height: 1.4;
  z-index: 1;
  display: block;
  max-width: 100%;
  min-width: 100%;
  width: 100%;
  border: 0;
  font-size: 90%;
  margin: 0;
  margin-bottom: 20px;
  padding: 8px;
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.3);
  top: 0;
  left: 0;
  height: 100%;
  pointer-events: none;
  white-space: pre-line;
}

.button-spacer.reset-pal {
  margin-top: 12px;
}
