/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/* stylesheet */

:root {
    --resize-hover-cursor: auto;
    --fold-hover-cursor: pointer;
    --pink: #ff8ead;
    --darkpink: rgb(211, 103, 141);
    --lightpurple: #e1b9e8;
    --greywhite: #eeeeee;
    --lightgrey: #dcdcdc;
    --darkgrey: rgb(153, 153, 153);
    --redwhite: #fffafd;
    --lightestred: #f7dbdf;
    --lighterred: #ffcaca;
    --lightred: 1px solid #eca3a3;
    --darkred: #e15d5d;
    --darkestred: #cb414a;
    --instructions-font: "arial", "helvetica", sans-serif;
    --footer-font: "arial", "helvetica", sans-serif;
    --header-font: "Fira Sans", sans-serif;
    --body-font: "Fira Sans", sans-serif;
    --kbd-font: "Courier New", "Courier", monospace;
    --selected-font-weight: 450;
}

html, body, #wrapper {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    padding: 0;
    margin: 0;
}

body, input::file-selector-button, select, option, input {
    font-family: var(--body-font);
}

body {
    line-height: 1.5;
}

#wrapper {
    min-height: 100%;
}

#wrapper, .modal {
    display: flex;
    flex-direction: column;
}

main, .modal_content {
    flex-grow: 1;
    padding: 2em;
}

h1, h2 {
    font-family: var(--header-font);
}

h1 {
    font-weight: 300;
    font-size: xx-large;
    margin-bottom: 0.5em;
    color: var(--pink);
    border-bottom: 1px dashed var(--lightpink);
}

.instructions, input, .modal_content, .control_prompt, p {
    letter-spacing: 2.5%;
}

.instructions {
    list-style-type: disc;
    margin-bottom: 1em;
    margin-left: 1em;
    font-family: var(--instructions-font);
}

.instructions li::marker {
    color: var(--lightpurple);
}

p:not(.control_prompt), textarea {
    margin-bottom: 1em;
}

em {
    font-style: italic;
}

strong, h2, #upload_buttons label {
    font-weight: bold;
}

kbd {
    font-family: var(--kbd-font);
    border: 1px solid var(--lightgrey);
    background-color: var(--greywhite);
    padding: 3px 6px;
}

#upload_buttons li, .canvases li, .buttons li {
    display: inline;
}

#upload_buttons label {
    letter-spacing: 5%;
}

#upload_buttons {
    margin-bottom: -1em;
}

input::file-selector-button {
    padding: 4px;
}

.canvases {
    margin-top: 0.5em;
}

canvas {
    border: 1px solid var(--lightgrey);
}

canvas, input {
    margin-bottom: 4px;
}

#fold:hover {
    cursor: var(--fold-hover-cursor);
}

#resize_back:hover {
    cursor: var(--resize-hover-cursor);
}

.buttons, #appearance, #pieces, #pieces_error, #result_buttons, #result, .control_prompt:not(#fold_instruction), .modal {
    display: none;
}

.buttons li {
    margin-right: 4px;
}

.control {
    height: 24px;
    box-sizing: border-box;
}

.control, input[type="button"], input[type="file"], #pieces_list {
    font-size: 12px;
}

label.control:not(select + label) {
    margin: 0 4px;
}

label.control {
    letter-spacing: -1%;
}

input[type="text"] {
    max-width: 30px;
    padding-top: 3px; /* fake vertical centre on content */
}

input[type="checkbox"] {
    vertical-align: middle;
    margin: 0;
    transform: scale(1.2);
}

input+label {
    margin-left: -2px;
    margin-right: 2px;
}

.control_prompt, .modal_content, #fold_instruction {
    font-size: 13px;
}

.selected_type {
    font-weight: var(--selected-font-weight);
}

#fold_instruction {
    padding: 5px 0px 3px 0px;
}

#fold_instruction li {
    display: block;
}

#pieces h2 {
    font-size: large;
}

#pieces th, #pieces tr td {
    padding: 5px;
    vertical-align: middle;
}

#pieces th:not(:nth-child(1), :nth-child(2)), .pieces_control {
    border-left: 1px solid var(--darkgrey);
}

#pieces th {
    border-bottom: 1px solid var(--darkgrey);
    font-weight: bold;
}

#pieces td:not(:nth-child(2)) {
    text-align: center;
}

input[type="radio"] {
    accent-color: var(--pink);
}

select {
    font-family: var(--control-font);
}

#pieces_error {
    background-color: var(--lighterred);
    padding: 1em;
}

#pieces_error p:last-of-type {
    margin-bottom: 0;
}

.warning:before {
    content: "Warning: ";
    font-weight: bold;
}

.modal {
    z-index: 1;
    position: fixed;
    background-color: var(--redwhite);
    border: var(--lightestred);
    margin: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.big_modal {
    min-width: 60vw;
    min-height: 60vh;
}

.modal_content {
    padding: 3em 2em 2em 2em;
}

.active_modal, textarea {
    display: block;
}

textarea {
    height: 30vh;
    width: 30vw;
}

.close {
    background-color: var(--lighterred);
    border: 1px solid var(--lightred);
    color: var(--darkred);
    right: 0;
    min-width: max-content;
    width: 23px;
    padding: 3px;
    text-align: center;
    vertical-align: middle;
    line-height: 23px;
    font-size: 14px;
    position: fixed;
}

.close:hover {
    cursor: pointer;
    color: var(--darkestred);
}

footer {
    text-align: center;
    border-top: 1px dashed var(--lightpink);
    padding: 1em 25px 2em 25px;
    margin-top: 1em;
    flex-shrink: 0;
    font-family: var(--footer-font);
}

footer p {
    font-size: x-small;
}

footer a, footer a:visited {
    color: var(--pink);
}

footer a:hover {
    color: var(--lightpurple);
}

footer a:active {
    color: var(--darkpink);
}