body {
    /* width: 1200px; */
    margin: 1em auto;
    color: #ddd;
    background-color: #333;
    font-size: 1.2em;
    line-height: 1.5;
    text-align: center;
}
h1 {
    font-size: 1.5em;
}
h2 {
    font-size: 1.2em;
    margin-bottom: 0;
}
input[type="checkbox"] {
    vertical-align: text-bottom;
}
.label-wrapper {
    display: block;
    margin: 1em auto;
}
#size {
    width: 50px;
    text-align: right;
}
#canvas {
    cursor: grab;
}
#canvas.grabbing {
    cursor: grabbing;
}
.grid-wrapper {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(4, max-content);
    grid-gap: 0.5em 0.5em;
    margin: 1em auto;
}
.grid-wrapper label[for] {
    text-align: right;
}
.span-2 {
    grid-column-end: span 2;
}
.span-4 {
    grid-column-end: span 4;
}
.slider-wrapper {
    text-align: left;
}
.slider-wrapper output {
    display: inline-block;
    width: 3em;
}
.grid-wrapper input[type="range"] {
    width: 200px;
    height: 1em;
    vertical-align: middle;
}
.grid-wrapper input[type="number"] {
    width: 56px;
    text-align: right;
}
.hidden {
    display: none;
}
.block-fit {
    display: block;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    margin: auto;
}
#download-btn {
    color: #ddd;
    font-weight: bold;
    background-color: #666;
    border: 1px solid black;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 100%;
    box-shadow: inset -3px -3px 3px rgba(0, 0, 0, 0.5),
                inset 3px 3px 3px rgba(255, 255, 255, 0.5);
}
#download-btn:hover {
    color: white;
    background-color: #888;
}
#download-btn:active {
    padding: 12px 18px 8px 22px;
    box-shadow: inset 3px 3px 3px rgba(0, 0, 0, 0.5),
                inset -3px -3px 3px rgba(255, 255, 255, 0.5);
}
a:link {
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #999;
    opacity: 0.5;
    transition: all 0.2s ease-in-out;
}
footer:hover {
    opacity: 1;
}
footer a {
    color: white;
}
form.drop-over {
    background: #aaa;
}
#colors-wrapper {
    display: grid;
    justify-content: center;
    grid-template-columns: repeat(2, max-content);
    grid-gap: 0.5em 0.5em;
    margin: 0.5em auto;
}
input[type="color"] {
    width: 8em;
    height: 2em;
    border: 1px solid #666;
    outline: none;
    padding: 0;
    box-sizing: content-box;
    grid-row: 1 / 3;
}
input[type=color]::-webkit-color-swatch-wrapper {
  padding: 0; /* Remove browser's padding around color picker */
}
input[type=color]::-webkit-color-swatch {
  border: none; /* Remove browser's border around color in color picker */
}
input[type=color]::-moz-color-swatch {
  border: none; /* Remove browser's border around color in color picker */
}
input[type=color]::-moz-focus-inner {
  border: none; /* Remove browser's padding around color in color picker */
  padding: 0; /* Remove browser's padding around color in color picker */
}
.color-input {
    line-height: 0;
    display: grid;
    grid-template-columns: repeat(3, max-content);
    grid-template-rows: repeat(2, max-content);
    gap: 0 0.25em;
    align-items: center;
}
.color-input button {
    box-sizing: content-box;
    cursor: pointer;
}
.btn-remove {
    width: 1.5em;
    height: 1.5em;
    padding: 0;
    grid-column: 3;
    grid-row: 1 / 3;
}
.btn-up, .btn-down {
    margin: 0.05em 0;
    position: relative;
    grid-column: 2;
}
.btn-up div, .btn-down div {
    border-style: solid;
    height: 0;
    width: 0;
}
.btn-up div {
    border-color: transparent transparent rgba(0, 0, 0, 0.5);
    border-width: 0 0.5em 0.5em;
}
.btn-down div {
    border-color: rgba(0, 0, 0, 0.5) transparent transparent;
    border-width: 0.5em 0.5em 0;
}
#colors-wrapper .custom-colors-wrapper,
#colors-wrapper #color-select-2 {
    display: none;
}
#colors-wrapper.split-flag #color-select-1,
#colors-wrapper.split-flag.show-custom-colors-1 #custom-colors-1 {
    grid-column-end: span 1;
}
#colors-wrapper:not(.split-flag) #color-select-1,
#colors-wrapper:not(.split-flag).show-custom-colors-1 #custom-colors-1 {
    grid-column-end: span 2;
}
#colors-wrapper.split-flag #color-select-2,
#colors-wrapper.show-custom-colors-1 #custom-colors-1,
#colors-wrapper.split-flag.show-custom-colors-2 #custom-colors-1,
#colors-wrapper.split-flag.show-custom-colors-1 #custom-colors-2,
#colors-wrapper.split-flag.show-custom-colors-2 #custom-colors-2 {
    display: block;
}
#colors-wrapper.split-flag.show-custom-colors-2:not(.show-custom-colors-1) #custom-colors-1,
#colors-wrapper.split-flag.show-custom-colors-1:not(.show-custom-colors-2) #custom-colors-2 {
    visibility: hidden;
}
:disabled {
    cursor: not-allowed !important;
}