:root {
  --offset-x: 0px;
  --offset-y: 0px;
  --button-height: 36px;
  --button-width: 124px;
  --button-spacing-x: 24px;
  --button-spacing-y: 36px;
  --button-grid-count-x: 4096;
  --button-per-grid-x: 10;
  --button-grid-count-y: 2500;
  --button-per-grid-y: 10;

  --touch-bar-min: 5vh;
  --touch-bar-max: 24vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;

  font-family: "Hedvig Letters Sans", sans-serif;
  font-weight: 400;
  font-style: normal;
}

body * {
  cursor: var(--cursor-url) 16 16, auto;
}

.debug {
  position: sticky;
  bottom: 0;
  right: 0;
  z-index: 10;
  padding: 4px;
  overflow-y: scroll;


  height: 60px;
  width: 450px;

  background-color: rgba(0, 0, 255, 0.3);

  font-family: "Open Sans", sans-serif;
  text-wrap: wrap;
  color: red;
  font-size: 14px;
  font-weight: bolder;
}

.app-grid {
  position: relative;
  min-width: calc(var(--button-width) * var(--button-grid-count-x) * var(--button-per-grid-x) * 1px);
  min-height: calc(var(--button-height) * var(--button-grid-count-y) * var(--button-per-grid-y) * 1px);
  width: 100vw;
  height: 100vh;

  overflow-y: hidden;
  overflow-x: hidden;
}

.control-box {
  position: sticky;
  bottom: 0;
  left: 0;

  width: 100vw;
  min-height: var(--touch-bar-min);

  display: flex;
  flex-direction: column;

  background-color: #9e9e9e;
  border-top: 1px solid black;

  z-index: 10;
}

.touch-bar-control:hover {
  cursor: pointer;
}

input.touch-bar-control {
  appearance: none;
}

.touch-bar {
  overflow-y: hidden;
  transition: height 450ms ease-in-out;
}

input.touch-bar-control:checked~.touch-bar {
  height: var(--touch-bar-max);
}

input.touch-bar-control:not(:checked)~.touch-bar {
  height: 0;
}

input.touch-bar-control:not(:checked)~label svg {
  transform: rotate(180deg);
}

.touch-bar-icon {
  margin-top: 0.5rem;
  height: calc(var(--touch-bar-min) - 1rem);
}

label.touch-bar-control {
  width: 100%;
  height: var(--touch-bar-min);
  line-height: var(--touch-bar-min);
  text-align: center;

  box-shadow: inset 3px 3px 5px 5px #9e9c9c;
}

label.touch-bar-control:hover {
  box-shadow: inset 3px 3px 5px 5px #515151;
}

.control-box hr {
  border: 1px solid black;
}

.touch-bar {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  column-gap: 1rem;

}

.touch-bar .touch-bar-color {
  display: flex;
  flex-direction: column;

  align-items: center;
  align-content: stretch;
}

.touch-bar #color-select {
  height: 2rem;
  width: 100%;
}

.touch-bar div {
  box-sizing: content-box;
  padding: 0.5rem 1rem;
  text-align: center;
  align-self: center;
}

.touch-bar label {
  font-size: smaller;
}

.button-box {
  position: relative;
  width: 125vw;
  height: 125vh;
  padding: 25vh 25vw;
  overflow-y: hidden;
  overflow-x: hidden;

  text-wrap: nowrap;
}

.grid-container {
  position: absolute;
  display: grid;
  row-gap: var(--button-spacing-y);
  column-gap: var(--button-spacing-x);
  grid-auto-flow: row;

  padding-left: calc(var(--button-spacing-x) / 2);
  padding-right: calc(var(--button-spacing-x) / 2);
  padding-top: calc(var(--button-spacing-y) / 2);
  padding-bottom: calc(var(--button-spacing-y) / 2);
}

.app-debug .grid-container {
  border: 1px solid red;
}

.button {
  height: var(--button-height);
  width: var(--button-width);

  font-family: "Open Sans", sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  text-decoration: none;
  text-transform: uppercase;
  color: #000;
  /* cursor: pointer; */
  border: 3px solid;
  padding: 0.25em 0.5em;
  box-shadow: 1px 1px 0px 0px, 2px 2px 0px 0px, 3px 3px 0px 0px, 4px 4px 0px 0px, 5px 5px 0px 0px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.button:not(.seen) {
  opacity: 1;
  animation-name: fadeInOpacity;
  animation-iteration-count: 1;
  animation-timing-function: ease-in;
  animation-duration: 1.5s;
}

.button::after {
  content: 'Press me!';
}

.button.pressed::after {
  content: 'Thanks! 😃';
}

@keyframes fadeInOpacity {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.button:active,
.button.pressed {
  box-shadow: 0px 0px 0px 0px;
  top: 5px;
  left: 5px;
}