/* A better box-sizing model */
*,
*:before,
*:after {
  box-sizing: border-box;
}

:root {
  font-family: sans-serif;
  font-size: 16px;
  --background: #333333;
  --toolbar: #464646;
  --text: #e5e5e5;
  --text-accent: #e5e5e5;
}

* {
  margin: 0; /* Remove default margins */
}

html,
body {
  margin: 0;
  padding: 0;
}

input,
button,
textarea,
select {
  font: inherit; /* Remove built-in form fonts */
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  color: var(--text);
  overflow: hidden;
}

canvas {
  display: block;
  image-rendering: pixelated;
}

.page-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.gutter {
  background-color: #434343;
  background-repeat: no-repeat;
  background-position: 50%;
}

.gutter.gutter-horizontal {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==");
  cursor: col-resize;
}

#drafting-pane {
  display: flex;
}

.toolbar {
  font-size: large;
  font-weight: 800;
  padding: 5px;
  background-color: var(--toolbar);
  color: var(--text);
}

.draft-layout {
  flex: 1;
  display: grid;
  gap: 1rem;
  padding: 1rem;
  overflow: hidden;
  justify-content: end;
  box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.69) inset;
  grid-template-columns: 1fr min-content min-content;
  grid-template-rows: min-content min-content 1fr;
}

#threading-container,
#drawdown-container,
#warp-color-container {
  position: relative;
  overflow-x: auto;
  display: flex;
  align-items: start;
}

#tie-up-container {
  position: relative;
}

#treadling-container,
#drawdown-container,
#weft-color-container {
  overflow-y: auto;
}

#drawdown {
  position: relative;
}

#drawdown-repeat,
#drawdown-repeat-container {
  right: 0;
  top: 0;
  position: absolute;
}

#drawdown-repeat-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.4;
  transition: opacity 200ms;
}

#drawdown-repeat-container:hover {
  opacity: 1;
}

#drawdown-overlay {
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
}

.spacer {
  min-width: 0;
  flex: 1;
}

#sim-pane {
  overflow: hidden;
}

.draft-controls {
  padding: 0.5rem;
  background-color: var(--toolbar);
  flex: 0 0 6.5rem;
}

.draft-controls > div {
  display: block;
}

.draft-numbers {
  position: absolute;
  display: flex;
  justify-content: space-around;
  width: 100%;
  height: 1rem;
}

.draft-numbers--harnesses {
  flex-direction: column; 
  height: 100%; 
  top: 0; 
  right: -1.25em; 
  width: 0;
}

.draft-numbers--treadles {
  top: -1.75em;
}

.btn--increase {
  opacity: 0;
  transition: all 200ms;
  font-size: 0.875rem;
  line-height: 1;
  padding: 0.5rem;
  /* background-color: var(--toolbar); */
  color: var(--text);
  border: none;
  cursor: pointer;
  width: 100%;
}

.btn--increase:active {
  box-shadow: none;
}

#treadling-container > div:hover .btn--increase {
  opacity: 1;
}

select,
input[type="number"] {
  padding: 0.5rem;
  font-size: 1rem;
  border: none;
  background-color: #343434;
  color: var(--text);
  width: 100%;
  margin: 0 0 1rem 0;
}

label {
  color: var(--text);
  margin: 0 0 0.25rem 0;
  display: block;
  font-size: 0.75rem;
}

select:active,
select:focus,
input[type="number"]:active,
input[type="number"]:focus {
  outline: 1px solid #e5e5e5;
}

/**********************************

YARN PICKER

**********************************/

#yarn-picker {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
}

.btn.color-select {
  align-self: auto;
  flex: 0 0 50px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid black;
  overflow: hidden;
  justify-content: space-between;
}

.color-preview {
  aspect-ratio: 1;
  height: 100%;
  position: relative;
  background: var(--current);
}

.color-label {
  font-size: larger;
  font-weight: 900;
  flex: 1;
  padding: 0 8px;
  line-height: 0;
}

#yarn-picker .btn.selected {
  outline: 1px solid white;
  color: #fff;
  background-color: hsla(0, 0%, 54%, 0.216);
}

.edit-color-btn {
  border: 0;
  outline: 0;
  padding: 0;
  cursor: pointer;
  background-color: transparent;
  height: 100%;
  width: 100%;
}

.edit-color-icon {
  color: #fff;
  pointer-events: none;
  position: absolute;
  line-height: 1;
  top: 5px;
  left: 5px;
}

.edit-color-icon > i {
  line-height: 0;
  text-shadow: 0px 0px 2px black;
}

.delete-color-button {
  position: absolute;
  display: flex;
  padding: 0;
  border: 0;
  outline: 0;
  background-color: transparent;
  color: #343434;
  font-size: x-large;
  line-height: 1;

  bottom: 2px;
  right: 2px;

  cursor: pointer;
}

.delete-color-button:hover {
  color: red;
  text-shadow: 0px 0px 3px black;
}

.color-input {
  border: 0;
  padding: 0;
  margin: 0;
  height: 100%;
}

.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-input::-webkit-color-swatch {
  border: none;
}

/***********************************

BUTTONS

***********************************/

/* Reset Link style */
a.btn {
  text-decoration: none;
}

/* Reset button style */
button.btn {
  border: none;
  background-color: transparent;
  font-family: inherit;
  padding: 0;
  cursor: pointer;
}

a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 8px;
  color: var(--text-accent);

  text-align: center;
  align-self: start;

  padding: 0.5em;
}

a.btn:hover,
button.btn:hover {
  color: #fff;
  background-color: hsla(317, 82%, 74%, 0.448);
}

a.btn:focus,
button.btn:focus {
  outline-style: solid;
  outline-color: transparent;
  box-shadow: 0 0 0 2px hsla(317, 82%, 74%, 0.8);
}

/* Icon + text button */
button.btn.icon-text {
  font-size: 1em;
  line-height: 1;

  gap: 0.5em;
}

button.btn.icon-text > i {
  width: 1em;
  height: 1em;
}

/* Icon button */
button.btn.icon {
  aspect-ratio: 1;
  padding: 0.3em;
  font-size: 1.5em;
}

/* Solid button */
button.btn.solid {
  background-color: #343434;
  box-shadow: 0 0 2px 0 black;
}

.scroller::-webkit-scrollbar {
  display: none;
}
