html {
  height: 100%;
  position: relative;
  background-color: black;
  -webkit-overflow-scrolling: touch;
  overflow: hidden;
  overscroll-behavior: none;
}

* {
  touch-action: manipulation;
}

body {
  height: 100%;
  position: relative;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  outline: none;

  overflow-x: clip;
  overflow-y: clip;
  -webkit-overflow-scrolling: touch;
}

body {
  font: 16px "Overpass", "Open Sans", Helvetica, sans-serif;
  color: #ccc;
  font-weight: 300;
}

button,
input {
  border-radius: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color: black;
  font-size: 15px;
}

button,
select {
  outline: none;
}

/* General reset for buttons Safari */
button,
select {
  -webkit-appearance: none;
  /* Remove Safari-specific appearance */
  -moz-appearance: none;
  /* Remove Firefox-specific appearance */
  appearance: none;
}

button.select-container select {
  width: 100%;
  height: 100%;
  border: none;
  color: #000;
  font-size: 30px;
  text-align: center;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

button.select-container select option {
  background: white;
  color: black;
  padding: 20px;
  margin: 20px;
  font-size: 24px;
}

/* Hide default select arrow */
select::-ms-expand {
  display: none;
}

button.select-container {
  width: 93px !important;
}

.collapsed,
.hidden {
  display: none !important;
}

.empty {
  visibility: hidden !important;
}

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

.box {
  width: 100%;
  height: 100%;
}

.f-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: auto 1;
}

.f-column.center {
  align-items: center;
}

.f-row {
  display: flex;
  flex-direction: row;
}

.f-row.start,
.f-column.start {
  align-items: flex-start;
}

.f-row.end,
.f-column.end {
  align-items: flex-end;
}

.f-row.stretch,
.f-column.stretch {
  align-items: stretch;
}

.f-row.wrap,
.f-column.wrap {
  flex-wrap: wrap;
}



/* bars */
.bar {
  height: auto;
  flex: 1;
}

.bar button {
  /*height: 128px !important;*/
  /*padding: 9.6px 0.6px 9.6px 1.6px;*/
  margin: 0.5px;
  width: 92px !important;
}

.v-bar {
  flex-wrap: wrap;
}

.v-bar.w160 {
  width: 166px;
}

.v-bar.w196 {
  width: 196px;
}

.v-bar button {
  font-size: 15px;
}

/* h-bar */
.h-bar {
  /*width: auto;
flex: 1;*/
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.h-bar button {
  font-size: 15px;
}

.h-bar.h500 {
  width: 500px;
}

.h-bar.mh380 {
  min-width: 400px;
}

.h-bar.h1200 {
  width: 1125px;
}

@media(max-width: 1200px) {
  .h-bar.h1200 {
    flex-wrap: nowrap;
  }
}

@media(max-width: 850px) {
  .h-bar.h1200 {
    width: 645px;
    flex-wrap: wrap;
  }
}

/* 1em=16px GPT task*/

.h-bar select {
  margin: 8px;
  min-width: 60px;
}

.h-bar button {
  padding: 0 4.8px;
  margin: 0.5px;
  font-size: 15px;
  min-width: 38px;
}

.top-z {
  z-index: 100;
}

/*side panel */
#side-v-tool-bar {
  background-color: #33333388;
}

#side-v-tool-bar button {
  background-color: #444;
  color: white;
  width: 82px !important;
  height: 128px !important;
}

#side-v-tool-bar button svg {
  width: 61px;
  padding: 6px;
  fill: white;
  stroke: white;
  stroke-width: 0px;
}

#side-v-tool-bar button.activated,
.panel-h-tool-bar button.activated {
  background-color: #666;
  border: solid 2px #00cfff;
}

#side-v-tool-bar button>p>span {
  background-color: dodgerblue;
}

/* layer item */
.layer-item div {
  margin: 8px;
  min-width: 40px;
}

.layer-item {
  border: 2px solid transparent;
  background: #33333388;
  width: 405px;
  margin-top: 2px;
}

.layer-item.active {
  border: 2px solid #00cfff;
}

.layer-item div:nth-child(1) {
  min-width: 16px;
}

.layer-item div:nth-child(2) {
  min-width: 48px;
}

.layer-item div:nth-child(4) {
  min-width: 56px;
}

.layer-item div:nth-child(5) {
  min-width: 80px;
}

.layer-item button {
  width: 100%;
  height: 100%;
  padding: 5px;
  border-radius: 10%;
  border-style: solid;
  border-color: white;
}

.panel-h-tool-bar button {
  width: 135px;
  height: 40px;
  padding: 8px;
  background-color: #444;
  color: white;
}

.hex-panel-h-tool-bar button {
  width: 161px;
  height: 40px;
  padding: 8px;
  background-color: #444;
  color: white;
}

.layer-item button.hidden-state {
  background-color: red;
  color: white;
}

.layer-item button.visible-state {
  background-color: green;
  color: white;
}

#layer_tile_shape_select {
  width: 100%;
  height: 100%;
  font-size: 100%;
  text-align: center;
  background: #c5bfbb;
}

/* KUDOS to @perpaer https://codepen.io/perpaer/pen/beGbbe */
/* scrollable list layers */
.scroll-wrapper {
  height: 400px;
  display: flex;
  flex-direction: column;
}

.scroll-header {
  display: flex;
  justify-content: flex-start;
  border-bottom: 1px solid gray;
}

.scroll-header .split {
  flex: 1 0 auto;
}

.scroll-body {
  overflow-y: auto;
  border-left: 1px solid gray;
}

.scroll-body-item {
  display: flex;
  border-bottom: 1px solid gray;
}

.scroll-header select,
.scroll-header button {
  height: 32px;
  margin-top: 6px;
}

.scroll-body-item label {
  white-space: break-spaces !important;
  margin-left: 6px;
  flex: 0 1 auto;
}

.f-stretch {
  justify-content: space-around;
}

/* container for header */
.pop-panel-header.f-row {
  justify-content: space-between;
}

.header-switch {
  display: flex;
  flex-direction: column;
  width: 100px;
  margin-top: 5px;
}

.header-switch label {
  font-size: 16px;
  margin-top: 3px;
  text-align: start;
}

.line-width-switch-h {
  margin-top: 5px;
  margin-left: 5px;
  display: flex;
  flex-direction: column;
}

.line-width-switch-h label {
  margin-top: 5px;
}

.line-width-switch-v {
  margin-top: 10px;
  margin-left: 20px;
  display: flex;
  flex-direction: column;
}

.line-width-switch-v label {
  margin-top: 10px;
}

/* slider .range-value */
#floating-tools-panel-slider .range-value {
  padding: 6px 5px;
  border-radius: 5px;
  margin: 6px;
  width: 62px;
}

#bottom-tools-panel-slider .range-value {
  padding: 13px 5px;
  border-radius: 5px;
  margin: 7px;
  width: 64px;
  pointer-events: auto;
}


/* cmd-pad legacy*/
/* TODO: .select-container special layout */
.cmd-pad button.select-container svg {
  padding: 2px 10px;
  height: 64px;
  width: 75px;
  z-index: 1;
  position: absolute;
  pointer-events: none;
}

.cmd-pad .select-container select {
  /*width: 77px;*/
  z-index: 0;
  height: 100%;
  /*padding-top: 100px;*/
  background-color: #F0F0F0;
  color: transparent;
  border-radius: 0;
  /* disable Safari style */
  border: 0;
}

.cmd-pad .select-container div.selected-value {
  position: absolute;
  width: 77px;
  height: 35px;
  margin: 0;
  margin-top: 70px;
  padding-bottom: 5px;
  z-index: 0;
  pointer-events: none;
  border-bottom: solid dodgerblue 2px;
}

.cmd-pad .select-container select option {
  color: black;
}

.cmd-pad button {
  height: 100%;
  max-height: 192px;
  min-height: 150px;
  width: 86px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  border-bottom: 5px solid #aaa;
  border-top: 5px solid #F0F0F0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  position: relative;
}

.cmd-pad select {
  width: 100%;
  height: 27%;
  background-color: dodgerblue;
  color: white;
  font-size: 16px;
}

.cmd-pad div {
  margin: 2px;
}

.cmd-pad button.non-toggle-btn {
  border: 5px solid #F0F0F0;
}

.cmd-pad button.activated {
  border: 5px solid #00cfff;
  border-bottom: 5px solid #F0F0F0;
}

.cmd-pad button svg {
  padding: 2px 8px;
  height: 64px;
  width: 100%;
  margin-bottom: 16px;
}

.cmd-pad button.disabled {
  stroke: grey;
  fill: grey;
  background-color: #444;
  color: darkgrey;
}

.cmd-pad button.warning {
  background-color: #ffb600;
  color: white;
  border: solid 2px yellow;
  scale: 1.5;
  z-index: 999;
}

/* static-panel */

#player-panel {
  position: fixed;
  /* top: calc(100vh - 90px);
left: calc(100vw - 360px); */
  top: 30px;
  right: 230px;
  /* right: 30px; */
  border-radius: 10px;
  background: transparent;
  border: 0;
}

.player-pad-layout {
  transform-origin: top right;
}


#effects-panel {
  position: fixed;
  top: 30px;
  right: 30px;
  transform-origin: top right;
  border-radius: 10px;
  background: transparent;
  border: 0;
}

/* static panel v1*/
.static-panel .cmd-pad button {
  min-height: 80px;
  box-sizing: 0px;
  border: 1px solid grey;
}

.static-panel .cmd-pad button.activated {
  border: 4px solid #00cfff;
}

.static-panel .cmd-pad button svg {
  margin-top: 2px;
  margin-bottom: 2px;
  padding: 2px;
  width: 100%;
  height: 80px;
  box-sizing: border-box;
}

/* transform-origin for all panels */
.bottom-tools-panel .bottom-pad-layout {
  transform-origin: bottom left;
}

#side-tools-panel,
#layers-panel,
#palette-panel,
#color-mixer-circle,
.story-pad-layout,
.basic-pad-layout {
  transform-origin: top left;
}

.quick-pad-layout,
.floating-pad-layout {
  transform-origin: top right;
}